Package org.glassfish.grizzly.http
Interface TransferEncoding
- All Known Implementing Classes:
ChunkedTransferEncoding,FixedLengthTransferEncoding
public interface TransferEncoding
Abstraction, which represents HTTP transfer-encoding. The implementation should take care about possible HTTP content
fragmentation.
- Author:
- Alexey Stashok
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionparsePacket(FilterChainContext ctx, HttpHeader httpPacket, Buffer buffer) Parse HTTP packet payload, represented byBufferusing specific transfer encoding.voidprepareSerialize(FilterChainContext ctx, HttpHeader httpHeader, HttpContent content) This method will be called byHttpCodecFilterto let TransferEncoding prepare itself for the content serialization.serializePacket(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 Details
-
wantDecode
Return true if this encoding should be used to parse the content of the passedHttpHeader, or false otherwise.- 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.- Parameters:
httpPacket-HttpHeader.- Returns:
- true if this encoding should be used to serialize the content of the passed
HttpHeader, or false otherwise.
-
prepareSerialize
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.- Parameters:
ctx-FilterChainContexthttpHeader- HTTP packet headers.content- ready HTTP content (might be null).
-
parsePacket
Parse HTTP packet payload, represented byBufferusing specific transfer encoding.- Parameters:
ctx-FilterChainContexthttpPacket-HttpHeaderwith parsed headers.buffer-BufferHTTP message payload.- Returns:
ParsingResult
-
serializePacket
Serialize HTTP packet payload, represented byHttpContentusing specific transfer encoding.- Parameters:
ctx-FilterChainContexthttpContent-HttpContentwith parsedHttpContent.getHttpHeader().- Returns:
- serialized
Buffer
-