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:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic RemoteSession.Builderbuilder(ConnectionRequest connectionRequest) Instantiates a newRemoteSession.Builder.Note that if the client host is not knownUNKNOWN_CLIENT_HOSTis returned.copy()id()The id of the connection this session serves, and thereby the session's own, the two sharing a lifetime.request()withDatabaseUser(User databaseUser) Instantiates a newRemoteSessionbased on this instance but with the specified database user
-
Field Details
-
UNKNOWN_CLIENT_HOST
- See Also:
-
-
Method Details
-
request
ConnectionRequest 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 knownUNKNOWN_CLIENT_HOSTis returned.- Returns:
- the client hostname
-
withDatabaseUser
Instantiates a newRemoteSessionbased on this instance but with the specified database user- Parameters:
databaseUser- the database user to use- Returns:
- a new
RemoteSessioninstance
-
copy
RemoteSession copy()- Returns:
- a copy of this remote session with copies of its user instances
-
builder
Instantiates a newRemoteSession.Builder.- Parameters:
connectionRequest- the connection request- Returns:
- a new builder
-