org.glassfish.grizzly.filterchain.Filter , responsible for transforming Buffer into
HttpPacket and vice versa in asynchronous mode. When the HttpCodecFilter is added to a
org.glassfish.grizzly.filterchain.FilterChain , on read phase it consumes incoming Buffer and provides
HttpContent as the result of transformation. On write phase the HttpCodecFilter consumes input
HttpPacket and serializes it to a Buffer, which gets passed farther as the result of transformation.
So transformations, provided by this filter are following: (read phase): Buffer -> HttpContent (write
phase): HttpPacket -> Buffer.
HttpServerFilter, HttpClientFilter
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final byte[] | |
| protected final boolean | |
| protected static final byte[] | CLOSE_BYTES
Close bytes. |
| pack-priv static final byte[] | COLON_BYTES
Colon bytes. |
| protected final ArraySet | |
| pack-priv static final byte[] | CRLF_BYTES
CRLF bytes. |
| public static final int | |
| protected static final byte[] | KEEPALIVE_BYTES
Keep-alive bytes. |
| private static final Logger | |
| protected final int | |
| protected long | maxPayloadRemainderToSkip
The maximum request payload remainder (in bytes) HttpServerFilter will try to swallow after HTTP request processing is over in order to keep the connection alive. |
| protected final DefaultMonitoringConfig | monitoringConfig
File cache probes |
| public static final String | |
| protected boolean | |
| private boolean | |
| public static final String | |
| public static final String | |
| private final boolean | |
| private final boolean | |
| private final ArraySet |
| Access | Constructor and Description |
|---|---|
| public | HttpCodecFilter(final boolean
true if the chunked transfer encoding should be used when no explicit content
length has been set.the maximum size of the HTTP message header. maxHeadersSize)Constructor, which creates HttpCodecFilter instance, with the specific max header size parameter. |
| public | HttpCodecFilter(final boolean
true if the chunked transfer encoding should be used when no explicit content
length has been set.the maximum size of the HTTP message header. maxHeadersSize, final Properties the properties to be used for configuring the filter. props)Constructor, which creates HttpCodecFilter instance, with the specific max header size and properties parameter. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addContentEncoding(final ContentEncoding
the contentEncoding)ContentEncoding to add
Adds the specified |
| public void | addTransferEncoding(final TransferEncoding
the transferEncoding)TransferEncoding to add
Adds the specified |
| private boolean | checkRemainderOverflow(final HttpHeader httpHeader, final int payloadChunkSize)
Returns: true, if payload remainder read doesn't exceed the limit |
| protected Object | |
| pack-priv final HttpContent | |
| protected boolean | decodeHttpPacket(final FilterChainContext ctx, final HttpPacketParsing httpPacket, final Buffer input)
|
| protected boolean | decodeHttpPacketFromBuffer(final FilterChainContext ctx, final HttpPacketParsing httpPacket, final Buffer input)
|
| protected boolean | decodeHttpPacketFromBytes(final FilterChainContext ctx, final HttpPacketParsing httpPacket, final Buffer inputBuffer)
|
| pack-priv abstract boolean | Returns: true, if initial line has been parsed, or false otherwise.HTTP packet, which is being parsed httpPacket, HttpCodecFilter.HTTP packet parsing state parsingState,input input)BufferMethod is responsible for parsing initial line of HTTP message (different for |
| pack-priv abstract boolean | Returns: true, if initial line has been parsed, or false otherwise.HTTP packet, which is being parsed httpPacket, HttpCodecFilter.HTTP packet parsing state parsingState,input input, int index of the last available byte in the input array (offset is passed inside parsingState) end)Method is responsible for parsing initial line of HTTP message (different for |
| private NextAction | decodeWithTransferEncoding(final FilterChainContext ctx, final HttpHeader httpHeader, final Buffer input, final boolean wasHeaderParsed)
|
| pack-priv final HttpContent | |
| private static Buffer | encodeContentEncodingHeader(final MemoryManager<E extends Buffer> memoryManager, Buffer buffer, final HttpHeader httpHeader, final CacheableDataChunk name, final CacheableDataChunk value)
|
| protected Buffer | |
| protected final Buffer | encodeHttpPacket(final FilterChainContext ctx, final HttpHeader httpHeader, final HttpContent httpContent, final boolean isContentAlreadyEncoded)
|
| pack-priv abstract Buffer | Returns: resultBuffer.HTTP packet, which is being serialized httpPacket, Buffer output output, MemoryManager<E extends Buffer> memoryManager)BufferMethod is responsible for serializing initial line of HTTP message (different for |
| pack-priv Buffer | encodeInitialLine(HttpPacket httpPacket, HttpStatus status, Buffer output, MemoryManager<E extends Buffer> memoryManager)
Variant of |
| protected static Buffer | encodeKnownHeaders(final MemoryManager<E extends Buffer> memoryManager, Buffer buffer, final HttpHeader httpHeader)
|
| protected static Buffer | encodeMimeHeader(final MemoryManager<E extends Buffer> memoryManager, Buffer buffer, final DataChunk name, final DataChunk value, final byte[] tempBuffer, final boolean encodeLastCRLF)
|
| protected static Buffer | encodeMimeHeaders(final MemoryManager<E extends Buffer> memoryManager, Buffer buffer, final MimeHeaders mimeHeaders, final byte[] tempEncodingBuffer)
|
| protected static Buffer | encodeMimeHeaders(final MemoryManager<E extends Buffer> memoryManager, Buffer buffer, final MimeHeaders mimeHeaders, final byte[] tempEncodingBuffer, final boolean markSerialized)
|
| private static void | finalizeKnownHeaderNames(final HttpHeader httpHeader, final HttpCodecFilter.
|
| private static void | finalizeKnownHeaderNames(final HttpHeader httpHeader, final HttpCodecFilter.
|
| private static void | finalizeKnownHeaderValues(final HttpHeader httpHeader, final HttpCodecFilter.
|
| private static void | finalizeKnownHeaderValues(final HttpHeader httpHeader, final HttpCodecFilter.
|
| public ContentEncoding[] | |
| public long | getMaxPayloadRemainderToSkip()
Returns: the maximum request payload remainder (in bytes) HttpServerFilter will try to swallow after HTTP request processing is over in order to keep the connection alive. |
| public MonitoringConfig | getMonitoringConfig()
Implements org. Return the object associated |
| public TransferEncoding[] | |
| public final NextAction | Returns: NextActionRequest processing context ctx, final HttpHeader the current httpHeader)HttpHeader, which is being processed.The method is called by the specific HttpCodecFilter implementation, once we have received a |
| public NextAction | Returns: NextActionRequest processing context ctx)Overrides org. Implements org. The method is called, once we need to serialize a |
| protected boolean | Returns: true if chunked transfer-encoding may be used.Return |
| public boolean | |
| public boolean | isRemoveHandledContentEncodingHeaders()
Returns: |
| private boolean | |
| protected static boolean | Returns: true, if theConnection is secured, or false otherwiseflag, which indicates whether this HttpCodecFilter is dealing with the secured HTTP packets. |
| private static boolean | |
| private ContentEncoding | |
| protected abstract void | onHttpContentEncoded(final HttpContent
HttpContent, which represents HTTP packet headerprocessing context. ctx)Invoked when a HTTP body chunk has been encoded in preparation to being transmitted to the user-agent. |
| protected abstract void | onHttpContentError(HttpHeader
HttpHeader, which represents HTTP packet headerthe ctx, Throwable FilterChainContext processing this requestthe cause of the error t)Callback which is invoked when parsing an HTTP message payload fails. |
| protected abstract void | onHttpContentParsed(final HttpContent
request/response body content content, final FilterChainContext processing context. ctx)
Invoked as request/response body content has been processed by this |
| protected abstract void | onHttpHeaderError(HttpHeader
HttpHeader, which represents HTTP packet headerthe ctx, Throwable FilterChainContext processing this requestthe cause of the error t)Callback which is invoked when parsing an HTTP message header fails. |
| protected abstract boolean | Returns: true if an error has occurred while processing the header portion of the HTTP request, otherwise
returns false.HttpHeader, which represents parsed HTTP packet headerBuffer the header was parsed fromprocessing context. ctx)Callback invoked when the HTTP message header parsing is complete. |
| protected abstract void | onHttpHeadersEncoded(final HttpHeader
HttpHeader, which represents HTTP packet headerprocessing context. ctx)Invoked when HTTP headers have been encoded in preparation to being transmitted to the user-agent. |
| protected abstract void | onHttpHeadersParsed(final HttpHeader
HttpHeader, which represents HTTP packet headerthe headers portion, that has been parsed headers, final FilterChainContext processing context. ctx)
Invoked when HTTP headers portion comes for |
| protected abstract boolean | Returns: true if an error has occurred while processing the header portion of the HTTP request, otherwise
returns false.sHttpHeader, which represents parsed HTTP packet headerprocessing context. ctx)Callback method, called when |
| protected void | onIncomingUpgrade(final FilterChainContext ctx, final HttpHeader httpHeader)
The method is called, when a peer sends an upgrade HTTP packet (either request or response). |
| protected abstract void | onInitialLineEncoded(final HttpHeader
HttpHeader, which represents HTTP packet headerprocessing context. ctx)Invoked when the initial response line has been encoded in preparation to being transmitted to the user-agent. |
| protected abstract void | onInitialLineParsed(final HttpHeader
HttpHeader, which represents HTTP packet headerprocessing context. ctx)Invoked when either the request line or status line has been parsed. |
| protected void | |
| protected boolean | parseHeaderFromBuffer(final HttpHeader httpHeader, final MimeHeaders mimeHeaders, final HttpCodecFilter.
|
| protected boolean | parseHeaderFromBytes(final HttpHeader httpHeader, final MimeHeaders mimeHeaders, final HttpCodecFilter.
|
| protected int | parseHeaderName(final HttpHeader httpHeader, final MimeHeaders mimeHeaders, final HttpCodecFilter.
|
| protected int | parseHeaderName(final HttpHeader httpHeader, final MimeHeaders mimeHeaders, final HttpCodecFilter.
|
| protected boolean | parseHeadersFromBuffer(final HttpHeader httpHeader, final MimeHeaders mimeHeaders, final HttpCodecFilter.
|
| protected boolean | parseHeadersFromBytes(final HttpHeader httpHeader, final MimeHeaders mimeHeaders, final HttpCodecFilter.
|
| protected int | parseHeaderValue(final HttpHeader httpHeader, final HttpCodecFilter.
|
| protected int | parseHeaderValue(final HttpHeader httpHeader, final HttpCodecFilter.
|
| private ParsingResult | parseWithTransferEncoding(final FilterChainContext ctx, final HttpHeader httpHeader, final Buffer input)
|
| public boolean | Returns: true if the ContentEncoding was removed, otherwise false indicating the
ContentEncoding was not already presentthe contentEncoding)ContentEncoding to remove
Removes the specified |
| public boolean | Returns: true if the TransferEncoding was removed, otherwise false indicating the
TransferEncoding was not already presentthe transferEncoding)TransferEncoding to remove
Removes the specified |
| private Buffer | serializeWithTransferEncoding(final FilterChainContext ctx, final HttpContent httpContent, final TransferEncoding encoding)
|
| pack-priv final void | |
| pack-priv final void | |
| public void | setMaxPayloadRemainderToSkip(long maxPayloadRemainderToSkip)
Set the maximum request payload remainder (in bytes) HttpServerFilter will try to swallow after HTTP request processing is over in order to keep the connection alive. |
| public void | setPreserveHeaderCase(boolean
true to preserve header case.Set to |
| public void | setRemoveHandledContentEncodingHeaders(boolean
true if content-encoding headers that are handled by this
module should be removed from the headerIf enabled the content-encoding header for handled content-encodings is removed. |
| pack-priv final void | |
| pack-priv final void | setTransferEncodingOnSerializing(final FilterChainContext ctx, final HttpHeader httpHeader, final HttpContent httpContent)
|
| protected static boolean | statusDropsConnection(int status)
Determine if we must drop the connection because of the HTTP status code. |