T
- The type of HttpMessage
.public abstract class AbstractMessageParser<T extends HttpMessage> extends Object implements NHttpMessageParser<T>
NHttpMessageParser
that serves as a base for all message
parser implementations.Constructor and Description |
---|
AbstractMessageParser(Http1Config http1Config,
LineParser lineParser) |
AbstractMessageParser(LineParser lineParser,
Http1Config messageConstraints)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected abstract T |
createMessage(CharArrayBuffer buffer)
Creates
HttpMessage instance based on the content of the input
buffer containing the first line of the incoming HTTP message. |
T |
parse(SessionInputBuffer sessionBuffer,
boolean endOfStream)
Attempts to parse a complete message head from the content of the
internal buffer.
|
void |
reset()
Resets the parser.
|
public AbstractMessageParser(Http1Config http1Config, LineParser lineParser)
@Deprecated public AbstractMessageParser(LineParser lineParser, Http1Config messageConstraints)
AbstractMessageParser(Http1Config, LineParser)
public void reset()
NHttpMessageParser
reset
in interface NHttpMessageParser<T extends HttpMessage>
protected abstract T createMessage(CharArrayBuffer buffer) throws HttpException
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 violationpublic T parse(SessionInputBuffer sessionBuffer, boolean endOfStream) throws IOException, HttpException
NHttpMessageParser
null
.parse
in interface NHttpMessageParser<T extends HttpMessage>
sessionBuffer
- session input buffer.endOfStream
- end of stream flagnull
otherwise.IOException
- in case of an I/O error.HttpException
- in case the HTTP message is malformed or
violates the HTTP protocol.Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.