Interface ConnectionInfo
- All Known Subinterfaces:
ConnectionContext,GrpcServiceContext,HttpConnectionContext,NettyConnection<Read,,Write> NettyConnectionContext
- All Known Implementing Classes:
DefaultNettyConnection,DelegatingConnectionContext,DelegatingHttpConnectionContext,DelegatingHttpServiceContext,HttpServiceContext,NettyPipelinedConnection
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceProvides information about the network protocol. -
Method Summary
Modifier and TypeMethodDescriptiondefault StringString representation of an identifier for this connection (can be globally non-unique).Get theExecutionContextfor thisConnectionInfo.TheSocketAddressto which the associated connection is bound.protocol()Get theConnectionInfo.Protocolfor thisConnectionInfo.TheSocketAddressto which the associated connection is connected.<T> TsocketOption(SocketOption<T> option) default SslConfigGet theSslConfigfor this connection.Get theSSLSessionfor this connection.toString()String representation of the current connection information.
-
Method Details
-
toString
String toString()String representation of the current connection information. -
connectionId
String representation of an identifier for this connection (can be globally non-unique).Note: this identifier is a string representation of an ID assigned by underlying implementation of the connection. Whether it's globally unique or not depends on that implementation. It's not recommended to use this identifier as a map key for storing connection related data. It can be used for logging purposes to correlate events happening on this connection with other logs or events related to the same instance. If necessary, uniqueness can be ensured by using a combination of the current identifier with
localAddress()andremoteAddress().- Returns:
- String representation of an identifier for this connection (can be globally non-unique).
-
localAddress
SocketAddress localAddress()TheSocketAddressto which the associated connection is bound.- Returns:
- The
SocketAddressto which the associated connection is bound.
-
remoteAddress
SocketAddress remoteAddress()TheSocketAddressto which the associated connection is connected.- Returns:
- The
SocketAddressto which the associated connection is connected.
-
sslConfig
Get theSslConfigfor this connection.- Returns:
- The
SslConfigif SSL/TLS is configured, ornullotherwise.
-
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
- Type Parameters:
T- the type of theSocketOptionvalue.- Parameters:
option-SocketOptionto get.- Returns:
- the
SocketOptionvalue of typeTfor thisConnectionInfoornullif thisSocketOptionis not supported by thisConnectionInfo. - See Also:
-
protocol
ConnectionInfo.Protocol protocol()Get theConnectionInfo.Protocolfor thisConnectionInfo.- Returns:
- the
ConnectionInfo.Protocolfor thisConnectionInfo.
-