Record Class SessionExpirationPredicates
java.lang.Object
java.lang.Record
org.keycloak.models.sessions.infinispan.util.SessionExpirationPredicates
- Record Components:
realm- TheRealmModelto fetch the max-idle and lifespan settings.offline- Indicates whether the sessions are offline.currentTime- The current time value.
public record SessionExpirationPredicates(RealmModel realm, boolean offline, int currentTime)
extends Record
Utility record to check if a user or client session is expired. It handles all the current entities, from JPA or from
caching.
-
Constructor Summary
ConstructorsConstructorDescriptionSessionExpirationPredicates(RealmModel realm, boolean offline, int currentTime) Creates an instance of aSessionExpirationPredicatesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecurrentTimerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanbooleanisClientSessionExpired(AuthenticatedClientSessionEntity entity, boolean rememberMe, ClientModel client) booleanisClientSessionExpired(RemoteAuthenticatedClientSessionEntity entity, int userSessionStarted, boolean rememberMe, ClientModel client) booleanbooleanbooleanbooleanoffline()Returns the value of theofflinerecord component.realm()Returns the value of therealmrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SessionExpirationPredicates
Creates an instance of aSessionExpirationPredicatesrecord class.- Parameters:
realm- the value for therealmrecord componentoffline- the value for theofflinerecord componentcurrentTime- the value for thecurrentTimerecord component
-
-
Method Details
-
isUserSessionExpired
-
isUserSessionExpired
-
isUserSessionExpired
-
isClientSessionExpired
-
isClientSessionExpired
public boolean isClientSessionExpired(AuthenticatedClientSessionEntity entity, boolean rememberMe, ClientModel client) -
isClientSessionExpired
public boolean isClientSessionExpired(RemoteAuthenticatedClientSessionEntity entity, int userSessionStarted, boolean rememberMe, ClientModel client) -
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. -
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. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
realm
Returns the value of therealmrecord component.- Returns:
- the value of the
realmrecord component
-
offline
public boolean offline()Returns the value of theofflinerecord component.- Returns:
- the value of the
offlinerecord component
-
currentTime
public int currentTime()Returns the value of thecurrentTimerecord component.- Returns:
- the value of the
currentTimerecord component
-