接口 SessionRepository

所有已知实现类:
InMemorySessionRepository, PersistenceSessionRepository

public interface SessionRepository
WebSession Storage
从以下版本开始:
2019-09-28 10:26
作者:
Harry Yang
  • 方法详细资料

    • createSession

      WebSession createSession()
      Create a new WebSession.

      Note that this does nothing more than create a new instance. The session can later be started explicitly via WebSession.start() or implicitly by adding attributes -- and then persisted via WebSession.save().

      返回:
      the created session instance
      从以下版本开始:
      4.0
    • createSession

      WebSession createSession(String id)
      Create a new WebSession with given session id.

      Note that this does nothing more than create a new instance. The session can later be started explicitly via WebSession.start() or implicitly by adding attributes -- and then persisted via WebSession.save().

      返回:
      the created session instance
      从以下版本开始:
      4.0
    • retrieveSession

      @Nullable WebSession retrieveSession(String sessionId)
      Return the WebSession for the given id.

      Note: This method should perform an expiration check, and if it has expired remove the session and return empty. This method should also update the lastAccessTime of retrieved sessions.

      参数:
      sessionId - the session to load
      返回:
      the session
    • removeSession

      default void removeSession(WebSession session)
      Remove the WebSession for the specified instance.
      参数:
      session - the instance of the session to remove
    • removeSession

      @Nullable WebSession removeSession(String sessionId)
      Remove the WebSession for the specified id.
      参数:
      sessionId - the id of the session to remove
      返回:
      an old session
    • updateLastAccessTime

      void updateLastAccessTime(WebSession webSession)
      Update the last accessed timestamp to "now".
      参数:
      webSession - the session to update
      从以下版本开始:
      4.0
    • contains

      boolean contains(String id)
    • getSessionCount

      int getSessionCount()
      返回:
      the count of sessions
      从以下版本开始:
      4.0
    • getIdentifiers

      String[] getIdentifiers()
      返回:
      all session ids
      从以下版本开始:
      4.0