@NotThreadSafe public class DefaultManagedHttpClientConnection extends DefaultBHttpClientConnection implements ManagedHttpClientConnection, HttpContext
ManagedHttpClientConnection implementation.RESERVED_PREFIX| Constructor and Description |
|---|
DefaultManagedHttpClientConnection(java.lang.String id,
int buffersize) |
DefaultManagedHttpClientConnection(java.lang.String id,
int buffersize,
int fragmentSizeHint,
java.nio.charset.CharsetDecoder chardecoder,
java.nio.charset.CharsetEncoder charencoder,
MessageConstraints constraints,
ContentLengthStrategy incomingContentStrategy,
ContentLengthStrategy outgoingContentStrategy,
HttpMessageWriterFactory<HttpRequest> requestWriterFactory,
HttpMessageParserFactory<HttpResponse> responseParserFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(java.net.Socket socket)
Binds this connection to the given
Socket. |
java.lang.Object |
getAttribute(java.lang.String id)
Obtains attribute with the given name.
|
java.lang.String |
getId()
Returns connection ID which is expected to be unique
for the life span of the connection manager.
|
java.net.Socket |
getSocket()
Returns the underlying socket.
|
javax.net.ssl.SSLSession |
getSSLSession()
Obtains the SSL session of the underlying connection, if any.
|
java.lang.Object |
removeAttribute(java.lang.String id)
Removes attribute with the given name from the context.
|
void |
setAttribute(java.lang.String id,
java.lang.Object obj)
Sets value of the attribute with the given name.
|
void |
shutdown()
Force-closes this connection.
|
flush, isResponseAvailable, onRequestSubmitted, onResponseReceived, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeaderawaitInput, close, createInputStream, createOutputStream, doFlush, ensureOpen, getLocalAddress, getLocalPort, getMetrics, getRemoteAddress, getRemotePort, getSessionInputBuffer, getSessionOutputBuffer, getSocketInputStream, getSocketOutputStream, getSocketTimeout, incrementRequestCount, incrementResponseCount, isOpen, isStale, prepareInput, prepareOutput, setSocketTimeout, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitflush, isResponseAvailable, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeadergetLocalAddress, getLocalPort, getRemoteAddress, getRemotePortclose, getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeoutpublic DefaultManagedHttpClientConnection(java.lang.String id,
int buffersize,
int fragmentSizeHint,
java.nio.charset.CharsetDecoder chardecoder,
java.nio.charset.CharsetEncoder charencoder,
MessageConstraints constraints,
ContentLengthStrategy incomingContentStrategy,
ContentLengthStrategy outgoingContentStrategy,
HttpMessageWriterFactory<HttpRequest> requestWriterFactory,
HttpMessageParserFactory<HttpResponse> responseParserFactory)
public DefaultManagedHttpClientConnection(java.lang.String id,
int buffersize)
public java.lang.String getId()
ManagedHttpClientConnectiongetId in interface ManagedHttpClientConnectionpublic void shutdown()
throws java.io.IOException
HttpConnectionshutdown in interface HttpConnectionshutdown in class BHttpConnectionBasejava.io.IOExceptionpublic java.lang.Object getAttribute(java.lang.String id)
HttpContextgetAttribute in interface HttpContextid - the attribute name.null if not set.public java.lang.Object removeAttribute(java.lang.String id)
HttpContextremoveAttribute in interface HttpContextid - the attribute name.null if not set.public void setAttribute(java.lang.String id,
java.lang.Object obj)
HttpContextsetAttribute in interface HttpContextid - the attribute name.obj - the attribute value.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 interface ManagedHttpClientConnectionbind in class DefaultBHttpClientConnectionsocket - the socket.java.io.IOException - in case of an I/O error.public java.net.Socket getSocket()
ManagedHttpClientConnectiongetSocket in interface ManagedHttpClientConnectiongetSocket in class BHttpConnectionBasepublic javax.net.ssl.SSLSession getSSLSession()
ManagedHttpClientConnectionSSLSocket, the SSL session of
that socket is obtained. This is a potentially blocking operation.getSSLSession in interface ManagedHttpClientConnectionnull otherwise