Package 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
- All Known Implementing Classes:
DefaultManagedAsyncClientConnection
@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
Modifier and TypeMethodDescriptionvoidactivate()Restores the connection from idle mode.voidPuts the connection into idle mode.voidsubmitCommand(org.apache.hc.core5.reactor.Command command, org.apache.hc.core5.reactor.Command.Priority priority) Submits the given command for execution.default voidswitchProtocol(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, isOpenMethods inherited from interface org.apache.hc.core5.io.ModalCloseable
closeMethods inherited from interface org.apache.hc.core5.http.SocketModalCloseable
getSocketTimeout, setSocketTimeoutMethods inherited from interface org.apache.hc.core5.reactor.ssl.TransportSecurityLayer
getTlsDetails, startTls, startTls
-
Method Details
-
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 IDcallback- the result callback- Throws:
UnsupportedOperationException- if application protocol switch is not supported.- Since:
- 5.2
-