|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.impl.nio.codecs.AbstractMessageParser
public abstract class AbstractMessageParser
Abstract NHttpMessageParser
that serves as a base for all message
parser implementations.
Field Summary | |
---|---|
protected LineParser |
lineParser
|
Constructor Summary | |
---|---|
AbstractMessageParser(SessionInputBuffer buffer,
LineParser parser,
HttpParams params)
Creates an instance of this class. |
Method Summary | |
---|---|
protected abstract HttpMessage |
createMessage(CharArrayBuffer buffer)
Creates HttpMessage instance based on the content of the input
buffer containing the first line of the incoming HTTP message. |
int |
fillBuffer(ReadableByteChannel channel)
Fills the internal buffer of the parser with input data from the given ReadableByteChannel . |
HttpMessage |
parse()
Attempts to parse a complete message head from the content of the internal buffer. |
void |
reset()
Resets the parser. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final LineParser lineParser
Constructor Detail |
---|
public AbstractMessageParser(SessionInputBuffer buffer, LineParser parser, HttpParams params)
The following HTTP parameters affect the initialization:
CoreConnectionPNames.MAX_HEADER_COUNT
parameter determines
the maximum HTTP header count allowed. If set to a positive value,
the number of HTTP headers received from the data stream exceeding
this limit will cause an IOException. A negative or zero value will
effectively disable the check. Per default the check is disabled.
CoreConnectionPNames.MAX_LINE_LENGTH
parameter determines
the maximum line length limit. If set to a positive value, any HTTP line
exceeding this limit will cause an IOException. A negative or zero value
will effectively disable the check the check. Per default the check is
disabled.
buffer
- the session input buffer.parser
- the line parser.params
- HTTP parameters.Method Detail |
---|
public void reset()
NHttpMessageParser
reset
in interface NHttpMessageParser
public int fillBuffer(ReadableByteChannel channel) throws IOException
NHttpMessageParser
ReadableByteChannel
.
fillBuffer
in interface NHttpMessageParser
channel
- the input channel
IOException
- in case of an I/O error.protected abstract HttpMessage createMessage(CharArrayBuffer buffer) throws HttpException, ParseException
HttpMessage
instance based on the content of the input
buffer containing the first line of the incoming HTTP message.
buffer
- the line buffer.
HttpException
- in case of HTTP protocol violation
ParseException
- in case of a parse error.public HttpMessage parse() throws IOException, HttpException
NHttpMessageParser
null
.
parse
in interface NHttpMessageParser
null
otherwise.
IOException
- in case of an I/O error.
HttpException
- in case the HTTP message is malformed or
violates the HTTP protocol.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |