public class HTTPRequestProcessor
extends java.lang.Object
HTTPRequestProcessor.HTTPRequestCallback
interface.
These callbacks happen on the same thread that called to process the data.Modifier and Type | Class | Description |
---|---|---|
static interface |
HTTPRequestProcessor.HTTPRequestCallback |
Used for processing data with
HTTPRequestProcessor . |
Modifier and Type | Field | Description |
---|---|---|
static int |
MAX_HEADER_LENGTH |
|
static int |
MAX_HEADER_ROW_LENGTH |
Constructor | Description |
---|---|
HTTPRequestProcessor() |
Constructs an httpRequestProcessor.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addHTTPRequestCallback(HTTPRequestProcessor.HTTPRequestCallback hrc) |
Adds an
HTTPRequestProcessor.HTTPRequestCallback to the processor. |
void |
clearBuffer() |
Resets the processor and any pending buffers left in it.
|
void |
connectionClosed() |
Called when an http request connection is closes.
|
int |
getBufferSize() |
returns the total amount of unprocessable data pending.
|
boolean |
isRequestComplete() |
Lets you know if we have gotten enough data to see a full request yet.
|
void |
processData(byte[] ba) |
byte[] to send through the processor.
|
void |
processData(java.nio.ByteBuffer bb) |
ByteBuffer to send through the processor. |
void |
processData(org.threadly.litesockets.buffers.MergedByteBuffers bb) |
MergedByteBuffers to send through the processor. |
void |
removeHTTPRequestCallback(HTTPRequestProcessor.HTTPRequestCallback hrc) |
Removes an
HTTPRequestProcessor.HTTPRequestCallback from the processor. |
void |
reset() |
Forces a reset on the HTTPProcessor.
|
void |
reset(java.lang.Throwable t) |
Forces a reset on the HTTPProcessor with an error, call callbacks will be called with hasError if a request has started.
|
public static final int MAX_HEADER_LENGTH
public static final int MAX_HEADER_ROW_LENGTH
public HTTPRequestProcessor()
public void addHTTPRequestCallback(HTTPRequestProcessor.HTTPRequestCallback hrc)
HTTPRequestProcessor.HTTPRequestCallback
to the processor. More the one can be added.hrc
- the HTTPRequestProcessor.HTTPRequestCallback
to add.public void removeHTTPRequestCallback(HTTPRequestProcessor.HTTPRequestCallback hrc)
HTTPRequestProcessor.HTTPRequestCallback
from the processor.hrc
- the HTTPRequestProcessor.HTTPRequestCallback
to remove.public void processData(byte[] ba)
ba
- to send through the processor.public void processData(java.nio.ByteBuffer bb)
ByteBuffer
to send through the processor.bb
- ByteBuffer
to send through the processor.public void processData(org.threadly.litesockets.buffers.MergedByteBuffers bb)
MergedByteBuffers
to send through the processor.bb
- MergedByteBuffers
to send through the processor.public void connectionClosed()
public void clearBuffer()
public void reset()
clearBuffer()
public void reset(java.lang.Throwable t)
t
- exception to pass to the callbacks.
NOTE: any currently unprocessed buffer will remain! see clearBuffer()
public boolean isRequestComplete()
public int getBufferSize()