public class HttpReceiver extends Object implements HttpParser.ResponseHandler<ByteBuffer>
Constructor and Description |
---|
HttpReceiver(HttpConnection connection) |
Modifier and Type | Method and Description |
---|---|
boolean |
abort(Throwable cause) |
void |
badMessage(int status,
String reason)
Called to signal that a bad HTTP message has been received.
|
boolean |
content(ByteBuffer buffer) |
void |
earlyEOF()
Called to signal that an EOF was received unexpectedly
during the parsing of a HTTP message
|
protected boolean |
fail(Throwable failure) |
int |
getHeaderCacheSize() |
boolean |
headerComplete() |
void |
idleTimeout() |
boolean |
messageComplete() |
boolean |
parsedHeader(HttpField field)
This is the method called by parser when a HTTP Header name and value is found
|
void |
receive() |
boolean |
startResponse(HttpVersion version,
int status,
String reason)
This is the method called by parser when the HTTP request line is parsed
|
protected boolean |
success() |
String |
toString() |
public HttpReceiver(HttpConnection connection)
public void receive()
public int getHeaderCacheSize()
getHeaderCacheSize
in interface HttpParser.HttpHandler<ByteBuffer>
public boolean startResponse(HttpVersion version, int status, String reason)
HttpParser.ResponseHandler
startResponse
in interface HttpParser.ResponseHandler<ByteBuffer>
public boolean parsedHeader(HttpField field)
HttpParser.HttpHandler
parsedHeader
in interface HttpParser.HttpHandler<ByteBuffer>
field
- The field parsedpublic boolean headerComplete()
headerComplete
in interface HttpParser.HttpHandler<ByteBuffer>
public boolean content(ByteBuffer buffer)
content
in interface HttpParser.HttpHandler<ByteBuffer>
public boolean messageComplete()
messageComplete
in interface HttpParser.HttpHandler<ByteBuffer>
protected boolean success()
protected boolean fail(Throwable failure)
public void earlyEOF()
HttpParser.HttpHandler
earlyEOF
in interface HttpParser.HttpHandler<ByteBuffer>
public void badMessage(int status, String reason)
HttpParser.HttpHandler
badMessage
in interface HttpParser.HttpHandler<ByteBuffer>
status
- The bad status to sendreason
- The textual reason for badnesspublic void idleTimeout()
public boolean abort(Throwable cause)
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.