Interface UserSessions<D,S>
- Type Parameters:
D- deployment identifier typeS- session identifier type
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
MutableUserSessions
Represents an index of user sessions.
- Author:
- Paul Ferraro
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddSession(D deployment, S session) Adds the specified deployment and session identifiers to the set of deployments for which the associated user is authenticated.voidclose()Returns the set of deployments for which the associated user is authenticated.getSession(D deployment) Returns the corresponding session identifier for the specified deployment.removeSession(D deployment) Removes the specified deployment from the set of deployments for which the associated user is authenticated.
-
Method Details
-
getDeployments
Returns the set of deployments for which the associated user is authenticated.- Returns:
- a set of deployment identifiers.
-
getSession
Returns the corresponding session identifier for the specified deployment.- Parameters:
deployment- a deployment identifier- Returns:
- the session identifier of the user for the specified deployment, or null, if no session exists for the associated user.
-
removeSession
Removes the specified deployment from the set of deployments for which the associated user is authenticated.- Parameters:
deployment- a deployment identifier- Returns:
- the session identifier of the user for the specified deployment, or null, if no session exists for the associated user.
-
addSession
Adds the specified deployment and session identifiers to the set of deployments for which the associated user is authenticated.- Parameters:
deployment- a deployment identifiersession- a session identifier- Returns:
- true, if the session was added, false it already exists
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-