org.glassfish.grizzly.http
Class HttpClientFilter

java.lang.Object
  extended by org.glassfish.grizzly.filterchain.BaseFilter
      extended by org.glassfish.grizzly.http.HttpCodecFilter
          extended by org.glassfish.grizzly.http.HttpClientFilter
All Implemented Interfaces:
Filter, JmxMonitoringAware<HttpProbe>, MonitoringAware<HttpProbe>

public class HttpClientFilter
extends HttpCodecFilter

Client side HttpCodecFilter implementation, which is responsible for decoding HttpResponsePacket and encoding HttpRequestPacket messages. This Filter is usually used, when we build an asynchronous HTTP client connection.

Author:
Alexey Stashok
See Also:
HttpCodecFilter, HttpServerFilter

Nested Class Summary
 
Nested classes/interfaces inherited from class org.glassfish.grizzly.http.HttpCodecFilter
HttpCodecFilter.ContentParsingState, HttpCodecFilter.HeaderParsingState
 
Field Summary
 
Fields inherited from class org.glassfish.grizzly.http.HttpCodecFilter
chunkingEnabled, contentEncodings, DEFAULT_MAX_HTTP_PACKET_HEADER_SIZE, isSecure, maxHeadersSize, monitoringConfig
 
Constructor Summary
HttpClientFilter()
          Constructor, which creates HttpClientFilter instance
HttpClientFilter(Boolean isSecure, int maxHeadersSize)
          Constructor, which creates HttpClientFilter instance, with the specific secure and max header size parameter.
HttpClientFilter(int maxHeadersSize)
          Constructor, which creates HttpClientFilter instance, with the specific max header size parameter.
 
Method Summary
 NextAction handleRead(FilterChainContext ctx)
          The method is called, once we have received a Buffer, which has to be transformed into HTTP response packet part.
 
Methods inherited from class org.glassfish.grizzly.http.HttpCodecFilter
addContentEncoding, addTransferEncoding, autoDetectSecure, checkEOL, createJmxManagementObject, decodeHttpPacket, encodeHttpPacket, encodeKnownHeaders, encodeMimeHeader, encodeMimeHeaders, findEOL, findSpace, getContentEncodings, getMonitoringConfig, getTransferEncodings, handleRead, handleWrite, indexOf, onAdded, onFilterChainChanged, parseHeader, parseHeaderName, parseHeaders, parseHeaderValue, put, put, put, put, removeContentEncoding, removeTransferEncoding, resizeBuffer, skipSpaces
 
Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, exceptionOccurred, getFilterChain, getIndex, handleAccept, handleClose, handleConnect, handleEvent, onRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientFilter

public HttpClientFilter()
Constructor, which creates HttpClientFilter instance


HttpClientFilter

public HttpClientFilter(int maxHeadersSize)
Constructor, which creates HttpClientFilter instance, with the specific max header size parameter.

Parameters:
maxHeadersSize - the maximum size of the HTTP message header.

HttpClientFilter

public HttpClientFilter(Boolean isSecure,
                        int maxHeadersSize)
Constructor, which creates HttpClientFilter instance, with the specific secure and max header size parameter.

Parameters:
isSecure - true, if the Filter will be used for secured HTTPS communication, or false otherwise. It's possible to pass null, in this case Filter will try to autodetect security.
maxHeadersSize - the maximum size of the HTTP message header.
Method Detail

handleRead

public NextAction handleRead(FilterChainContext ctx)
                      throws IOException
The method is called, once we have received a Buffer, which has to be transformed into HTTP response packet part. Filter gets Buffer, which represents a part or complete HTTP response message. As the result of "read" transformation - we will get HttpContent message, which will represent HTTP response packet content (might be zero length content) and reference to a HttpHeader, which contains HTTP response message header.

Specified by:
handleRead in interface Filter
Overrides:
handleRead in class BaseFilter
Parameters:
ctx - Request processing context
Returns:
NextAction
Throws:
IOException


Copyright © 2010 Oracle Corpration. All Rights Reserved.