java.lang.Object
org.glassfish.grizzly.http.ChunkedTransferEncoding
- All Implemented Interfaces:
TransferEncoding
Chunked transfer encoding implementation.
- Author:
- Alexey Stashok
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparsePacket(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.
-
Constructor Details
-
ChunkedTransferEncoding
public ChunkedTransferEncoding(int maxHeadersSize)
-
-
Method Details
-
wantDecode
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
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
-