类 FileSessionPersister
java.lang.Object
cn.taketoday.session.FileSessionPersister
- 所有已实现的接口:
SessionPersister
Concrete implementation of the SessionPersister interface that utilizes
a file per saved Session in a configured directory. Sessions that are
saved are still subject to being expired based on inactivity.
- 从以下版本开始:
- 4.0 2023/2/27 21:43
- 作者:
- Craig R. McClanahan, Harry Yang
-
字段概要
字段修饰符和类型字段说明private cn.taketoday.core.ApplicationTempprivate FileThe directory in which Sessions are stored.private static final StringThe extension to use for serialized session filenames.private static final cn.taketoday.logging.Loggerprivate final SessionRepository -
构造器概要
构造器构造器说明FileSessionPersister(SessionRepository repository) Creates FileSessionPersister with given SessionRepository -
方法概要
修饰符和类型方法说明voidclear()Remove all of the Sessions in this Store.booleancontains session with given idprivate FileReturn a File object representing the pathname to our session persistence directory, if any.String[]keys()Return an array containing the session identifiers of all Sessions currently saved in this Store.Load and return the WebSession associated with the specified session identifier from this Store, without removing it.voidRemove the Session with the specified session identifier from this SessionPersister, if present.voidsave(WebSession session) Save the specified Session into this Store.private FilesessionFile(String id) Return a File object representing the pathname to our session persistence file, if any.voidsetApplicationTemp(cn.taketoday.core.ApplicationTemp applicationTemp) Set the app temp provider for this SessionPersister.voidsetDirectory(File directory) Set the store directory for this SessionPersister.
-
字段详细资料
-
log
private static final cn.taketoday.logging.Logger log -
FILE_EXT
The extension to use for serialized session filenames.- 另请参阅:
-
directory
The directory in which Sessions are stored. -
applicationTemp
@Nullable private cn.taketoday.core.ApplicationTemp applicationTemp -
repository
-
-
构造器详细资料
-
FileSessionPersister
Creates FileSessionPersister with given SessionRepository- 参数:
repository- used to create session- 另请参阅:
-
-
方法详细资料
-
setDirectory
Set the store directory for this SessionPersister.- 参数:
directory- The store directory
-
setApplicationTemp
public void setApplicationTemp(@Nullable cn.taketoday.core.ApplicationTemp applicationTemp) Set the app temp provider for this SessionPersister.- 参数:
applicationTemp- The app temp provider
-
remove
Remove the Session with the specified session identifier from this SessionPersister, if present. If no such Session is present, this method takes no action.- 指定者:
remove在接口中SessionPersister- 参数:
id- Session identifier of the Session to be removed- 抛出:
IOException
-
contains
从接口复制的说明:SessionPersistercontains session with given id- 指定者:
contains在接口中SessionPersister
-
clear
Remove all of the Sessions in this Store.- 指定者:
clear在接口中SessionPersister- 抛出:
IOException- if an input/output error occurs
-
keys
Return 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.- 指定者:
keys在接口中SessionPersister- 返回:
- 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 WebSession associated with the specified session identifier from this Store, without removing it. If there is no such stored WebSession, returnnull.- 指定者:
load在接口中SessionPersister- 参数:
id- Session identifier of the session to load- 返回:
- the loaded Session instance
- 抛出:
ClassNotFoundException- if a deserialization error occursIOException- if an input/output error occurs
-
save
Save the specified Session into this Store. Any previously saved information for the associated session identifier is replaced.- 指定者:
save在接口中SessionPersister- 参数:
session- Session to be saved- 抛出:
IOException- if an input/output error occurs
-
directory
Return a File object representing the pathname to our session persistence directory, if any. The directory will be created if it does not already exist. -
sessionFile
Return a File object representing the pathname to our session persistence file, if any.- 参数:
id- The ID of the Session to be retrieved. This is used in the file naming.
-