接口 SessionPersister

所有已知实现类:
FileSessionPersister

public interface SessionPersister
A SessionPersister that provides persistent storage and loading of Sessions and their associated user data. Implementations are free to save and load the Sessions to any media they wish, but it is assumed that saved Sessions are persistent across server or context restarts.
从以下版本开始:
4.0 2023/2/26 23:04
作者:
Harry Yang
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    Remove all Sessions from this Store.
    boolean
    contains session with given id
     
    Load and return the Session associated with the specified session identifier from this Store, without removing it.
    void
    Remove the Session with the specified session identifier from this Store, if present.
    void
    save(WebSession session)
    Save the specified Session into this Store.
  • 方法详细资料

    • clear

      void clear() throws IOException
      Remove all Sessions from this Store.
      抛出:
      IOException - if an input/output error occurs
    • remove

      void remove(String id) throws IOException
      Remove the Session with the specified session identifier from this Store, if present. If no such Session is present, this method takes no action.
      参数:
      id - Session identifier of the Session to be removed
      抛出:
      IOException
    • contains

      boolean contains(String id)
      contains session with given id
    • keys

      String[] keys()
      返回:
      an array containing the session identifiers of all Sessions currently saved in this Store. If there are no such Sessions, a zero-length array is returned.
    • load

      Load and return the Session associated with the specified session identifier from this Store, without removing it. If there is no such stored Session, return null.
      参数:
      id - Session identifier of the session to load
      返回:
      the loaded Session instance
      抛出:
      ClassNotFoundException - if a deserialization error occurs
      IOException - if an input/output error occurs
    • save

      void save(WebSession session) throws IOException
      Save the specified Session into this Store. Any previously saved information for the associated session identifier is replaced.
      参数:
      session - Session to be saved
      抛出:
      IOException - if an input/output error occurs