Interface SocketContext

All Known Subinterfaces:
ConnectionContext, HelidonSocket
All Known Implementing Classes:
DirectSocket, PlainSocket, TlsSocket

public interface SocketContext
Information available for a connected socket.
  • 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 current socketId() and childSocketId() to have consistent logs mappable to sockets.
      Parameters:
      logger - logger to use
      level - log level to use
      format - 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 current socketId() and childSocketId() to have consistent logs mappable to sockets.
      Parameters:
      logger - logger to use
      level - log level to use
      format - format (can use string format pattern for the variables provided)
      t - throwable to log in addition to the message
      variables - variables of the format