Class DefaultManagedAsyncClientConnection
java.lang.Object
org.apache.hc.client5.http.impl.nio.DefaultManagedAsyncClientConnection
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ManagedAsyncClientConnection
,org.apache.hc.core5.http.HttpConnection
,org.apache.hc.core5.http.SocketModalCloseable
,org.apache.hc.core5.io.ModalCloseable
,org.apache.hc.core5.reactor.ssl.TransportSecurityLayer
,org.apache.hc.core5.util.Identifiable
final class DefaultManagedAsyncClientConnection
extends Object
implements ManagedAsyncClientConnection, org.apache.hc.core5.util.Identifiable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicBoolean
private final org.apache.hc.core5.reactor.IOSession
private static final org.slf4j.Logger
private final org.apache.hc.core5.util.Timeout
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultManagedAsyncClientConnection
(org.apache.hc.core5.reactor.IOSession ioSession) -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Restores the connection from idle mode.void
close()
void
close
(org.apache.hc.core5.io.CloseMode closeMode) org.apache.hc.core5.http.EndpointDetails
getId()
org.apache.hc.core5.http.ProtocolVersion
org.apache.hc.core5.util.Timeout
org.apache.hc.core5.reactor.ssl.TlsDetails
boolean
isOpen()
void
Puts the connection into idle mode.void
setSocketTimeout
(org.apache.hc.core5.util.Timeout timeout) void
startTls
(SSLContext sslContext, org.apache.hc.core5.net.NamedEndpoint endpoint, org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferMode, org.apache.hc.core5.reactor.ssl.SSLSessionInitializer initializer, org.apache.hc.core5.reactor.ssl.SSLSessionVerifier verifier, org.apache.hc.core5.util.Timeout handshakeTimeout) void
startTls
(SSLContext sslContext, org.apache.hc.core5.net.NamedEndpoint endpoint, org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferMode, org.apache.hc.core5.reactor.ssl.SSLSessionInitializer initializer, org.apache.hc.core5.reactor.ssl.SSLSessionVerifier verifier, org.apache.hc.core5.util.Timeout handshakeTimeout, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.ssl.TransportSecurityLayer> callback) void
submitCommand
(org.apache.hc.core5.reactor.Command command, org.apache.hc.core5.reactor.Command.Priority priority) Submits the given command for execution.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.
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
ioSession
private final org.apache.hc.core5.reactor.IOSession ioSession -
socketTimeout
private final org.apache.hc.core5.util.Timeout socketTimeout -
closed
-
-
Constructor Details
-
DefaultManagedAsyncClientConnection
public DefaultManagedAsyncClientConnection(org.apache.hc.core5.reactor.IOSession ioSession)
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceorg.apache.hc.core5.util.Identifiable
-
close
public void close(org.apache.hc.core5.io.CloseMode closeMode) - Specified by:
close
in interfaceorg.apache.hc.core5.io.ModalCloseable
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.apache.hc.core5.http.HttpConnection
- Throws:
IOException
-
isOpen
public boolean isOpen()- Specified by:
isOpen
in interfaceorg.apache.hc.core5.http.HttpConnection
-
setSocketTimeout
public void setSocketTimeout(org.apache.hc.core5.util.Timeout timeout) - Specified by:
setSocketTimeout
in interfaceorg.apache.hc.core5.http.SocketModalCloseable
-
getSocketTimeout
public org.apache.hc.core5.util.Timeout getSocketTimeout()- Specified by:
getSocketTimeout
in interfaceorg.apache.hc.core5.http.SocketModalCloseable
-
getRemoteAddress
- Specified by:
getRemoteAddress
in interfaceorg.apache.hc.core5.http.HttpConnection
-
getLocalAddress
- Specified by:
getLocalAddress
in interfaceorg.apache.hc.core5.http.HttpConnection
-
getEndpointDetails
public org.apache.hc.core5.http.EndpointDetails getEndpointDetails()- Specified by:
getEndpointDetails
in interfaceorg.apache.hc.core5.http.HttpConnection
-
getProtocolVersion
public org.apache.hc.core5.http.ProtocolVersion getProtocolVersion()- Specified by:
getProtocolVersion
in interfaceorg.apache.hc.core5.http.HttpConnection
-
startTls
public void startTls(SSLContext sslContext, org.apache.hc.core5.net.NamedEndpoint endpoint, org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferMode, org.apache.hc.core5.reactor.ssl.SSLSessionInitializer initializer, org.apache.hc.core5.reactor.ssl.SSLSessionVerifier verifier, org.apache.hc.core5.util.Timeout handshakeTimeout, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.ssl.TransportSecurityLayer> callback) throws UnsupportedOperationException - Specified by:
startTls
in interfaceorg.apache.hc.core5.reactor.ssl.TransportSecurityLayer
- Throws:
UnsupportedOperationException
-
startTls
public void startTls(SSLContext sslContext, org.apache.hc.core5.net.NamedEndpoint endpoint, org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferMode, org.apache.hc.core5.reactor.ssl.SSLSessionInitializer initializer, org.apache.hc.core5.reactor.ssl.SSLSessionVerifier verifier, org.apache.hc.core5.util.Timeout handshakeTimeout) throws UnsupportedOperationException - Specified by:
startTls
in interfaceorg.apache.hc.core5.reactor.ssl.TransportSecurityLayer
- Throws:
UnsupportedOperationException
-
getTlsDetails
public org.apache.hc.core5.reactor.ssl.TlsDetails getTlsDetails()- Specified by:
getTlsDetails
in interfaceorg.apache.hc.core5.reactor.ssl.TransportSecurityLayer
-
getSSLSession
- Specified by:
getSSLSession
in interfaceorg.apache.hc.core5.http.HttpConnection
-
submitCommand
public void submitCommand(org.apache.hc.core5.reactor.Command command, org.apache.hc.core5.reactor.Command.Priority priority) Description copied from interface:ManagedAsyncClientConnection
Submits the given command for execution.- Specified by:
submitCommand
in interfaceManagedAsyncClientConnection
- 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 interfaceManagedAsyncClientConnection
-
activate
public void activate()Description copied from interface:ManagedAsyncClientConnection
Restores the connection from idle mode.- Specified by:
activate
in interfaceManagedAsyncClientConnection
-
switchProtocol
public void switchProtocol(String protocolId, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.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 interfaceManagedAsyncClientConnection
- Parameters:
protocolId
- the application protocol IDcallback
- the result callback- Throws:
UnsupportedOperationException
- if application protocol switch is not supported.
-