org.apache.hc.client5.http.impl.nio

## Class DefaultManagedAsyncClientConnection

- java.lang.Object
- - org.apache.hc.client5.http.impl.nio.DefaultManagedAsyncClientConnection

All Implemented Interfaces:
  Closeable, AutoCloseable, ManagedAsyncClientConnection, HttpConnection, SocketModalCloseable, ModalCloseable, TransportSecurityLayer, Identifiable

    @Internal
    public class DefaultManagedAsyncClientConnection
    extends Object
    implements ManagedAsyncClientConnection, Identifiable

### Constructor Summary

Constructors
Constructor and Description
`DefaultManagedAsyncClientConnection(IOSession ioSession)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `activate()` Restores the connection from idle mode.
`void` `close()`
`void` `close(CloseMode closeMode)`
`EndpointDetails` `getEndpointDetails()`
`String` `getId()`
`SocketAddress` `getLocalAddress()`
`ProtocolVersion` `getProtocolVersion()`
`SocketAddress` `getRemoteAddress()`
`Timeout` `getSocketTimeout()`
`SSLSession` `getSSLSession()`
`TlsDetails` `getTlsDetails()`
`boolean` `isOpen()`
`void` `passivate()` Puts the connection into idle mode.
`void` `setSocketTimeout(Timeout timeout)`
`void` `startTls(SSLContext sslContext, NamedEndpoint endpoint, SSLBufferMode sslBufferMode, SSLSessionInitializer initializer, SSLSessionVerifier verifier, Timeout handshakeTimeout)`
`void` `startTls(SSLContext sslContext, NamedEndpoint endpoint, SSLBufferMode sslBufferMode, SSLSessionInitializer initializer, SSLSessionVerifier verifier, Timeout handshakeTimeout, FutureCallback<TransportSecurityLayer> callback)`
`void` `submitCommand(Command command, Command.Priority priority)` Submits the given command for execution.
`void` `switchProtocol(String protocolId, FutureCallback<ProtocolIOSession> callback)` Switches this I/O session to the application protocol with the given ID.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DefaultManagedAsyncClientConnection

    public DefaultManagedAsyncClientConnection(IOSession ioSession)

### Method Detail

#### getId

    public String getId()

Specified by:
  `getId` in interface `Identifiable`

#### close

    public void close(CloseMode closeMode)

Specified by:
  `close` in interface `ModalCloseable`

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `HttpConnection`
Throws:
  `IOException`

#### isOpen

    public boolean isOpen()

Specified by:
  `isOpen` in interface `HttpConnection`

#### setSocketTimeout

    public void setSocketTimeout(Timeout timeout)

Specified by:
  `setSocketTimeout` in interface `SocketModalCloseable`

#### getSocketTimeout

    public Timeout getSocketTimeout()

Specified by:
  `getSocketTimeout` in interface `SocketModalCloseable`

#### getRemoteAddress

    public SocketAddress getRemoteAddress()

Specified by:
  `getRemoteAddress` in interface `HttpConnection`

#### getLocalAddress

    public SocketAddress getLocalAddress()

Specified by:
  `getLocalAddress` in interface `HttpConnection`

#### getEndpointDetails

    public EndpointDetails getEndpointDetails()

Specified by:
  `getEndpointDetails` in interface `HttpConnection`

#### getProtocolVersion

    public ProtocolVersion getProtocolVersion()

Specified by:
  `getProtocolVersion` in interface `HttpConnection`

#### startTls

    public void startTls(SSLContext sslContext,
                         NamedEndpoint endpoint,
                         SSLBufferMode sslBufferMode,
                         SSLSessionInitializer initializer,
                         SSLSessionVerifier verifier,
                         Timeout handshakeTimeout,
                         FutureCallback<TransportSecurityLayer> callback)
                  throws UnsupportedOperationException

Specified by:
  `startTls` in interface `TransportSecurityLayer`
Throws:
  `UnsupportedOperationException`

#### startTls

    public void startTls(SSLContext sslContext,
                         NamedEndpoint endpoint,
                         SSLBufferMode sslBufferMode,
                         SSLSessionInitializer initializer,
                         SSLSessionVerifier verifier,
                         Timeout handshakeTimeout)
                  throws UnsupportedOperationException

Specified by:
  `startTls` in interface `TransportSecurityLayer`
Throws:
  `UnsupportedOperationException`

#### getTlsDetails

    public TlsDetails getTlsDetails()

Specified by:
  `getTlsDetails` in interface `TransportSecurityLayer`

#### getSSLSession

    public SSLSession getSSLSession()

Specified by:
  `getSSLSession` in interface `HttpConnection`

#### submitCommand

    public void submitCommand(Command command,
                              Command.Priority priority)

Description copied from interface: `ManagedAsyncClientConnection`
Submits the given command for execution.

Specified by:
  `submitCommand` in interface `ManagedAsyncClientConnection`
Parameters:
  `command` - the command to be executed.
  `priority` - the command priority.

#### passivate

    public void passivate()

Description copied from interface: `ManagedAsyncClientConnection`
Puts the connection into idle mode.

Specified by:
  `passivate` in interface `ManagedAsyncClientConnection`

#### activate

    public void activate()

Description copied from interface: `ManagedAsyncClientConnection`
Restores the connection from idle mode.

Specified by:
  `activate` in interface `ManagedAsyncClientConnection`

#### switchProtocol

    public void switchProtocol(String protocolId,
                               FutureCallback<ProtocolIOSession> callback)
                        throws UnsupportedOperationException

Description copied from interface: `ManagedAsyncClientConnection`
Switches this I/O session to the application protocol with the given ID.

Specified by:
  `switchProtocol` in interface `ManagedAsyncClientConnection`
Parameters:
  `protocolId` - the application protocol ID
  `callback` - the result callback
Throws:
  `UnsupportedOperationException` - if application protocol switch is not supported.