Package io.servicetalk.transport.api
Interface ConnectionInfo
-
- All Known Subinterfaces:
ConnectionContext,GrpcServiceContext,HttpConnectionContext,NettyConnection<Read,Write>,NettyConnectionContext
- All Known Implementing Classes:
DefaultNettyConnection,DelegatingConnectionContext,DelegatingHttpConnectionContext,DelegatingHttpServiceContext,HttpServiceContext,TestHttpServiceContext
public interface ConnectionInfoProvides information about a connection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceConnectionInfo.ProtocolProvides information about the network protocol.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExecutionContextexecutionContext()Get theExecutionContextfor thisConnectionInfo.java.net.SocketAddresslocalAddress()TheSocketAddressto which the associated connection is bound.ConnectionInfo.Protocolprotocol()Get theConnectionInfo.Protocolfor thisConnectionInfo.java.net.SocketAddressremoteAddress()TheSocketAddressto which the associated connection is connected.<T> TsocketOption(java.net.SocketOption<T> option)javax.net.ssl.SSLSessionsslSession()Get theSSLSessionfor this connection.
-
-
-
Method Detail
-
localAddress
java.net.SocketAddress localAddress()
TheSocketAddressto which the associated connection is bound.- Returns:
- The
SocketAddressto which the associated connection is bound.
-
remoteAddress
java.net.SocketAddress remoteAddress()
TheSocketAddressto which the associated connection is connected.- Returns:
- The
SocketAddressto which the associated connection is connected.
-
sslSession
@Nullable javax.net.ssl.SSLSession sslSession()
Get theSSLSessionfor this connection.- Returns:
- The
SSLSessionif SSL/TLS is enabled, ornullotherwise.
-
executionContext
ExecutionContext executionContext()
Get theExecutionContextfor thisConnectionInfo.The
ExecutionContext.ioExecutor()will represent the thread responsible for IO for thisConnectionInfo. Note that this maybe different that what was used to create this object because at this time a specificIoExecutorhas been selected.- Returns:
- the
ExecutionContextfor thisConnectionInfo.
-
socketOption
@Nullable <T> T socketOption(java.net.SocketOption<T> option)
- Type Parameters:
T- the type of theSocketOptionvalue.- Parameters:
option-SocketOptionto get.- Returns:
- the
SocketOptionvalue of typeTfor thisConnectionInfoornullif thisSocketOptionis not supported by thisConnectionInfo. - See Also:
StandardSocketOptions,ServiceTalkSocketOptions
-
protocol
ConnectionInfo.Protocol protocol()
Get theConnectionInfo.Protocolfor thisConnectionInfo.- Returns:
- the
ConnectionInfo.Protocolfor thisConnectionInfo.
-
-