@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, sendRequestHeader
awaitInput, close, createInputStream, createOutputStream, doFlush, ensureOpen, getLocalAddress, getLocalPort, getMetrics, getRemoteAddress, getRemotePort, getSessionInputBuffer, getSessionOutputBuffer, getSocketInputStream, getSocketOutputStream, getSocketTimeout, incrementRequestCount, incrementResponseCount, isOpen, isStale, prepareInput, prepareOutput, setSocketTimeout, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
flush, isResponseAvailable, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeader
getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort
close, getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeout
public 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()
ManagedHttpClientConnection
getId
in interface ManagedHttpClientConnection
public void shutdown() throws java.io.IOException
HttpConnection
shutdown
in interface HttpConnection
shutdown
in class BHttpConnectionBase
java.io.IOException
public java.lang.Object getAttribute(java.lang.String id)
HttpContext
getAttribute
in interface HttpContext
id
- the attribute name.null
if not set.public java.lang.Object removeAttribute(java.lang.String id)
HttpContext
removeAttribute
in interface HttpContext
id
- the attribute name.null
if not set.public void setAttribute(java.lang.String id, java.lang.Object obj)
HttpContext
setAttribute
in interface HttpContext
id
- the attribute name.obj
- the attribute value.public void bind(java.net.Socket socket) throws java.io.IOException
BHttpConnectionBase
Socket
. 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 ManagedHttpClientConnection
bind
in class DefaultBHttpClientConnection
socket
- the socket.java.io.IOException
- in case of an I/O error.public java.net.Socket getSocket()
ManagedHttpClientConnection
getSocket
in interface ManagedHttpClientConnection
getSocket
in class BHttpConnectionBase
public javax.net.ssl.SSLSession getSSLSession()
ManagedHttpClientConnection
SSLSocket
, the SSL session of
that socket is obtained. This is a potentially blocking operation.getSSLSession
in interface ManagedHttpClientConnection
null
otherwise