- All Known Implementing Classes:
GZipContentEncoding
,LZMAContentEncoding
public interface ContentEncoding
Abstraction, which represents HTTP content-encoding. Implementation should take care of HTTP content encoding and
decoding.
- Author:
- Alexey Stashok
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondecode
(org.glassfish.grizzly.Connection connection, HttpContent httpContent) Decode HTTP packet content represented byHttpContent
.encode
(org.glassfish.grizzly.Connection connection, HttpContent httpContent) Encode HTTP packet content represented byHttpContent
.String[]
Get the ContentEncoding aliases.getName()
Get the ContentEncoding name.boolean
wantDecode
(HttpHeader header) Method should implement the logic, which decides if HTTP packet with the specificHttpHeader
should be decoded using this ContentEncoding.boolean
wantEncode
(HttpHeader header) Method should implement the logic, which decides if HTTP packet with the specificHttpHeader
should be encoded using this ContentEncoding.
-
Method Details
-
getName
String getName()Get the ContentEncoding name.- Returns:
- the ContentEncoding name.
-
getAliases
String[] getAliases()Get the ContentEncoding aliases.- Returns:
- the ContentEncoding aliases.
-
wantDecode
Method should implement the logic, which decides if HTTP packet with the specificHttpHeader
should be decoded using this ContentEncoding.- Parameters:
header
- HTTP packet header.- Returns:
- true, if this ContentEncoding should be used to decode the HTTP packet, or false otherwise.
-
wantEncode
Method should implement the logic, which decides if HTTP packet with the specificHttpHeader
should be encoded using this ContentEncoding.- Parameters:
header
- HTTP packet header.- Returns:
- true, if this ContentEncoding should be used to encode the HTTP packet, or false otherwise.
-
decode
Decode HTTP packet content represented byHttpContent
.- Parameters:
connection
-Connection
.httpContent
-HttpContent
to decode.- Returns:
ParsingResult
, which represents the result of decoding.
-
encode
Encode HTTP packet content represented byHttpContent
.- Parameters:
connection
-Connection
.httpContent
-HttpContent
to encode.- Returns:
- encoded
HttpContent
.
-