Interface RemoteSession


public sealed interface RemoteSession

Contains basic information about a remote client session, the server's view of a connected client.

A session lasts exactly as long as the connection it serves and is identified by its connectionId, see id(). A client establishing more than one connection therefore has more than one session.

See Also:
  • Field Details

  • Method Details

    • request

      Returns:
      the initial connection request this session is based on
    • id

      UUID id()

      The id of the connection this session serves, and thereby the session's own, the two sharing a lifetime. This is the id the client knows the connection by, see EntityConnection.id().

      Returns:
      the id of this session
    • creationTime

      LocalDateTime creationTime()
      Returns:
      the time when this session was created
    • databaseUser

      User databaseUser()
      Returns:
      the user used when connecting to the underlying database
    • clientHost

      String clientHost()
      Note that if the client host is not known UNKNOWN_CLIENT_HOST is returned.
      Returns:
      the client hostname
    • withDatabaseUser

      RemoteSession withDatabaseUser(User databaseUser)
      Instantiates a new RemoteSession based on this instance but with the specified database user
      Parameters:
      databaseUser - the database user to use
      Returns:
      a new RemoteSession instance
    • copy

      Returns:
      a copy of this remote session with copies of its user instances
    • builder

      static RemoteSession.Builder builder(ConnectionRequest connectionRequest)
      Instantiates a new RemoteSession.Builder.
      Parameters:
      connectionRequest - the connection request
      Returns:
      a new builder