Interface SessionManager

All Known Implementing Classes:
AbstractSessionManager, DefaultSessionManager

public interface SessionManager
The session manager is responsible for session start, session exists, session write, time to live and session destroy.

Created: 2017. 6. 12.

  • Method Details

    • getWorkerName

      String getWorkerName()
    • getScheduler

      Scheduler getScheduler()
    • getSessionIdGenerator

      SessionIdGenerator getSessionIdGenerator()
    • getSessionCache

      SessionCache getSessionCache()
    • getDefaultMaxIdleSecs

      int getDefaultMaxIdleSecs()
    • setDefaultMaxIdleSecs

      void setDefaultMaxIdleSecs(int defaultMaxIdleSecs)
    • getMaxIdleSecsForNew

      int getMaxIdleSecsForNew()
    • getSession

      ManagedSession getSession(String id)
      Get a known existing session.
      Parameters:
      id - the session id
      Returns:
      a Session or null if none exists
    • createSession

      ManagedSession createSession(String id)
      Create an entirely new Session.
      Parameters:
      id - identity of session to create
      Returns:
      the new session object
    • createSessionId

      String createSessionId(long seedTerm)
      Create a new Session ID.
      Parameters:
      seedTerm - the seed for RNG
      Returns:
      the new session id
    • renewSessionId

      String renewSessionId(String oldId, String newId)
      Change the id of a Session.
      Parameters:
      oldId - the current session id
      newId - the new session id
      Returns:
      the Session after changing its id
    • removeSession

      ManagedSession removeSession(String id, boolean invalidate)
      Remove session from manager.
      Parameters:
      id - the session to remove
      invalidate - if false, only remove from cache
      Returns:
      if the session was removed
    • removeSession

      ManagedSession removeSession(String id, boolean invalidate, Session.DestroyedReason reason)
    • invalidate

      void invalidate(String id)
      Called when a session has expired.
      Parameters:
      id - the id to invalidate
    • invalidate

      void invalidate(String id, Session.DestroyedReason reason)
    • addSessionListener

      void addSessionListener(SessionListener listener)
      Adds an event listener for session-related events.
      Parameters:
      listener - the session listener
      See Also:
    • removeSessionListener

      void removeSessionListener(SessionListener listener)
      Removes an event listener for session-related events.
      Parameters:
      listener - the session listener to remove
      See Also:
    • clearSessionListeners

      void clearSessionListeners()
      Removes all event listeners for session-related events.
      See Also:
    • getActiveSessions

      Set<String> getActiveSessions()
      Returns:
      the identifiers of those sessions that are active on this node, excluding passivated sessions
    • getAllSessions

      Set<String> getAllSessions()
      Returns:
      the identifiers of all sessions, including both active and passive
    • recordSessionTime

      void recordSessionTime(ManagedSession session)
      Record length of time session has been active. Called when the session is about to be invalidated.
      Parameters:
      session - the session whose time to record
    • getStatistics

      SessionStatistics getStatistics()