Class DecoratedSessionManager<C>

Type Parameters:
C - the session context type
All Implemented Interfaces:
Manager<String>, ManagerConfiguration<String>, Service, SessionManager<C>
Direct Known Subclasses:
CachedSessionManager

public class DecoratedSessionManager<C> extends DecoratedManager<String> implements SessionManager<C>
A session manager decorator.
Author:
Paul Ferraro
  • Constructor Details

    • DecoratedSessionManager

      public DecoratedSessionManager(SessionManager<C> manager)
      Creates a session manager decorator.
      Parameters:
      manager - the decorated session manager.
  • Method Details

    • createSessionAsync

      public CompletionStage<Session<C>> createSessionAsync(String id, Instant creationTime)
      Description copied from interface: SessionManager
      Creates a session using the specified identifier. Sessions returned by this method must be closed via Session.close(). This method is intended to be invoked within the context of a batch.
      Specified by:
      createSessionAsync in interface SessionManager<C>
      Parameters:
      id - a session identifier
      creationTime - the time this session was created
      Returns:
      a new web session, or null if a session with the specified identifier already exists.
    • findSessionAsync

      public CompletionStage<Session<C>> findSessionAsync(String id)
      Description copied from interface: SessionManager
      Returns the session with the specified identifier, or null if none exists. Sessions returned by this method must be closed via Session.close(). This method is intended to be invoked within the context of a batch.
      Specified by:
      findSessionAsync in interface SessionManager<C>
      Parameters:
      id - a session identifier
      Returns:
      an existing web session, or null if none exists
    • findImmutableSessionAsync

      public CompletionStage<ImmutableSession> findImmutableSessionAsync(String id)
      Description copied from interface: SessionManager
      Returns a read-only view of the session with the specified identifier. This method is intended to be invoked within the context of a batch
      Specified by:
      findImmutableSessionAsync in interface SessionManager<C>
      Parameters:
      id - a unique session identifier
      Returns:
      a read-only session or null if none exists
    • getDetachedSession

      public Session<C> getDetachedSession(String id)
      Description copied from interface: SessionManager
      Returns a detached session with the specified identifier. A detached session is only valid if a session exists for the given identifier.
      Specified by:
      getDetachedSession in interface SessionManager<C>
      Parameters:
      id - the session identifier of the detached session
      Returns:
      a detached session
    • getStatistics

      public SessionStatistics getStatistics()
      Description copied from interface: SessionManager
      Returns statistics for this session manager.
      Specified by:
      getStatistics in interface SessionManager<C>
      Returns:
      an object from which statistics can be obtained.