@NotThreadSafe public class DefaultBHttpServerConnection extends BHttpConnectionBase implements org.apache.http.HttpServerConnection
HttpServerConnection.| Constructor and Description |
|---|
DefaultBHttpServerConnection(int buffersize) |
DefaultBHttpServerConnection(int buffersize,
java.nio.charset.CharsetDecoder chardecoder,
java.nio.charset.CharsetEncoder charencoder,
MessageConstraints constraints) |
DefaultBHttpServerConnection(int buffersize,
int fragmentSizeHint,
java.nio.charset.CharsetDecoder chardecoder,
java.nio.charset.CharsetEncoder charencoder,
MessageConstraints constraints,
org.apache.http.entity.ContentLengthStrategy incomingContentStrategy,
org.apache.http.entity.ContentLengthStrategy outgoingContentStrategy,
HttpMessageParserFactory<org.apache.http.HttpRequest> requestParserFactory,
HttpMessageWriterFactory<org.apache.http.HttpResponse> responseWriterFactory)
Creates new instance of DefaultBHttpServerConnection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bind(java.net.Socket socket)
Binds this connection to the given
Socket. |
void |
flush() |
protected void |
onRequestReceived(org.apache.http.HttpRequest request) |
protected void |
onResponseSubmitted(org.apache.http.HttpResponse response) |
void |
receiveRequestEntity(org.apache.http.HttpEntityEnclosingRequest request) |
org.apache.http.HttpRequest |
receiveRequestHeader() |
void |
sendResponseEntity(org.apache.http.HttpResponse response) |
void |
sendResponseHeader(org.apache.http.HttpResponse response) |
awaitInput, close, createInputStream, createOutputStream, doFlush, ensureOpen, getLocalAddress, getLocalPort, getMetrics, getRemoteAddress, getRemotePort, getSessionInputBuffer, getSessionOutputBuffer, getSocket, getSocketInputStream, getSocketOutputStream, getSocketTimeout, incrementRequestCount, incrementResponseCount, isOpen, isStale, prepareInput, prepareOutput, setSocketTimeout, shutdown, toStringpublic DefaultBHttpServerConnection(int buffersize,
int fragmentSizeHint,
java.nio.charset.CharsetDecoder chardecoder,
java.nio.charset.CharsetEncoder charencoder,
MessageConstraints constraints,
org.apache.http.entity.ContentLengthStrategy incomingContentStrategy,
org.apache.http.entity.ContentLengthStrategy outgoingContentStrategy,
HttpMessageParserFactory<org.apache.http.HttpRequest> requestParserFactory,
HttpMessageWriterFactory<org.apache.http.HttpResponse> responseWriterFactory)
buffersize - buffer size. Must be a positive number.fragmentSizeHint - fragment size hint.chardecoder - decoder to be used for decoding HTTP protocol elements.
If null simple type cast will be used for byte to char conversion.charencoder - encoder to be used for encoding HTTP protocol elements.
If null simple type cast will be used for char to byte conversion.constraints - Message constraints. If null
MessageConstraints.DEFAULT will be used.incomingContentStrategy - incoming content length strategy. If null
DisallowIdentityContentLengthStrategy.INSTANCE will be used.outgoingContentStrategy - outgoing content length strategy. If null
StrictContentLengthStrategyHC4.INSTANCE will be used.requestParserFactory - request parser factory. If null
DefaultHttpRequestParserFactory.INSTANCE will be used.responseWriterFactory - response writer factory. If null
DefaultHttpResponseWriterFactory.INSTANCE will be used.public DefaultBHttpServerConnection(int buffersize,
java.nio.charset.CharsetDecoder chardecoder,
java.nio.charset.CharsetEncoder charencoder,
MessageConstraints constraints)
public DefaultBHttpServerConnection(int buffersize)
protected void onRequestReceived(org.apache.http.HttpRequest request)
protected void onResponseSubmitted(org.apache.http.HttpResponse response)
public void bind(java.net.Socket socket)
throws java.io.IOException
BHttpConnectionBaseSocket. This socket will be
used by the connection to send and receive data.
After this method's execution the connection status will be reported
as open and the BHttpConnectionBase.isOpen() will return true.bind in class BHttpConnectionBasesocket - the socket.java.io.IOException - in case of an I/O error.public org.apache.http.HttpRequest receiveRequestHeader()
throws org.apache.http.HttpException,
java.io.IOException
receiveRequestHeader in interface org.apache.http.HttpServerConnectionorg.apache.http.HttpExceptionjava.io.IOExceptionpublic void receiveRequestEntity(org.apache.http.HttpEntityEnclosingRequest request)
throws org.apache.http.HttpException,
java.io.IOException
receiveRequestEntity in interface org.apache.http.HttpServerConnectionorg.apache.http.HttpExceptionjava.io.IOExceptionpublic void sendResponseHeader(org.apache.http.HttpResponse response)
throws org.apache.http.HttpException,
java.io.IOException
sendResponseHeader in interface org.apache.http.HttpServerConnectionorg.apache.http.HttpExceptionjava.io.IOExceptionpublic void sendResponseEntity(org.apache.http.HttpResponse response)
throws org.apache.http.HttpException,
java.io.IOException
sendResponseEntity in interface org.apache.http.HttpServerConnectionorg.apache.http.HttpExceptionjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface org.apache.http.HttpServerConnectionjava.io.IOExceptionCopyright © 1999-2015 The Apache Software Foundation. All rights reserved.