public class HttpParser extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
HttpParser.HttpHandler<T> |
static interface |
HttpParser.RequestHandler<T> |
static interface |
HttpParser.ResponseHandler<T> |
static class |
HttpParser.State |
Constructor and Description |
---|
HttpParser(HttpParser.RequestHandler<ByteBuffer> handler) |
HttpParser(HttpParser.RequestHandler<ByteBuffer> handler,
int maxHeaderBytes) |
HttpParser(HttpParser.ResponseHandler<ByteBuffer> handler) |
HttpParser(HttpParser.ResponseHandler<ByteBuffer> handler,
int maxHeaderBytes) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
long |
getContentLength() |
long |
getContentRead() |
HttpParser.State |
getState() |
boolean |
inContentState() |
boolean |
inHeaderState() |
boolean |
isChunking() |
boolean |
isClosed() |
boolean |
isComplete() |
boolean |
isIdle() |
boolean |
isInContent() |
boolean |
isStart() |
boolean |
isState(HttpParser.State state) |
boolean |
parseNext(ByteBuffer buffer)
Parse until next Event.
|
void |
reset() |
void |
setHeadResponse(boolean head)
Set if a HEAD response is expected
|
boolean |
shutdownInput()
Notifies this parser that I/O code read a -1 and therefore no more data will arrive to be parsed.
|
String |
toString() |
public static final Logger LOG
public HttpParser(HttpParser.RequestHandler<ByteBuffer> handler)
public HttpParser(HttpParser.ResponseHandler<ByteBuffer> handler)
public HttpParser(HttpParser.RequestHandler<ByteBuffer> handler, int maxHeaderBytes)
public HttpParser(HttpParser.ResponseHandler<ByteBuffer> handler, int maxHeaderBytes)
public long getContentLength()
public long getContentRead()
public void setHeadResponse(boolean head)
head
- public HttpParser.State getState()
public boolean inContentState()
public boolean inHeaderState()
public boolean isInContent()
public boolean isChunking()
public boolean isStart()
public boolean isClosed()
public boolean isIdle()
public boolean isComplete()
public boolean isState(HttpParser.State state)
public boolean parseNext(ByteBuffer buffer)
HttpParser.RequestHandler
method was called and it returned true;public boolean shutdownInput()
HttpParser.HttpHandler.messageComplete(long)
, for
example when the content is delimited by the close of the connection.
If the parser is already in a state that does not need data (for example, it is idle waiting for
a request/response to be parsed), then calling this method is a no-operation.HttpParser.HttpHandler.messageComplete(long)
if there has been
one, or false otherwise.public void close()
public void reset()
Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.