Class DefaultManagedAsyncClientConnection
- java.lang.Object
-
- org.apache.hc.client5.http.impl.nio.DefaultManagedAsyncClientConnection
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.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 java.lang.Object implements ManagedAsyncClientConnection, org.apache.hc.core5.util.Identifiable
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicBooleanclosedprivate org.apache.hc.core5.reactor.IOSessionioSessionprivate static org.slf4j.LoggerLOGprivate org.apache.hc.core5.util.TimeoutsocketTimeout
-
Constructor Summary
Constructors Constructor Description DefaultManagedAsyncClientConnection(org.apache.hc.core5.reactor.IOSession ioSession)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()Restores the connection from idle mode.voidclose()voidclose(org.apache.hc.core5.io.CloseMode closeMode)org.apache.hc.core5.http.EndpointDetailsgetEndpointDetails()java.lang.StringgetId()java.net.SocketAddressgetLocalAddress()org.apache.hc.core5.http.ProtocolVersiongetProtocolVersion()java.net.SocketAddressgetRemoteAddress()org.apache.hc.core5.util.TimeoutgetSocketTimeout()javax.net.ssl.SSLSessiongetSSLSession()org.apache.hc.core5.reactor.ssl.TlsDetailsgetTlsDetails()booleanisOpen()voidpassivate()Puts the connection into idle mode.voidsetSocketTimeout(org.apache.hc.core5.util.Timeout timeout)voidstartTls(javax.net.ssl.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)voidstartTls(javax.net.ssl.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)voidsubmitCommand(org.apache.hc.core5.reactor.Command command, org.apache.hc.core5.reactor.Command.Priority priority)Submits the given command for execution.voidswitchProtocol(java.lang.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.
-
-
-
Method Detail
-
getId
public java.lang.String getId()
- Specified by:
getIdin interfaceorg.apache.hc.core5.util.Identifiable
-
close
public void close(org.apache.hc.core5.io.CloseMode closeMode)
- Specified by:
closein interfaceorg.apache.hc.core5.io.ModalCloseable
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceorg.apache.hc.core5.http.HttpConnection- Throws:
java.io.IOException
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfaceorg.apache.hc.core5.http.HttpConnection
-
setSocketTimeout
public void setSocketTimeout(org.apache.hc.core5.util.Timeout timeout)
- Specified by:
setSocketTimeoutin interfaceorg.apache.hc.core5.http.SocketModalCloseable
-
getSocketTimeout
public org.apache.hc.core5.util.Timeout getSocketTimeout()
- Specified by:
getSocketTimeoutin interfaceorg.apache.hc.core5.http.SocketModalCloseable
-
getRemoteAddress
public java.net.SocketAddress getRemoteAddress()
- Specified by:
getRemoteAddressin interfaceorg.apache.hc.core5.http.HttpConnection
-
getLocalAddress
public java.net.SocketAddress getLocalAddress()
- Specified by:
getLocalAddressin interfaceorg.apache.hc.core5.http.HttpConnection
-
getEndpointDetails
public org.apache.hc.core5.http.EndpointDetails getEndpointDetails()
- Specified by:
getEndpointDetailsin interfaceorg.apache.hc.core5.http.HttpConnection
-
getProtocolVersion
public org.apache.hc.core5.http.ProtocolVersion getProtocolVersion()
- Specified by:
getProtocolVersionin interfaceorg.apache.hc.core5.http.HttpConnection
-
startTls
public void startTls(javax.net.ssl.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 java.lang.UnsupportedOperationException- Specified by:
startTlsin interfaceorg.apache.hc.core5.reactor.ssl.TransportSecurityLayer- Throws:
java.lang.UnsupportedOperationException
-
startTls
public void startTls(javax.net.ssl.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 java.lang.UnsupportedOperationException- Specified by:
startTlsin interfaceorg.apache.hc.core5.reactor.ssl.TransportSecurityLayer- Throws:
java.lang.UnsupportedOperationException
-
getTlsDetails
public org.apache.hc.core5.reactor.ssl.TlsDetails getTlsDetails()
- Specified by:
getTlsDetailsin interfaceorg.apache.hc.core5.reactor.ssl.TransportSecurityLayer
-
getSSLSession
public javax.net.ssl.SSLSession getSSLSession()
- Specified by:
getSSLSessionin 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:ManagedAsyncClientConnectionSubmits the given command for execution.- Specified by:
submitCommandin interfaceManagedAsyncClientConnection- Parameters:
command- the command to be executed.priority- the command priority.
-
passivate
public void passivate()
Description copied from interface:ManagedAsyncClientConnectionPuts the connection into idle mode.- Specified by:
passivatein interfaceManagedAsyncClientConnection
-
activate
public void activate()
Description copied from interface:ManagedAsyncClientConnectionRestores the connection from idle mode.- Specified by:
activatein interfaceManagedAsyncClientConnection
-
switchProtocol
public void switchProtocol(java.lang.String protocolId, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.ProtocolIOSession> callback) throws java.lang.UnsupportedOperationExceptionDescription copied from interface:ManagedAsyncClientConnectionSwitches this I/O session to the application protocol with the given ID.- Specified by:
switchProtocolin interfaceManagedAsyncClientConnection- Parameters:
protocolId- the application protocol IDcallback- the result callback- Throws:
java.lang.UnsupportedOperationException- if application protocol switch is not supported.
-
-