Interface SessionRegistry
-
- All Known Implementing Classes:
SessionRegistryImpl
public interface SessionRegistry
Maintains a registry ofSessionInformation
instances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<java.lang.Object>
getAllPrincipals()
Obtains all the known principals in theSessionRegistry
.java.util.List<SessionInformation>
getAllSessions(java.lang.Object principal, boolean includeExpiredSessions)
Obtains all the known sessions for the specified principal.SessionInformation
getSessionInformation(java.lang.String sessionId)
Obtains the session information for the specifiedsessionId
.void
refreshLastRequest(java.lang.String sessionId)
Updates the givensessionId
so its last request time is equal to the present date and time.void
registerNewSession(java.lang.String sessionId, java.lang.Object principal)
Registers a new session for the specified principal.void
removeSessionInformation(java.lang.String sessionId)
Deletes all the session information being maintained for the specifiedsessionId
.
-
-
-
Method Detail
-
getAllPrincipals
java.util.List<java.lang.Object> getAllPrincipals()
Obtains all the known principals in theSessionRegistry
.- Returns:
- each of the unique principals, which can then be presented to
getAllSessions(Object, boolean)
.
-
getAllSessions
java.util.List<SessionInformation> getAllSessions(java.lang.Object principal, boolean includeExpiredSessions)
Obtains all the known sessions for the specified principal. Sessions that have been destroyed are not returned. Sessions that have expired may be returned, depending on the passed argument.- Parameters:
principal
- to locate sessions for (should never benull
)includeExpiredSessions
- iftrue
, the returned sessions will also include those that have expired for the principal- Returns:
- the matching sessions for this principal (should not return null).
-
getSessionInformation
SessionInformation getSessionInformation(java.lang.String sessionId)
Obtains the session information for the specifiedsessionId
. Even expired sessions are returned (although destroyed sessions are never returned).- Parameters:
sessionId
- to lookup (should never benull
)- Returns:
- the session information, or
null
if not found
-
refreshLastRequest
void refreshLastRequest(java.lang.String sessionId)
Updates the givensessionId
so its last request time is equal to the present date and time. Silently returns if the givensessionId
cannot be found or the session is marked to expire.- Parameters:
sessionId
- for which to update the date and time of the last request (should never benull
)
-
registerNewSession
void registerNewSession(java.lang.String sessionId, java.lang.Object principal)
Registers a new session for the specified principal. The newly registered session will not be marked for expiration.- Parameters:
sessionId
- to associate with the principal (should never benull
)principal
- to associate with the session (should never benull
)
-
removeSessionInformation
void removeSessionInformation(java.lang.String sessionId)
Deletes all the session information being maintained for the specifiedsessionId
. If thesessionId
is not found, the method gracefully returns.- Parameters:
sessionId
- to delete information for (should never benull
)
-
-