public interface

SessionRegistry

org.springframework.security.core.session.SessionRegistry
Known Indirect Subclasses

Class Overview

Maintains a registry of SessionInformation instances.

Summary

Public Methods
abstract List<Object> getAllPrincipals()
Obtains all the known principals in the SessionRegistry.
abstract List<SessionInformation> getAllSessions(Object principal, boolean includeExpiredSessions)
Obtains all the known sessions for the specified principal.
abstract SessionInformation getSessionInformation(String sessionId)
Obtains the session information for the specified sessionId.
abstract void refreshLastRequest(String sessionId)
Updates the given sessionId so its last request time is equal to the present date and time.
abstract void registerNewSession(String sessionId, Object principal)
Registers a new session for the specified principal.
abstract void removeSessionInformation(String sessionId)
Deletes all the session information being maintained for the specified sessionId.

Public Methods

public abstract List<Object> getAllPrincipals ()

Obtains all the known principals in the SessionRegistry.

Returns

public abstract List<SessionInformation> getAllSessions (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 be null)
includeExpiredSessions if true, the returned sessions will also include those that have expired for the principal
Returns
  • the matching sessions for this principal (should not return null).

public abstract SessionInformation getSessionInformation (String sessionId)

Obtains the session information for the specified sessionId. Even expired sessions are returned (although destroyed sessions are never returned).

Parameters
sessionId to lookup (should never be null)
Returns
  • the session information, or null if not found

public abstract void refreshLastRequest (String sessionId)

Updates the given sessionId so its last request time is equal to the present date and time. Silently returns if the given sessionId 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 be null)

public abstract void registerNewSession (String sessionId, 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 be null)
principal to associate with the session (should never be null)

public abstract void removeSessionInformation (String sessionId)

Deletes all the session information being maintained for the specified sessionId. If the sessionId is not found, the method gracefully returns.

Parameters
sessionId to delete information for (should never be null)