public class HttpServerDecoder extends java.lang.Object implements ProtocolDecoder
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
BODY_REMAINING_BYTES
Key for the number of bytes remaining to read for completing the body
|
static java.util.regex.Pattern |
COOKIE_SEPARATOR_PATTERN
Regex to split cookie header following RFC6265 Section 5.4
|
private static java.lang.String |
DECODER_STATE_ATT
Key for decoder current state
|
static java.util.regex.Pattern |
HEADER_VALUE_PATTERN
Regex to parse header name and value
|
static java.util.regex.Pattern |
HEADERS_BODY_PATTERN
Regex to parse raw headers from body
|
static java.util.regex.Pattern |
KEY_VALUE_PATTERN
Regex to parse out key/value pairs
|
private static org.slf4j.Logger |
LOG |
static java.util.regex.Pattern |
PARAM_STRING_PATTERN
Regex to parse out parameters from query string
|
private static java.lang.String |
PARTIAL_HEAD_ATT
Key for the partial HTTP requests head
|
static java.util.regex.Pattern |
QUERY_STRING_PATTERN
Regex to parse out QueryString from HttpRequest
|
static java.util.regex.Pattern |
RAW_VALUE_PATTERN
Regex to parse raw headers and body
|
static java.util.regex.Pattern |
REQUEST_LINE_PATTERN
Regex to parse HttpRequest Request Line
|
| Constructor and Description |
|---|
HttpServerDecoder() |
| Modifier and Type | Method and Description |
|---|---|
void |
decode(IoSession session,
IoBuffer msg,
ProtocolDecoderOutput out)
Decodes binary or protocol-specific content into higher-level message objects.
|
void |
dispose(IoSession session)
Releases all resources related with this decoder.
|
void |
finishDecode(IoSession session,
ProtocolDecoderOutput out)
Invoked when the specified session is closed.
|
private HttpRequestImpl |
parseHttpRequestHead(java.nio.ByteBuffer buffer) |
private static final org.slf4j.Logger LOG
private static final java.lang.String DECODER_STATE_ATT
private static final java.lang.String PARTIAL_HEAD_ATT
private static final java.lang.String BODY_REMAINING_BYTES
public static final java.util.regex.Pattern REQUEST_LINE_PATTERN
public static final java.util.regex.Pattern QUERY_STRING_PATTERN
public static final java.util.regex.Pattern PARAM_STRING_PATTERN
public static final java.util.regex.Pattern KEY_VALUE_PATTERN
public static final java.util.regex.Pattern RAW_VALUE_PATTERN
public static final java.util.regex.Pattern HEADERS_BODY_PATTERN
public static final java.util.regex.Pattern HEADER_VALUE_PATTERN
public static final java.util.regex.Pattern COOKIE_SEPARATOR_PATTERN
public void decode(IoSession session, IoBuffer msg, ProtocolDecoderOutput out)
ProtocolDecoderProtocolDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)
method with read data, and then the decoder implementation puts decoded
messages into ProtocolDecoderOutput.decode in interface ProtocolDecoderpublic void finishDecode(IoSession session, ProtocolDecoderOutput out) throws java.lang.Exception
ProtocolDecoderProtocolDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)
method didn't process completely.finishDecode in interface ProtocolDecoderjava.lang.Exception - if the read data violated protocol specificationpublic void dispose(IoSession session) throws java.lang.Exception
ProtocolDecoderdispose in interface ProtocolDecoderjava.lang.Exception - if failed to dispose all resourcesprivate HttpRequestImpl parseHttpRequestHead(java.nio.ByteBuffer buffer)