Enum Class SaveMode

java.lang.Object
java.lang.Enum<SaveMode>
org.springframework.session.SaveMode
All Implemented Interfaces:
Serializable, Comparable<SaveMode>, Constable

public enum SaveMode extends Enum<SaveMode>
Supported modes of tracking and saving session changes to session store.
Since:
2.2.0
  • Enum Constant Details

    • ON_SET_ATTRIBUTE

      public static final SaveMode ON_SET_ATTRIBUTE
      Save only changes made to session, for instance using Session.setAttribute(String, Object). In highly concurrent environments, this mode minimizes the risk of attributes being overwritten during processing of parallel requests.
    • ON_GET_ATTRIBUTE

      public static final SaveMode ON_GET_ATTRIBUTE
      Same as ON_SET_ATTRIBUTE with addition of saving attributes that have been read using Session.getAttribute(String).
    • ALWAYS

      public static final SaveMode ALWAYS
      Always save all session attributes, regardless of the interaction with the session. In highly concurrent environments, this mode increases the risk of attributes being overwritten during processing of parallel requests.
  • Method Details

    • values

      public static SaveMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SaveMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null