Record Class SessionMetadata
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.session.SessionMetadata
- Record Components:
subjectId- stable identifier of the authenticated subject; non-null, non-blankcreatedAt- when the session was first establishedlastActivityAt- most recent observed activity in the session
public record SessionMetadata(String subjectId, Instant createdAt, Instant lastActivityAt)
extends Record
Adapter-neutral query input for
SessionPolicy.evaluate(SessionMetadata).
Compared to SessionContext, this record carries only the
three fields needed for the lifetime check: subjectId,
createdAt, and lastActivityAt. The Vaadin and REST
adapters build it from their respective runtime types.
-
Constructor Summary
ConstructorsConstructorDescriptionSessionMetadata(String subjectId, Instant createdAt, Instant lastActivityAt) Creates an instance of aSessionMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecreatedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelastActivityAtrecord component.Returns the value of thesubjectIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SessionMetadata
Creates an instance of aSessionMetadatarecord class.- Parameters:
subjectId- the value for thesubjectIdrecord componentcreatedAt- the value for thecreatedAtrecord componentlastActivityAt- the value for thelastActivityAtrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
subjectId
-
createdAt
-
lastActivityAt
Returns the value of thelastActivityAtrecord component.- Returns:
- the value of the
lastActivityAtrecord component
-