|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.security.core.session.SessionRegistryImpl
public class SessionRegistryImpl
Default implementation of SessionRegistry
which listens for SessionDestroyedEvent
s
published in the Spring application context.
For this class to function correctly in a web application, it is important that you register an
HttpSessionEventPublisher
in the web.xml file so that this class is notified of sessions that expire.
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
logger
|
Constructor Summary | |
---|---|
SessionRegistryImpl()
|
Method Summary | |
---|---|
java.util.List<java.lang.Object> |
getAllPrincipals()
Obtains all the known principals in the SessionRegistry . |
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 specified sessionId . |
void |
onApplicationEvent(SessionDestroyedEvent event)
|
void |
refreshLastRequest(java.lang.String sessionId)
Updates the given sessionId 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 specified sessionId . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.commons.logging.Log logger
Constructor Detail |
---|
public SessionRegistryImpl()
Method Detail |
---|
public java.util.List<java.lang.Object> getAllPrincipals()
SessionRegistry
SessionRegistry
.
getAllPrincipals
in interface SessionRegistry
SessionRegistry.getAllSessions(Object, boolean)
.public java.util.List<SessionInformation> getAllSessions(java.lang.Object principal, boolean includeExpiredSessions)
SessionRegistry
getAllSessions
in interface SessionRegistry
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
public SessionInformation getSessionInformation(java.lang.String sessionId)
SessionRegistry
sessionId
. Even expired sessions are
returned (although destroyed sessions are never returned).
getSessionInformation
in interface SessionRegistry
sessionId
- to lookup (should never be null
)
null
if not foundpublic void onApplicationEvent(SessionDestroyedEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<SessionDestroyedEvent>
public void refreshLastRequest(java.lang.String sessionId)
SessionRegistry
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.
refreshLastRequest
in interface SessionRegistry
sessionId
- for which to update the date and time of the last request (should never be null
)public void registerNewSession(java.lang.String sessionId, java.lang.Object principal)
SessionRegistry
registerNewSession
in interface SessionRegistry
sessionId
- to associate with the principal (should never be null
)principal
- to associate with the session (should never be null
)public void removeSessionInformation(java.lang.String sessionId)
SessionRegistry
sessionId
. If the
sessionId
is not found, the method gracefully returns.
removeSessionInformation
in interface SessionRegistry
sessionId
- to delete information for (should never be null
)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |