Record Class SessionDecision.Invalidate

java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.session.SessionDecision.Invalidate
Record Components:
reason - short, generic reason (safe for logs)
loginRoute - target route to forward to after invalidation (ignored when returned from onLogin)
All Implemented Interfaces:
SessionDecision
Enclosing interface:
SessionDecision

public static record SessionDecision.Invalidate(String reason, String loginRoute) extends Record implements SessionDecision
The session must be invalidated. Interpretation depends on the lifecycle hook that returned the decision:
  • From SessionPolicy.beforeNavigation(SessionContext) — the session is expired/destroyed; drop the subject, invalidate the session, forward to loginRoute.
  • From SessionPolicy.onLogin(SessionContext) — session-fixation rotation: rotate the session id (e.g. via VaadinService.reinitializeSession(...)), preserve the just-bound subject, and continue to the original post-login navigation target. loginRoute is ignored in this context.
  • Constructor Details

    • Invalidate

      public Invalidate(String reason, String loginRoute)
      Creates an instance of a Invalidate record class.
      Parameters:
      reason - the value for the reason record component
      loginRoute - the value for the loginRoute record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • reason

      public String reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component
    • loginRoute

      public String loginRoute()
      Returns the value of the loginRoute record component.
      Returns:
      the value of the loginRoute record component