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 ConnectionInfo
Provides information about a connection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ConnectionInfo.Protocol
Provides information about the network protocol.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExecutionContext
executionContext()
Get theExecutionContext
for thisConnectionInfo
.java.net.SocketAddress
localAddress()
TheSocketAddress
to which the associated connection is bound.ConnectionInfo.Protocol
protocol()
Get theConnectionInfo.Protocol
for thisConnectionInfo
.java.net.SocketAddress
remoteAddress()
TheSocketAddress
to which the associated connection is connected.<T> T
socketOption(java.net.SocketOption<T> option)
javax.net.ssl.SSLSession
sslSession()
Get theSSLSession
for this connection.
-
-
-
Method Detail
-
localAddress
java.net.SocketAddress localAddress()
TheSocketAddress
to which the associated connection is bound.- Returns:
- The
SocketAddress
to which the associated connection is bound.
-
remoteAddress
java.net.SocketAddress remoteAddress()
TheSocketAddress
to which the associated connection is connected.- Returns:
- The
SocketAddress
to which the associated connection is connected.
-
sslSession
@Nullable javax.net.ssl.SSLSession sslSession()
Get theSSLSession
for this connection.- Returns:
- The
SSLSession
if SSL/TLS is enabled, ornull
otherwise.
-
executionContext
ExecutionContext executionContext()
Get theExecutionContext
for 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 specificIoExecutor
has been selected.- Returns:
- the
ExecutionContext
for thisConnectionInfo
.
-
socketOption
@Nullable <T> T socketOption(java.net.SocketOption<T> option)
- Type Parameters:
T
- the type of theSocketOption
value.- Parameters:
option
-SocketOption
to get.- Returns:
- the
SocketOption
value of typeT
for thisConnectionInfo
ornull
if thisSocketOption
is not supported by thisConnectionInfo
. - See Also:
StandardSocketOptions
,ServiceTalkSocketOptions
-
protocol
ConnectionInfo.Protocol protocol()
Get theConnectionInfo.Protocol
for thisConnectionInfo
.- Returns:
- the
ConnectionInfo.Protocol
for thisConnectionInfo
.
-
-