- All Known Subinterfaces:
ConnectionContext
,HelidonSocket
- All Known Implementing Classes:
DirectSocket
,PlainSocket
,TlsSocket
public interface SocketContext
Information available for a connected socket.
-
Method Summary
Modifier and TypeMethodDescriptionChild socket id.boolean
isSecure()
Whether the request is secure.Local peer information.default void
log
(System.Logger logger, System.Logger.Level level, String format, Object... variables) Log a message with the currentsocketId()
andchildSocketId()
to have consistent logs mappable to sockets.default void
log
(System.Logger logger, System.Logger.Level level, String format, Throwable t, Object... variables) Log a message with the currentsocketId()
andchildSocketId()
to have consistent logs mappable to sockets.Remote peer information.socketId()
Main socket id.
-
Method Details
-
remotePeer
PeerInfo remotePeer()Remote peer information.- Returns:
- peer info
-
localPeer
PeerInfo localPeer()Local peer information.- Returns:
- peer info
-
isSecure
boolean isSecure()Whether the request is secure.- Returns:
- whether secure
-
socketId
String socketId()Main socket id. This is the server socket id for server side, connection id for client side.- Returns:
- socket id
-
childSocketId
String childSocketId()Child socket id. This is the connection socket id for server side. For client side, this may be additional identification of a request (pipeline id, stream id).- Returns:
- child socket id, never null
-
log
default void log(System.Logger logger, System.Logger.Level level, String format, Object... variables) Log a message with the currentsocketId()
andchildSocketId()
to have consistent logs mappable to sockets.- Parameters:
logger
- logger to uselevel
- log level to useformat
- format (can use string format pattern for the variables provided)variables
- variables of the format
-
log
default void log(System.Logger logger, System.Logger.Level level, String format, Throwable t, Object... variables) Log a message with the currentsocketId()
andchildSocketId()
to have consistent logs mappable to sockets.- Parameters:
logger
- logger to uselevel
- log level to useformat
- format (can use string format pattern for the variables provided)t
- throwable to log in addition to the messagevariables
- variables of the format
-