Class AuthenticatedClientSessionUpdater
java.lang.Object
org.keycloak.models.sessions.infinispan.changes.remote.updater.BaseUpdater<ClientSessionKey,RemoteAuthenticatedClientSessionEntity>
org.keycloak.models.sessions.infinispan.changes.remote.updater.client.AuthenticatedClientSessionUpdater
- All Implemented Interfaces:
BiFunction<ClientSessionKey,
,RemoteAuthenticatedClientSessionEntity, RemoteAuthenticatedClientSessionEntity> AuthenticatedClientSessionModel
,Updater<ClientSessionKey,
,RemoteAuthenticatedClientSessionEntity> CommonClientSessionModel
public class AuthenticatedClientSessionUpdater
extends BaseUpdater<ClientSessionKey,RemoteAuthenticatedClientSessionEntity>
implements AuthenticatedClientSessionModel
An
Updater
implementation that keeps track of AuthenticatedClientSessionModel
changes.-
Nested Class Summary
Nested classes/interfaces inherited from class org.keycloak.models.sessions.infinispan.changes.remote.updater.BaseUpdater
BaseUpdater.UpdaterState
Nested classes/interfaces inherited from interface org.keycloak.sessions.CommonClientSessionModel
CommonClientSessionModel.Action, CommonClientSessionModel.ExecutionStatus
-
Field Summary
Fields inherited from interface org.keycloak.models.AuthenticatedClientSessionModel
REFRESH_TOKEN_LAST_REFRESH_PREFIX, REFRESH_TOKEN_PREFIX, REFRESH_TOKEN_USE_PREFIX, STARTED_AT_NOTE, USER_SESSION_REMEMBER_ME_NOTE, USER_SESSION_STARTED_AT_NOTE
Fields inherited from interface org.keycloak.models.sessions.infinispan.changes.remote.updater.Updater
NO_VERSION
-
Method Summary
Modifier and TypeMethodDescriptionapply
(ClientSessionKey uuid, RemoteAuthenticatedClientSessionEntity entity) Computes the expiration data for Infinispan cache.void
Detaches the client session from its user session.getId()
getNotes()
getRealm()
int
int
int
void
initialize
(UserSessionModel userSession, ClientModel client, ClientSessionChangeLogTransaction clientTransaction) Initializes this class with references to other models classes.boolean
boolean
protected boolean
boolean
static UpdaterFactory<ClientSessionKey,
RemoteAuthenticatedClientSessionEntity, AuthenticatedClientSessionUpdater> static UpdaterFactory<ClientSessionKey,
RemoteAuthenticatedClientSessionEntity, AuthenticatedClientSessionUpdater> void
removeNote
(String name) void
void
void
void
setProtocol
(String method) void
setRedirectUri
(String uri) void
setTimestamp
(int timestamp) Set the timestamp for the client session.Methods inherited from class org.keycloak.models.sessions.infinispan.changes.remote.updater.BaseUpdater
equals, getKey, getValue, getVersionRead, hashCode, isCreated, isDeleted, isReadOnly, markDeleted, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.keycloak.models.AuthenticatedClientSessionModel
getCurrentRefreshToken, getCurrentRefreshTokenUseCount, getRefreshToken, getRefreshTokenLastRefresh, getRefreshTokenUseCount, setCurrentRefreshToken, setCurrentRefreshTokenUseCount, setRefreshToken, setRefreshTokenLastRefresh, setRefreshTokenUseCount
Methods inherited from interface java.util.function.BiFunction
andThen
Methods inherited from interface org.keycloak.models.sessions.infinispan.changes.remote.updater.Updater
hasVersion
-
Method Details
-
onlineFactory
public static UpdaterFactory<ClientSessionKey,RemoteAuthenticatedClientSessionEntity, onlineFactory()AuthenticatedClientSessionUpdater> - Returns:
- The
UpdaterFactory
implementation to create online session instances ofAuthenticatedClientSessionUpdater
.
-
offlineFactory
public static UpdaterFactory<ClientSessionKey,RemoteAuthenticatedClientSessionEntity, offlineFactory()AuthenticatedClientSessionUpdater> - Returns:
- The
UpdaterFactory
implementation to create offline session instances ofAuthenticatedClientSessionUpdater
.
-
apply
public RemoteAuthenticatedClientSessionEntity apply(ClientSessionKey uuid, RemoteAuthenticatedClientSessionEntity entity) - Specified by:
apply
in interfaceBiFunction<ClientSessionKey,
RemoteAuthenticatedClientSessionEntity, RemoteAuthenticatedClientSessionEntity>
-
computeExpiration
Description copied from interface:Updater
Computes the expiration data for Infinispan cache.- Specified by:
computeExpiration
in interfaceUpdater<ClientSessionKey,
RemoteAuthenticatedClientSessionEntity> - Returns:
- The
Expiration
data.
-
getId
- Specified by:
getId
in interfaceAuthenticatedClientSessionModel
-
getStarted
public int getStarted()- Specified by:
getStarted
in interfaceAuthenticatedClientSessionModel
-
getUserSessionStarted
public int getUserSessionStarted()- Specified by:
getUserSessionStarted
in interfaceAuthenticatedClientSessionModel
-
isUserSessionRememberMe
public boolean isUserSessionRememberMe()- Specified by:
isUserSessionRememberMe
in interfaceAuthenticatedClientSessionModel
-
getTimestamp
public int getTimestamp()- Specified by:
getTimestamp
in interfaceAuthenticatedClientSessionModel
-
setTimestamp
public void setTimestamp(int timestamp) Description copied from interface:AuthenticatedClientSessionModel
Set the timestamp for the client session. If the timestamp is smaller or equal than the current timestamp, the operation is ignored.- Specified by:
setTimestamp
in interfaceAuthenticatedClientSessionModel
-
detachFromUserSession
public void detachFromUserSession()Description copied from interface:AuthenticatedClientSessionModel
Detaches the client session from its user session.- Specified by:
detachFromUserSession
in interfaceAuthenticatedClientSessionModel
-
getUserSession
- Specified by:
getUserSession
in interfaceAuthenticatedClientSessionModel
-
getNote
- Specified by:
getNote
in interfaceAuthenticatedClientSessionModel
-
setNote
- Specified by:
setNote
in interfaceAuthenticatedClientSessionModel
-
removeNote
- Specified by:
removeNote
in interfaceAuthenticatedClientSessionModel
-
getNotes
- Specified by:
getNotes
in interfaceAuthenticatedClientSessionModel
-
getRedirectUri
- Specified by:
getRedirectUri
in interfaceCommonClientSessionModel
-
setRedirectUri
- Specified by:
setRedirectUri
in interfaceCommonClientSessionModel
-
getRealm
- Specified by:
getRealm
in interfaceCommonClientSessionModel
-
getClient
- Specified by:
getClient
in interfaceCommonClientSessionModel
-
getAction
- Specified by:
getAction
in interfaceCommonClientSessionModel
-
setAction
- Specified by:
setAction
in interfaceCommonClientSessionModel
-
getProtocol
- Specified by:
getProtocol
in interfaceCommonClientSessionModel
-
setProtocol
- Specified by:
setProtocol
in interfaceCommonClientSessionModel
-
restartClientSession
public void restartClientSession()- Specified by:
restartClientSession
in interfaceAuthenticatedClientSessionModel
-
isTransient
public boolean isTransient()- Specified by:
isTransient
in interfaceUpdater<ClientSessionKey,
RemoteAuthenticatedClientSessionEntity> - Returns:
true
if the entity is transient and shouldn't be stored in the Infinispan cache.
-
isUnchanged
protected boolean isUnchanged()- Specified by:
isUnchanged
in classBaseUpdater<ClientSessionKey,
RemoteAuthenticatedClientSessionEntity> - Returns:
true
if the entity was changed after being created/read.
-
initialize
public void initialize(UserSessionModel userSession, ClientModel client, ClientSessionChangeLogTransaction clientTransaction) Initializes this class with references to other models classes.- Parameters:
userSession
- TheUserSessionModel
associated with this client session.client
- TheClientModel
associated with this client session.clientTransaction
- TheClientSessionChangeLogTransaction
to perform the changes in this class into theRemoteCache
.
-
isInitialized
public boolean isInitialized()- Returns:
true
if it is already initialized.
-