Package org.glassfish.grizzly.http
Class ChunkedTransferEncoding
- java.lang.Object
-
- org.glassfish.grizzly.http.ChunkedTransferEncoding
-
- All Implemented Interfaces:
TransferEncoding
public final class ChunkedTransferEncoding extends Object implements TransferEncoding
Chunked transfer encoding implementation.- Author:
- Alexey Stashok
- See Also:
TransferEncoding
-
-
Constructor Summary
Constructors Constructor Description ChunkedTransferEncoding(int maxHeadersSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParsingResultparsePacket(org.glassfish.grizzly.filterchain.FilterChainContext ctx, HttpHeader httpPacket, org.glassfish.grizzly.Buffer buffer)Parse HTTP packet payload, represented byBufferusing specific transfer encoding.voidprepareSerialize(org.glassfish.grizzly.filterchain.FilterChainContext ctx, HttpHeader httpHeader, HttpContent content)This method will be called byHttpCodecFilterto let TransferEncoding prepare itself for the content serialization.org.glassfish.grizzly.BufferserializePacket(org.glassfish.grizzly.filterchain.FilterChainContext ctx, HttpContent httpContent)Serialize HTTP packet payload, represented byHttpContentusing specific transfer encoding.booleanwantDecode(HttpHeader httpPacket)Return true if this encoding should be used to parse the content of the passedHttpHeader, or false otherwise.booleanwantEncode(HttpHeader httpPacket)Return true if this encoding should be used to serialize the content of the passedHttpHeader, or false otherwise.
-
-
-
Method Detail
-
wantDecode
public boolean wantDecode(HttpHeader httpPacket)
Return true if this encoding should be used to parse the content of the passedHttpHeader, or false otherwise.- Specified by:
wantDecodein interfaceTransferEncoding- Parameters:
httpPacket-HttpHeader.- Returns:
- true if this encoding should be used to parse the content of the passed
HttpHeader, or false otherwise.
-
wantEncode
public boolean wantEncode(HttpHeader httpPacket)
Return true if this encoding should be used to serialize the content of the passedHttpHeader, or false otherwise.- Specified by:
wantEncodein interfaceTransferEncoding- Parameters:
httpPacket-HttpHeader.- Returns:
- true if this encoding should be used to serialize the content of the passed
HttpHeader, or false otherwise.
-
prepareSerialize
public void prepareSerialize(org.glassfish.grizzly.filterchain.FilterChainContext ctx, HttpHeader httpHeader, HttpContent content)This method will be called byHttpCodecFilterto let TransferEncoding prepare itself for the content serialization. At this time TransferEncoding is able to change, update HTTP packet headers.- Specified by:
prepareSerializein interfaceTransferEncoding- Parameters:
ctx-FilterChainContexthttpHeader- HTTP packet headers.content- ready HTTP content (might be null).
-
parsePacket
public ParsingResult parsePacket(org.glassfish.grizzly.filterchain.FilterChainContext ctx, HttpHeader httpPacket, org.glassfish.grizzly.Buffer buffer)
Parse HTTP packet payload, represented byBufferusing specific transfer encoding.- Specified by:
parsePacketin interfaceTransferEncoding- Parameters:
ctx-FilterChainContexthttpPacket-HttpHeaderwith parsed headers.buffer-BufferHTTP message payload.- Returns:
ParsingResult
-
serializePacket
public org.glassfish.grizzly.Buffer serializePacket(org.glassfish.grizzly.filterchain.FilterChainContext ctx, HttpContent httpContent)Serialize HTTP packet payload, represented byHttpContentusing specific transfer encoding.- Specified by:
serializePacketin interfaceTransferEncoding- Parameters:
ctx-FilterChainContexthttpContent-HttpContentwith parsedHttpContent.getHttpHeader().- Returns:
- serialized
Buffer
-
-