@NotThreadSafe public class DefaultBHttpClientConnection extends BHttpConnectionBase implements org.apache.http.HttpClientConnection
HttpClientConnection.| Constructor and Description |
|---|
DefaultBHttpClientConnection(int buffersize) |
DefaultBHttpClientConnection(int buffersize,
java.nio.charset.CharsetDecoder chardecoder,
java.nio.charset.CharsetEncoder charencoder,
MessageConstraints constraints) |
DefaultBHttpClientConnection(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,
HttpMessageWriterFactory<org.apache.http.HttpRequest> requestWriterFactory,
HttpMessageParserFactory<org.apache.http.HttpResponse> responseParserFactory)
Creates new instance of DefaultBHttpClientConnection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bind(java.net.Socket socket)
Binds this connection to the given
Socket. |
void |
flush() |
boolean |
isResponseAvailable(int timeout) |
protected void |
onRequestSubmitted(org.apache.http.HttpRequest request) |
protected void |
onResponseReceived(org.apache.http.HttpResponse response) |
void |
receiveResponseEntity(org.apache.http.HttpResponse response) |
org.apache.http.HttpResponse |
receiveResponseHeader() |
void |
sendRequestEntity(org.apache.http.HttpEntityEnclosingRequest request) |
void |
sendRequestHeader(org.apache.http.HttpRequest request) |
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 DefaultBHttpClientConnection(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,
HttpMessageWriterFactory<org.apache.http.HttpRequest> requestWriterFactory,
HttpMessageParserFactory<org.apache.http.HttpResponse> responseParserFactory)
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
LaxContentLengthStrategyHC4.INSTANCE will be used.outgoingContentStrategy - outgoing content length strategy. If null
StrictContentLengthStrategyHC4.INSTANCE will be used.requestWriterFactory - request writer factory. If null
DefaultHttpRequestWriterFactory.INSTANCE will be used.responseParserFactory - response parser factory. If null
DefaultHttpResponseParserFactory.INSTANCE will be used.public DefaultBHttpClientConnection(int buffersize,
java.nio.charset.CharsetDecoder chardecoder,
java.nio.charset.CharsetEncoder charencoder,
MessageConstraints constraints)
public DefaultBHttpClientConnection(int buffersize)
protected void onResponseReceived(org.apache.http.HttpResponse response)
protected void onRequestSubmitted(org.apache.http.HttpRequest request)
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 boolean isResponseAvailable(int timeout)
throws java.io.IOException
isResponseAvailable in interface org.apache.http.HttpClientConnectionjava.io.IOExceptionpublic void sendRequestHeader(org.apache.http.HttpRequest request)
throws org.apache.http.HttpException,
java.io.IOException
sendRequestHeader in interface org.apache.http.HttpClientConnectionorg.apache.http.HttpExceptionjava.io.IOExceptionpublic void sendRequestEntity(org.apache.http.HttpEntityEnclosingRequest request)
throws org.apache.http.HttpException,
java.io.IOException
sendRequestEntity in interface org.apache.http.HttpClientConnectionorg.apache.http.HttpExceptionjava.io.IOExceptionpublic org.apache.http.HttpResponse receiveResponseHeader()
throws org.apache.http.HttpException,
java.io.IOException
receiveResponseHeader in interface org.apache.http.HttpClientConnectionorg.apache.http.HttpExceptionjava.io.IOExceptionpublic void receiveResponseEntity(org.apache.http.HttpResponse response)
throws org.apache.http.HttpException,
java.io.IOException
receiveResponseEntity in interface org.apache.http.HttpClientConnectionorg.apache.http.HttpExceptionjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface org.apache.http.HttpClientConnectionjava.io.IOExceptionCopyright © 1999-2015 The Apache Software Foundation. All rights reserved.