|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.impl.io.AbstractMessageParser
public abstract class AbstractMessageParser
Abstract base class for HTTP message parsers that obtain input from
an instance of SessionInputBuffer
.
Field Summary | |
---|---|
protected LineParser |
lineParser
|
Constructor Summary | |
---|---|
AbstractMessageParser(SessionInputBuffer buffer,
LineParser parser,
HttpParams params)
Creates an instance of this class. |
Method Summary | |
---|---|
HttpMessage |
parse()
Generates an instance of HttpMessage from the underlying data
source. |
protected abstract HttpMessage |
parseHead(SessionInputBuffer sessionBuffer)
Subclasses must override this method to generate an instance of HttpMessage based on the initial input from the session buffer. |
static Header[] |
parseHeaders(SessionInputBuffer inbuffer,
int maxHeaderCount,
int maxLineLen,
LineParser parser)
Parses HTTP headers from the data receiver stream according to the generic format as given in Section 3.1 of RFC 822, RFC-2616 Section 4 and 19.3. |
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 static Header[] parseHeaders(SessionInputBuffer inbuffer, int maxHeaderCount, int maxLineLen, LineParser parser) throws HttpException, IOException
inbuffer
- Session input buffermaxHeaderCount
- maximum number of headers allowed. If the number
of headers received from the data stream exceeds maxCount value, an
IOException will be thrown. Setting this parameter to a negative value
or zero will disable the check.maxLineLen
- maximum number of characters for a header line,
including the continuation lines. Setting this parameter to a negative
value or zero will disable the check.
IOException
- in case of an I/O error
HttpException
- in case of HTTP protocol violationprotected abstract HttpMessage parseHead(SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException
HttpMessage
based on the initial input from the session buffer.
Usually this method is expected to read just the very first line or
the very first valid from the data stream and based on the input generate
an appropriate instance of HttpMessage
.
sessionBuffer
- the session input buffer.
IOException
- in case of an I/O error.
HttpException
- in case of HTTP protocol violation.
ParseException
- in case of a parse error.public HttpMessage parse() throws IOException, HttpException
HttpMessageParser
HttpMessage
from the underlying data
source.
parse
in interface HttpMessageParser
IOException
- in case of an I/O error
HttpException
- in case of HTTP protocol violation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |