Record Class AbstractSessionManager.RequestedSession

java.lang.Object
java.lang.Record
org.eclipse.jetty.session.AbstractSessionManager.RequestedSession
Record Components:
session - The Session associated with the ID, which may have been invalidated or changed ID since the request was received; or null if no session existed matching the requested ID.
sessionId - The requested session ID.
sessionIdFrom - A String representing the source of the session ID. Common values include: ID_FROM_COOKIE or ID_FROM_URI_PARAMETER if there is no ID.
Enclosing class:
AbstractSessionManager

public static record AbstractSessionManager.RequestedSession(ManagedSession session, String sessionId, String sessionIdFrom) extends Record
Details of the requested session. Session implementations should make an instance of this record available as a hidden (not in name set) request attribute for the name "org.eclipse.jetty.session.AbstractSessionManager$RequestedSession"
  • Field Details

  • Constructor Details

    • RequestedSession

      public RequestedSession(ManagedSession session, String sessionId, String sessionIdFrom)
      Creates an instance of a RequestedSession record class.
      Parameters:
      session - the value for the session record component
      sessionId - the value for the sessionId record component
      sessionIdFrom - the value for the sessionIdFrom record component
  • Method Details

    • byAttribute

      public static AbstractSessionManager.RequestedSession byAttribute(Attributes request)
      Get the RequestedSession by attribute
      Parameters:
      request - The attributes to query
      Returns:
      The found RequestedSession or NO_REQUESTED_SESSION if none found. Never null.
    • isApplicableAttribute

      public static boolean isApplicableAttribute(String name)
      Parameters:
      name - An attribute name
      Returns:
      true if the attribute name is applicable to a requested session.
      See Also:
    • getAttribute

      public Object getAttribute(String name)
      Get attributes asssociated with this requested session:
      • `org.eclipse.jetty.session.RequestedSession` this instance.
      • `org.eclipse.jetty.session.RequestedSession.session` the session().
      • `org.eclipse.jetty.session.RequestedSession.sessionId` the sessionId().
      • `org.eclipse.jetty.session.RequestedSession.sessionIdFrom` the sessionIdFrom().
      Parameters:
      name - An attributed name
      Returns:
      the attribute value or null
    • isSessionIdFrom

      public boolean isSessionIdFrom(String source)
      Test if this RequestedSession ID is from a particular session source
      Parameters:
      source - A String representing the source of the session ID. Common values include: ID_FROM_COOKIE or ID_FROM_URI_PARAMETER if there is no ID.
      Returns:
      True iff this RequestedSession ID is from the source.
    • 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.
    • session

      public ManagedSession session()
      Returns the value of the session record component.
      Returns:
      the value of the session record component
    • sessionId

      public String sessionId()
      Returns the value of the sessionId record component.
      Returns:
      the value of the sessionId record component
    • sessionIdFrom

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