Package org.apache.http.conn
Interface ManagedHttpClientConnection
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
,HttpClientConnection
,HttpConnection
,HttpInetConnection
- All Known Subinterfaces:
ManagedClientConnection
- All Known Implementing Classes:
AbstractClientConnAdapter
,AbstractPooledConnAdapter
,BasicPooledConnAdapter
,DefaultClientConnection
,DefaultManagedHttpClientConnection
public interface ManagedHttpClientConnection extends HttpClientConnection, HttpInetConnection
Represents a managed connection whose state and life cycle is managed by a connection manager. This interface extendsHttpClientConnection
with methods to bind the connection to an arbitrary socket and to obtain SSL session details.- Since:
- 4.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
bind(java.net.Socket socket)
Binds this connection to the given socket.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.-
Methods inherited from interface org.apache.http.HttpClientConnection
flush, isResponseAvailable, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeader
-
Methods inherited from interface org.apache.http.HttpConnection
close, getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeout, shutdown
-
Methods inherited from interface org.apache.http.HttpInetConnection
getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort
-
-
-
-
Method Detail
-
getId
java.lang.String getId()
Returns connection ID which is expected to be unique for the life span of the connection manager.
-
bind
void bind(java.net.Socket socket) throws java.io.IOException
Binds this connection to the given socket. The connection is considered open if it is bound and the underlying socket is connection to a remote host.- Parameters:
socket
- the socket to bind the connection to.- Throws:
java.io.IOException
-
getSocket
java.net.Socket getSocket()
Returns the underlying socket.
-
getSSLSession
javax.net.ssl.SSLSession getSSLSession()
Obtains the SSL session of the underlying connection, if any. If this connection is open, and the underlying socket is anSSLSocket
, the SSL session of that socket is obtained. This is a potentially blocking operation.- Returns:
- the underlying SSL session if available,
null
otherwise
-
-