类 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
  • 字段详细资料

    • SESSION_TEMP_DIR

      private static final String SESSION_TEMP_DIR
    • timeout

      @Nullable @DurationUnit(SECONDS) private Duration timeout
      session timout
    • trackingModes

      @Nullable private Set<SessionTrackingMode> trackingModes
    • persistent

      private boolean persistent
      Whether to persist session data between restarts.
    • storeDir

      @Nullable private File storeDir
      Directory used to store session data.
    • sessionIdLength

      private int sessionIdLength
      Session Id length
    • maxSessions

      private 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 an IllegalStateException.

      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 an IllegalStateException.

      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

      @Nullable public Duration getTimeout()
    • setTimeout

      public void setTimeout(@Nullable Duration timeout)
    • getTrackingModes

      @Nullable public Set<SessionTrackingMode> getTrackingModes()
      返回:
      the session tracking modes
    • setTrackingModes

      public void setTrackingModes(@Nullable Set<SessionTrackingMode> trackingModes)
    • isPersistent

      public boolean isPersistent()
      Return whether to persist session data between restarts.
      返回:
      true to persist session data between restarts.
    • setPersistent

      public void setPersistent(boolean persistent)
    • getStoreDir

      @Nullable public File getStoreDir()
      Return the directory used to store session data.
      返回:
      the session data store directory
    • setStoreDir

      public void setStoreDir(@Nullable File storeDir)
    • getCookie

      public CookieProperties getCookie()
    • getValidStoreDir

      public File getValidStoreDir(@Nullable cn.taketoday.core.ApplicationTemp applicationTemp)
    • getValidStoreDir

      public File getValidStoreDir(@Nullable cn.taketoday.core.ApplicationTemp applicationTemp, boolean mkdirs)
    • getValidStoreDir

      public static File getValidStoreDir(@Nullable cn.taketoday.core.ApplicationTemp applicationTemp, @Nullable File dir, boolean mkdirs)
    • assertDirectory

      private static void assertDirectory(boolean mkdirs, File dir)