ManagedHttpClientConnection (Apache HttpClient 4.5.13 API)
Date: 2020-10-03

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.http.conn
Interface ManagedHttpClientConnection

All Superinterfaces:
  Closeable, org.apache.http.HttpClientConnection, org.apache.http.HttpConnection, org.apache.http.HttpInetConnection

All Known Subinterfaces:
  ManagedClientConnection

All Known Implementing Classes:
  AbstractClientConnAdapter, AbstractPooledConnAdapter, BasicPooledConnAdapter, DefaultClientConnection, DefaultManagedHttpClientConnection, SingleClientConnManager.ConnAdapter

    public interface ManagedHttpClientConnection

extends org.apache.http.HttpClientConnection, org.apache.http.HttpInetConnection

Represents a managed connection whose state and life cycle is managed by a connection manager. This interface extends `HttpClientConnection` with methods to bind the connection to an arbitrary socket and to obtain SSL session details.

Since:
  4.3

Method Summary
`void` | `bind(Socket socket)` Binds this connection to the given socket.
`String` | `getId()` Returns connection ID which is expected to be unique for the life span of the connection manager.
`Socket` | `getSocket()` Returns the underlying socket.
`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.HttpInetConnection
`getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort`

Methods inherited from interface org.apache.http.HttpConnection
`close, getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeout, shutdown`

Method Detail

### getId

    String getId()

  Returns connection ID which is expected to be unique for the life span of the connection manager.

### bind

    void bind(Socket socket)
              throws 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:
    `IOException`

### getSocket

    Socket getSocket()

  Returns the underlying socket.

### getSSLSession

    SSLSession getSSLSession()

  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.

  Returns:
    the underlying SSL session if available, `null` otherwise

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999–2020 The Apache Software Foundation. All rights reserved.