Class UserSessionUpdater
java.lang.Object
org.keycloak.models.sessions.infinispan.changes.remote.updater.BaseUpdater<String,RemoteUserSessionEntity>
org.keycloak.models.sessions.infinispan.changes.remote.updater.user.UserSessionUpdater
- All Implemented Interfaces:
BiFunction<String,,RemoteUserSessionEntity, RemoteUserSessionEntity> Updater<String,,RemoteUserSessionEntity> UserSessionModel
public class UserSessionUpdater
extends BaseUpdater<String,RemoteUserSessionEntity>
implements UserSessionModel
The
Updater implementation to keep track of modifications for UserSessionModel.-
Nested Class Summary
Nested classes/interfaces inherited from class org.keycloak.models.sessions.infinispan.changes.remote.updater.BaseUpdater
BaseUpdater.UpdaterStateNested classes/interfaces inherited from interface org.keycloak.models.UserSessionModel
UserSessionModel.SessionPersistenceState, UserSessionModel.State -
Field Summary
Fields inherited from interface org.keycloak.models.sessions.infinispan.changes.remote.updater.Updater
NO_VERSIONFields inherited from interface org.keycloak.models.UserSessionModel
CORRESPONDING_SESSION_ID -
Method Summary
Modifier and TypeMethodDescriptionapply(String ignored, RemoteUserSessionEntity userSessionEntity) Computes the expiration data for Infinispan cache.getAuthenticatedClientSessionByClient(String clientUUID) getId()intgetNotes()getRealm()intgetState()getUser()voidinitialize(UserSessionModel.SessionPersistenceState persistenceState, RealmModel realm, UserModel user, Map<String, AuthenticatedClientSessionModel> clientSessions) Initializes this class with references to other models classes.booleanbooleanbooleanbooleanprotected booleanvoidremoveAuthenticatedClientSessions(Collection<String> removedClientUUIDS) voidremoveNote(String name) voidrestartSession(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId) voidsetLastSessionRefresh(int seconds) voidvoidsetState(UserSessionModel.State state) Methods inherited from class org.keycloak.models.sessions.infinispan.changes.remote.updater.BaseUpdater
equals, getKey, getValue, getVersionRead, hashCode, isCreated, isDeleted, isReadOnly, markDeleted, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThenMethods inherited from interface org.keycloak.models.sessions.infinispan.changes.remote.updater.Updater
hasVersion
-
Method Details
-
onlineFactory
- Returns:
- The
UpdaterFactoryimplementation to create online sessions instances ofUserSessionModel.
-
offlineFactory
- Returns:
- The
UpdaterFactoryimplementation to create offline sessions instances ofUserSessionModel.
-
apply
- Specified by:
applyin interfaceBiFunction<String,RemoteUserSessionEntity, RemoteUserSessionEntity>
-
computeExpiration
Description copied from interface:UpdaterComputes the expiration data for Infinispan cache.- Specified by:
computeExpirationin interfaceUpdater<String,RemoteUserSessionEntity> - Returns:
- The
Expirationdata.
-
getId
- Specified by:
getIdin interfaceUserSessionModel
-
getRealm
- Specified by:
getRealmin interfaceUserSessionModel
-
getBrokerSessionId
- Specified by:
getBrokerSessionIdin interfaceUserSessionModel
-
getBrokerUserId
- Specified by:
getBrokerUserIdin interfaceUserSessionModel
-
getUser
- Specified by:
getUserin interfaceUserSessionModel
-
getLoginUsername
- Specified by:
getLoginUsernamein interfaceUserSessionModel
-
getIpAddress
- Specified by:
getIpAddressin interfaceUserSessionModel
-
getAuthMethod
- Specified by:
getAuthMethodin interfaceUserSessionModel
-
isRememberMe
public boolean isRememberMe()- Specified by:
isRememberMein interfaceUserSessionModel
-
getStarted
public int getStarted()- Specified by:
getStartedin interfaceUserSessionModel
-
getLastSessionRefresh
public int getLastSessionRefresh()- Specified by:
getLastSessionRefreshin interfaceUserSessionModel
-
setLastSessionRefresh
public void setLastSessionRefresh(int seconds) - Specified by:
setLastSessionRefreshin interfaceUserSessionModel
-
isOffline
public boolean isOffline()- Specified by:
isOfflinein interfaceUserSessionModel
-
getAuthenticatedClientSessions
- Specified by:
getAuthenticatedClientSessionsin interfaceUserSessionModel
-
removeAuthenticatedClientSessions
- Specified by:
removeAuthenticatedClientSessionsin interfaceUserSessionModel
-
getAuthenticatedClientSessionByClient
- Specified by:
getAuthenticatedClientSessionByClientin interfaceUserSessionModel
-
getNote
- Specified by:
getNotein interfaceUserSessionModel
-
setNote
- Specified by:
setNotein interfaceUserSessionModel
-
removeNote
- Specified by:
removeNotein interfaceUserSessionModel
-
getNotes
- Specified by:
getNotesin interfaceUserSessionModel
-
getState
- Specified by:
getStatein interfaceUserSessionModel
-
setState
- Specified by:
setStatein interfaceUserSessionModel
-
restartSession
public void restartSession(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId) - Specified by:
restartSessionin interfaceUserSessionModel
-
getPersistenceState
- Specified by:
getPersistenceStatein interfaceUserSessionModel
-
isTransient
public boolean isTransient()- Specified by:
isTransientin interfaceUpdater<String,RemoteUserSessionEntity> - Overrides:
isTransientin classBaseUpdater<String,RemoteUserSessionEntity> - Returns:
trueif the entity is transient and shouldn't be stored in the Infinispan cache.
-
isUnchanged
protected boolean isUnchanged()- Specified by:
isUnchangedin classBaseUpdater<String,RemoteUserSessionEntity> - Returns:
trueif the entity was changed after being created/read.
-
initialize
public void initialize(UserSessionModel.SessionPersistenceState persistenceState, RealmModel realm, UserModel user, Map<String, AuthenticatedClientSessionModel> clientSessions) Initializes this class with references to other models classes.- Parameters:
persistenceState- TheUserSessionModel.SessionPersistenceState.realm- TheRealmModelto where this user session belongs.user- TheUserModelassociated to this user session.clientSessions- TheMapassociated to this use session.
-
isInitialized
public boolean isInitialized()- Returns:
trueif it is already initialized.
-