Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.acegisecurity.concurrent
Class SessionRegistryImpl

    java.lang.Object
      org.acegisecurity.concurrent.SessionRegistryImpl

All Implemented Interfaces:
  EventListener, SessionRegistry, ApplicationListener

    public class SessionRegistryImpl

extends Object
implements SessionRegistry, ApplicationListener

Base implementation of `SessionRegistry` which also listens for `HttpSessionDestroyedEvent`s published in the Spring application context.

NB: It is important that you register the `HttpSessionEventPublisher` in `web.xml` so that this class is notified of sessions that expire.

Version:
  $Id: SessionRegistryImpl.java,v 1.2 2005/11/17 00:55:56 benalex Exp ${date}
Author:
  Ben Alex

Constructor Summary
`SessionRegistryImpl()`

Method Summary
`SessionInformation[]` | `getAllSessions(Object principal)` Obtains all the known sessions for the specified principal.
`SessionInformation` | `getSessionInformation(String sessionId)` Obtains the session information for the specified `sessionId`.
`void` | `onApplicationEvent(ApplicationEvent event)`
`void` | `refreshLastRequest(String sessionId)` Updates the given `sessionId` so its last request time is equal to the present date and time.
`void` | `registerNewSession(String sessionId, Object principal)` Registers a new session for the specified principal.
`void` | `removeSessionInformation(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`

Constructor Detail

### SessionRegistryImpl

    public SessionRegistryImpl()

Method Detail

### getAllSessions

    public SessionInformation[] getAllSessions(Object principal)

  Description copied from interface: `SessionRegistry`
  Obtains all the known sessions for the specified principal. Sessions that have expired or destroyed are not returned.

  Specified by:
    `getAllSessions` in interface `SessionRegistry`
  Parameters:
    `principal` - to locate sessions for (should never be `null`)
  Returns:
    the unexpired and undestroyed sessions for this principal, or `null` if none were found

### getSessionInformation

    public SessionInformation getSessionInformation(String sessionId)

  Description copied from interface: `SessionRegistry`
  Obtains the session information for the specified `sessionId`. Even expired sessions are returned (although destroyed sessions are never returned).

  Specified by:
    `getSessionInformation` in interface `SessionRegistry`
  Parameters:
    `sessionId` - to lookup (should never be `null`)
  Returns:
    the session information, or `null` if not found

### onApplicationEvent

    public void onApplicationEvent(ApplicationEvent event)

  Specified by:
    `onApplicationEvent` in interface `ApplicationListener`

### refreshLastRequest

    public void refreshLastRequest(String sessionId)

  Description copied from interface: `SessionRegistry`
  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.

  Specified by:
    `refreshLastRequest` in interface `SessionRegistry`
  Parameters:
    `sessionId` - for which to update the date and time of the last request (should never be `null`)

### registerNewSession

    public void registerNewSession(String sessionId,
                                   Object principal)
                            throws SessionAlreadyUsedException

  Description copied from interface: `SessionRegistry`
  Registers a new session for the specified principal. The newly registered session will not be marked for expiration.

  Specified by:
    `registerNewSession` in interface `SessionRegistry`
  Parameters:
    `sessionId` - to associate with the principal (should never be `null`)
    `principal` - to associate with the session (should never be `null`)
  Throws:
    `SessionAlreadyUsedException` - DOCUMENT ME!

### removeSessionInformation

    public void removeSessionInformation(String sessionId)

  Description copied from interface: `SessionRegistry`
  Deletes all the session information being maintained for the specified `sessionId`. If the `sessionId` is not found, the method gracefully returns.

  Specified by:
    `removeSessionInformation` in interface `SessionRegistry`
  Parameters:
    `sessionId` - to delete information for (should never be `null`)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.