public class HttpClientDecoder extends Object implements ProtocolDecoder
Modifier and Type | Field and Description |
---|---|
static Pattern |
COOKIE_SEPARATOR_PATTERN
Regex to split cookie header following RFC6265 Section 5.4
|
static Pattern |
HEADER_VALUE_PATTERN
Regex to parse header name and value
|
static Pattern |
HEADERS_BODY_PATTERN
Regex to parse raw headers from body
|
static Pattern |
KEY_VALUE_PATTERN
Regex to parse out key/value pairs
|
static Pattern |
PARAM_STRING_PATTERN
Regex to parse out parameters from query string
|
static Pattern |
QUERY_STRING_PATTERN
Regex to parse out QueryString from HttpRequest
|
static Pattern |
RAW_VALUE_PATTERN
Regex to parse raw headers and body
|
static Pattern |
REQUEST_LINE_PATTERN
Regex to parse HttpRequest Request Line
|
static Pattern |
RESPONSE_LINE_PATTERN
Regex to parse HttpRequest Request Line
|
Constructor and Description |
---|
HttpClientDecoder() |
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.
|
public static final Pattern REQUEST_LINE_PATTERN
public static final Pattern RESPONSE_LINE_PATTERN
public static final Pattern QUERY_STRING_PATTERN
public static final Pattern PARAM_STRING_PATTERN
public static final Pattern KEY_VALUE_PATTERN
public static final Pattern RAW_VALUE_PATTERN
public static final Pattern HEADERS_BODY_PATTERN
public static final Pattern HEADER_VALUE_PATTERN
public static final Pattern COOKIE_SEPARATOR_PATTERN
public void decode(IoSession session, IoBuffer msg, ProtocolDecoderOutput out)
ProtocolDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)
method with read data, and then the decoder implementation puts decoded
messages into ProtocolDecoderOutput
.decode
in interface ProtocolDecoder
session
- The current Sessionmsg
- the buffer to decodeout
- The ProtocolDecoderOutput
that will receive the decoded messagepublic void finishDecode(IoSession session, ProtocolDecoderOutput out) throws Exception
ProtocolDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)
method didn't process completely.finishDecode
in interface ProtocolDecoder
session
- The current Sessionout
- The ProtocolDecoderOutput
that contains the decoded messageException
- if the read data violated protocol specificationpublic void dispose(IoSession session) throws Exception
dispose
in interface ProtocolDecoder
session
- The current SessionException
- if failed to dispose all resourcesCopyright © 2004–2021 Apache MINA Project. All rights reserved.