类 PersistenceSessionRepository

java.lang.Object
cn.taketoday.session.PersistenceSessionRepository
所有已实现的接口:
cn.taketoday.beans.factory.DisposableBean, SessionRepository

public class PersistenceSessionRepository extends Object implements SessionRepository, cn.taketoday.beans.factory.DisposableBean
SessionRepository implementation for session persistence
从以下版本开始:
4.0 2023/2/27 21:35
作者:
Harry Yang
  • 字段详细资料

    • log

      private static final cn.taketoday.logging.Logger log
    • delegate

      private final SessionRepository delegate
    • sessionPersister

      private final SessionPersister sessionPersister
  • 构造器详细资料

  • 方法详细资料

    • createSession

      public WebSession createSession()
      从接口复制的说明: SessionRepository
      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().

      指定者:
      createSession 在接口中 SessionRepository
      返回:
      the created session instance
    • createSession

      public WebSession createSession(String id)
      从接口复制的说明: SessionRepository
      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().

      指定者:
      createSession 在接口中 SessionRepository
      返回:
      the created session instance
    • retrieveSession

      @Nullable public WebSession retrieveSession(String sessionId)
      从接口复制的说明: SessionRepository
      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.

      指定者:
      retrieveSession 在接口中 SessionRepository
      参数:
      sessionId - the session to load
      返回:
      the session
    • removeSession

      public void removeSession(WebSession session)
      从接口复制的说明: SessionRepository
      Remove the WebSession for the specified instance.
      指定者:
      removeSession 在接口中 SessionRepository
      参数:
      session - the instance of the session to remove
    • removeSession

      @Nullable public WebSession removeSession(String sessionId)
      从接口复制的说明: SessionRepository
      Remove the WebSession for the specified id.
      指定者:
      removeSession 在接口中 SessionRepository
      参数:
      sessionId - the id of the session to remove
      返回:
      an old session
    • updateLastAccessTime

      public void updateLastAccessTime(WebSession webSession)
      从接口复制的说明: SessionRepository
      Update the last accessed timestamp to "now".
      指定者:
      updateLastAccessTime 在接口中 SessionRepository
      参数:
      webSession - the session to update
    • contains

      public boolean contains(String id)
      指定者:
      contains 在接口中 SessionRepository
    • getSessionCount

      public int getSessionCount()
      指定者:
      getSessionCount 在接口中 SessionRepository
      返回:
      the count of sessions
    • getIdentifiers

      public String[] getIdentifiers()
      指定者:
      getIdentifiers 在接口中 SessionRepository
      返回:
      all session ids
    • destroy

      public void destroy()
      Application shutdown
      指定者:
      destroy 在接口中 cn.taketoday.beans.factory.DisposableBean
    • removePersister

      private static void removePersister(String sessionId, SessionPersister sessionPersister)
    • createDestructionCallback

      public WebSessionListener createDestructionCallback()
      for WebSession destroy event
    • createDestructionCallback

      public static WebSessionListener createDestructionCallback(SessionPersister sessionPersister)
      for WebSession destroy event