Top Description Methods
org.glassfish.grizzly.http

public Interface ContentEncoding

Known Direct Implementers
org.glassfish.grizzly.http.GZipContentEncoding, org.glassfish.grizzly.http.LZMAContentEncoding
Imports
org.glassfish.grizzly.Connection

Abstraction, which represents HTTP content-encoding. Implementation should take care of HTTP content encoding and decoding.
Author
Alexey Stashok
See Also
GZipContentEncoding

Method Summary

Modifier and TypeMethod and Description
public ParsingResult

Returns:

ParsingResult, which represents the result of decoding.
decode
(Connection<L> connection, HttpContent
HttpContent to decode.
httpContent
)

Decode HTTP packet content represented by HttpContent.

public HttpContent

Returns:

encoded HttpContent.
encode
(Connection<L> connection, HttpContent
HttpContent to encode.
httpContent
)

Encode HTTP packet content represented by HttpContent.

public String[]

Returns:

the ContentEncoding aliases.
getAliases
()

Get the ContentEncoding aliases.

public String

Returns:

the ContentEncoding name.
getName
()

Get the ContentEncoding name.

public boolean

Returns:

true, if this ContentEncoding should be used to decode the HTTP packet, or false otherwise.
wantDecode
(HttpHeader
HTTP packet header.
header
)

Method should implement the logic, which decides if HTTP packet with the specific HttpHeader should be decoded using this ContentEncoding.

public boolean

Returns:

true, if this ContentEncoding should be used to encode the HTTP packet, or false otherwise.
wantEncode
(HttpHeader
HTTP packet header.
header
)

Method should implement the logic, which decides if HTTP packet with the specific HttpHeader should be encoded using this ContentEncoding.

Method Detail

decodeback to summary
public ParsingResult decode(Connection<L> connection, HttpContent httpContent)

Decode HTTP packet content represented by HttpContent.

Parameters
connection:Connection<L>

Connection.

httpContent:HttpContent

HttpContent to decode.

Returns:ParsingResult

ParsingResult, which represents the result of decoding.

encodeback to summary
public HttpContent encode(Connection<L> connection, HttpContent httpContent)

Encode HTTP packet content represented by HttpContent.

Parameters
connection:Connection<L>

Connection.

httpContent:HttpContent

HttpContent to encode.

Returns:HttpContent

encoded HttpContent.

getAliasesback to summary
public String[] getAliases()

Get the ContentEncoding aliases.

Returns:String[]

the ContentEncoding aliases.

getNameback to summary
public String getName()

Get the ContentEncoding name.

Returns:String

the ContentEncoding name.

wantDecodeback to summary
public boolean wantDecode(HttpHeader header)

Method should implement the logic, which decides if HTTP packet with the specific HttpHeader should be decoded using this ContentEncoding.

Parameters
header:HttpHeader

HTTP packet header.

Returns:boolean

true, if this ContentEncoding should be used to decode the HTTP packet, or false otherwise.

wantEncodeback to summary
public boolean wantEncode(HttpHeader header)

Method should implement the logic, which decides if HTTP packet with the specific HttpHeader should be encoded using this ContentEncoding.

Parameters
header:HttpHeader

HTTP packet header.

Returns:boolean

true, if this ContentEncoding should be used to encode the HTTP packet, or false otherwise.