Enum Class SessionStatus

java.lang.Object
java.lang.Enum<SessionStatus>
com.svenruppert.jsentinel.session.SessionStatus
All Implemented Interfaces:
Serializable, Comparable<SessionStatus>, Constable

@ExperimentalJSentinelApi public enum SessionStatus extends Enum<SessionStatus>
Lifecycle state of a SessionRecord.

Sessions move through this enum in the following typical progression:

 ACTIVE  --(idle / absolute timeout)-->  EXPIRED
 ACTIVE  --(logout / admin revoke)---->  REVOKED
Both terminal states are not deleted from the store immediately; they are kept around until a retention window passes so audit queries can still see them.

Adapters consult isActive() to decide whether a session is admissible for a request. Terminal states never become active again — re-authentication produces a new SessionRecord with a fresh SessionId.

  • Enum Constant Details

    • ACTIVE

      public static final SessionStatus ACTIVE
      Session is open and admissible.
    • EXPIRED

      public static final SessionStatus EXPIRED
      Session was terminated by an idle or absolute timeout.
    • REVOKED

      public static final SessionStatus REVOKED
      Session was terminated explicitly by logout or an admin revoke.
  • Method Details

    • values

      public static SessionStatus[] 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 SessionStatus 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
    • isActive

      public boolean isActive()
      Returns true only for ACTIVE.
      Returns:
      true if the session is admissible