Top Description Methods
org.glassfish.grizzly.http

public Interface TransferEncoding

Known Direct Implementers
org.glassfish.grizzly.http.ChunkedTransferEncoding, org.glassfish.grizzly.http.FixedLengthTransferEncoding
Imports
org.glassfish.grizzly.Buffer, org.glassfish.grizzly.filterchain.FilterChainContext

Abstraction, which represents HTTP transfer-encoding. The implementation should take care about possible HTTP content fragmentation.
Author
Alexey Stashok
See Also
FixedLengthTransferEncoding, ChunkedTransferEncoding

Method Summary

Modifier and TypeMethod and Description
public ParsingResult

Returns:

ParsingResult
parsePacket
(FilterChainContext ctx, HttpHeader
HttpHeader with parsed headers.
httpPacket
,
Buffer
Buffer HTTP message payload.
buffer
)

Parse HTTP packet payload, represented by Buffer using specific transfer encoding.

public void
prepareSerialize(FilterChainContext ctx, HttpHeader
HTTP packet headers.
httpHeader
,
HttpContent
ready HTTP content (might be null).
content
)

This method will be called by HttpCodecFilter to let TransferEncoding prepare itself for the content serialization.

public Buffer

Returns:

serialized Buffer
serializePacket
(FilterChainContext ctx, HttpContent httpContent)

Serialize HTTP packet payload, represented by HttpContent using specific transfer encoding.

public boolean

Returns:

true if this encoding should be used to parse the content of the passed HttpHeader, or false otherwise.
wantDecode
(HttpHeader httpPacket)

Return true if this encoding should be used to parse the content of the passed HttpHeader, or false otherwise.

public boolean

Returns:

true if this encoding should be used to serialize the content of the passed HttpHeader, or false otherwise.
wantEncode
(HttpHeader httpPacket)

Return true if this encoding should be used to serialize the content of the passed HttpHeader, or false otherwise.

Method Detail

parsePacketback to summary
public ParsingResult parsePacket(FilterChainContext ctx, HttpHeader httpPacket, Buffer buffer)

Parse HTTP packet payload, represented by Buffer using specific transfer encoding.

Parameters
ctx:FilterChainContext

FilterChainContext

httpPacket:HttpHeader

HttpHeader with parsed headers.

buffer:Buffer

Buffer HTTP message payload.

Returns:ParsingResult

ParsingResult

prepareSerializeback to summary
public void prepareSerialize(FilterChainContext ctx, HttpHeader httpHeader, HttpContent content)

This method will be called by HttpCodecFilter to let TransferEncoding prepare itself for the content serialization. At this time TransferEncoding is able to change, update HTTP packet headers.

Parameters
ctx:FilterChainContext

FilterChainContext

httpHeader:HttpHeader

HTTP packet headers.

content:HttpContent

ready HTTP content (might be null).

serializePacketback to summary
public Buffer serializePacket(FilterChainContext ctx, HttpContent httpContent)

Serialize HTTP packet payload, represented by HttpContent using specific transfer encoding.

Parameters
ctx:FilterChainContext

FilterChainContext

httpContent:HttpContent

HttpContent with parsed HttpContent#getHttpHeader().

Returns:Buffer

serialized Buffer

wantDecodeback to summary
public boolean wantDecode(HttpHeader httpPacket)

Return true if this encoding should be used to parse the content of the passed HttpHeader, or false otherwise.

Parameters
httpPacket:HttpHeader

HttpHeader.

Returns:boolean

true if this encoding should be used to parse the content of the passed HttpHeader, or false otherwise.

wantEncodeback to summary
public boolean wantEncode(HttpHeader httpPacket)

Return true if this encoding should be used to serialize the content of the passed HttpHeader, or false otherwise.

Parameters
httpPacket:HttpHeader

HttpHeader.

Returns:boolean

true if this encoding should be used to serialize the content of the passed HttpHeader, or false otherwise.