org.apache.hc.client5.http.nio

## Interface ManagedAsyncClientConnection

All Superinterfaces:
  AutoCloseable, Closeable, org.apache.hc.core5.http.HttpConnection, org.apache.hc.core5.io.ModalCloseable, org.apache.hc.core5.http.SocketModalCloseable, org.apache.hc.core5.reactor.ssl.TransportSecurityLayer

    @Internal
    public interface ManagedAsyncClientConnection
    extends org.apache.hc.core5.http.HttpConnection, org.apache.hc.core5.reactor.ssl.TransportSecurityLayer

Represents a managed asynchronous connection whose state and life cycle is managed by a connection manager.

Since:
  5.0

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`void` `activate()` Restores the connection from idle mode.
`void` `passivate()` Puts the connection into idle mode.
`void` `submitCommand(org.apache.hc.core5.reactor.Command command, org.apache.hc.core5.reactor.Command.Priority priority)` Submits the given command for execution.
`default void` `switchProtocol(String protocolId, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.ProtocolIOSession> callback)` Switches this I/O session to the application protocol with the given ID.

### Methods inherited from interface org.apache.hc.core5.http.HttpConnection

`close, getEndpointDetails, getLocalAddress, getProtocolVersion, getRemoteAddress, getSSLSession, isOpen`

### Methods inherited from interface org.apache.hc.core5.http.SocketModalCloseable

`getSocketTimeout, setSocketTimeout`

### Methods inherited from interface org.apache.hc.core5.io.ModalCloseable

`close`

### Methods inherited from interface org.apache.hc.core5.reactor.ssl.TransportSecurityLayer

`getTlsDetails, startTls, startTls`

### Method Detail

#### submitCommand

    void submitCommand(org.apache.hc.core5.reactor.Command command,
                       org.apache.hc.core5.reactor.Command.Priority priority)

Submits the given command for execution.

Parameters:
  `command` - the command to be executed.
  `priority` - the command priority.

#### passivate

    void passivate()

Puts the connection into idle mode.

#### activate

    void activate()

Restores the connection from idle mode.

#### switchProtocol

    default void switchProtocol(String protocolId,
                                org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.ProtocolIOSession> callback)
                         throws UnsupportedOperationException

Switches this I/O session to the application protocol with the given ID.

Parameters:
  `protocolId` - the application protocol ID
  `callback` - the result callback
Throws:
  `UnsupportedOperationException` - if application protocol switch is not supported.
Since:
  5.2