org.apache.http.impl.conn
Class DefaultManagedHttpClientConnection
java.lang.Object
org.apache.http.impl.BHttpConnectionBase
org.apache.http.impl.DefaultBHttpClientConnection
org.apache.http.impl.conn.DefaultManagedHttpClientConnection
- All Implemented Interfaces:
- ManagedHttpClientConnection, org.apache.http.HttpClientConnection, org.apache.http.HttpConnection, org.apache.http.HttpInetConnection, org.apache.http.protocol.HttpContext
@NotThreadSafe
public class DefaultManagedHttpClientConnection
- extends DefaultBHttpClientConnection
- implements ManagedHttpClientConnection, org.apache.http.protocol.HttpContext
Default ManagedHttpClientConnection implementation.
- Since:
- 4.3
| Fields inherited from interface org.apache.http.protocol.HttpContext |
RESERVED_PREFIX |
|
Constructor Summary |
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,
org.apache.http.entity.ContentLengthStrategy incomingContentStrategy,
org.apache.http.entity.ContentLengthStrategy outgoingContentStrategy,
HttpMessageWriterFactory<org.apache.http.HttpRequest> requestWriterFactory,
HttpMessageParserFactory<org.apache.http.HttpResponse> responseParserFactory)
|
|
Method Summary |
void |
bind(java.net.Socket socket)
Binds this connection to the given Socket. |
java.lang.Object |
getAttribute(java.lang.String id)
|
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)
|
void |
setAttribute(java.lang.String id,
java.lang.Object obj)
|
void |
shutdown()
|
| Methods inherited from class org.apache.http.impl.BHttpConnectionBase |
awaitInput, close, createInputStream, createOutputStream, doFlush, ensureOpen, getLocalAddress, getLocalPort, getMetrics, getRemoteAddress, getRemotePort, getSessionInputBuffer, getSessionOutputBuffer, getSocketInputStream, getSocketOutputStream, getSocketTimeout, incrementRequestCount, incrementResponseCount, isOpen, isStale, prepareInput, prepareOutput, setSocketTimeout, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.http.HttpClientConnection |
flush, isResponseAvailable, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeader |
| Methods inherited from interface org.apache.http.HttpInetConnection |
getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort |
| Methods inherited from interface org.apache.http.HttpConnection |
close, getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeout |
DefaultManagedHttpClientConnection
public DefaultManagedHttpClientConnection(java.lang.String id,
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)
DefaultManagedHttpClientConnection
public DefaultManagedHttpClientConnection(java.lang.String id,
int buffersize)
getId
public java.lang.String getId()
- Description copied from interface:
ManagedHttpClientConnection
- Returns connection ID which is expected to be unique
for the life span of the connection manager.
- Specified by:
getId in interface ManagedHttpClientConnection
shutdown
public void shutdown()
throws java.io.IOException
- Specified by:
shutdown in interface org.apache.http.HttpConnection- Overrides:
shutdown in class BHttpConnectionBase
- Throws:
java.io.IOException
getAttribute
public java.lang.Object getAttribute(java.lang.String id)
- Specified by:
getAttribute in interface org.apache.http.protocol.HttpContext
removeAttribute
public java.lang.Object removeAttribute(java.lang.String id)
- Specified by:
removeAttribute in interface org.apache.http.protocol.HttpContext
setAttribute
public void setAttribute(java.lang.String id,
java.lang.Object obj)
- Specified by:
setAttribute in interface org.apache.http.protocol.HttpContext
bind
public void bind(java.net.Socket socket)
throws java.io.IOException
- Description copied from class:
BHttpConnectionBase
- Binds this connection to the given
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.
- Specified by:
bind in interface ManagedHttpClientConnection- Overrides:
bind in class DefaultBHttpClientConnection
- Parameters:
socket - the socket.
- Throws:
java.io.IOException - in case of an I/O error.
getSocket
public java.net.Socket getSocket()
- Description copied from interface:
ManagedHttpClientConnection
- Returns the underlying socket.
- Specified by:
getSocket in interface ManagedHttpClientConnection- Overrides:
getSocket in class BHttpConnectionBase
getSSLSession
public javax.net.ssl.SSLSession getSSLSession()
- Description copied from interface:
ManagedHttpClientConnection
- Obtains the SSL session of the underlying connection, if any.
If this connection is open, and the underlying socket is an
SSLSocket, the SSL session of
that socket is obtained. This is a potentially blocking operation.
- Specified by:
getSSLSession in interface ManagedHttpClientConnection
- Returns:
- the underlying SSL session if available,
null otherwise