类 SessionProperties
java.lang.Object
cn.taketoday.session.config.SessionProperties
@ConfigurationProperties(prefix="server.session",
ignoreUnknownFields=true)
public class SessionProperties
extends Object
Session properties.
- 从以下版本开始:
- 4.0
- 作者:
- Andy Wilkinson, Harry Yang
-
字段概要
字段修饰符和类型字段说明private final CookiePropertiesSession cookie configprivate intSet the maximum number of sessions that can be stored.private booleanWhether to persist session data between restarts.private static final Stringprivate intSession Id lengthprivate FileDirectory used to store session data.private Durationsession timoutprivate Set<SessionTrackingMode> -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private static voidassertDirectory(boolean mkdirs, File dir) intReturn the maximum number of sessions that can be stored.intReturn the directory used to store session data.Return thesession tracking modes.getValidStoreDir(cn.taketoday.core.ApplicationTemp applicationTemp) getValidStoreDir(cn.taketoday.core.ApplicationTemp applicationTemp, boolean mkdirs) static FilegetValidStoreDir(cn.taketoday.core.ApplicationTemp applicationTemp, File dir, boolean mkdirs) booleanReturn whether to persist session data between restarts.voidsetMaxSessions(int maxSessions) Set the maximum number of sessions that can be stored.voidsetPersistent(boolean persistent) voidsetSessionIdLength(int sessionIdLength) voidsetStoreDir(File storeDir) voidsetTimeout(Duration timeout) voidsetTrackingModes(Set<SessionTrackingMode> trackingModes)
-
字段详细资料
-
SESSION_TEMP_DIR
-
timeout
session timout -
trackingModes
-
persistent
private boolean persistentWhether to persist session data between restarts. -
storeDir
Directory used to store session data. -
cookie
Session cookie config -
sessionIdLength
private int sessionIdLengthSession Id length -
maxSessions
private int maxSessionsSet the maximum number of sessions that can be stored. Once the limit is reached, any attempt to store an additional session will result in anIllegalStateException.By default set to 10000.
-
-
构造器详细资料
-
SessionProperties
public SessionProperties()
-
-
方法详细资料
-
setMaxSessions
public void setMaxSessions(int maxSessions) Set the maximum number of sessions that can be stored. Once the limit is reached, any attempt to store an additional session will result in anIllegalStateException.By default set to 10000.
- 参数:
maxSessions- the maximum number of sessions
-
getMaxSessions
public int getMaxSessions()Return the maximum number of sessions that can be stored. -
setSessionIdLength
public void setSessionIdLength(int sessionIdLength) -
getSessionIdLength
public int getSessionIdLength() -
getTimeout
-
setTimeout
-
getTrackingModes
Return thesession tracking modes.- 返回:
- the session tracking modes
-
setTrackingModes
-
isPersistent
public boolean isPersistent()Return whether to persist session data between restarts.- 返回:
trueto persist session data between restarts.
-
setPersistent
public void setPersistent(boolean persistent) -
getStoreDir
Return the directory used to store session data.- 返回:
- the session data store directory
-
setStoreDir
-
getCookie
-
getValidStoreDir
-
getValidStoreDir
public File getValidStoreDir(@Nullable cn.taketoday.core.ApplicationTemp applicationTemp, boolean mkdirs) -
getValidStoreDir
-
assertDirectory
-