Class RootAuthenticationSessionUpdater
java.lang.Object
org.keycloak.models.sessions.infinispan.changes.remote.updater.BaseUpdater<String,RootAuthenticationSessionEntity>
org.keycloak.models.sessions.infinispan.changes.remote.updater.authsession.RootAuthenticationSessionUpdater
- All Implemented Interfaces:
BiFunction<String,
,RootAuthenticationSessionEntity, RootAuthenticationSessionEntity> Updater<String,
,RootAuthenticationSessionEntity> RootAuthenticationSessionModel
public class RootAuthenticationSessionUpdater
extends BaseUpdater<String,RootAuthenticationSessionEntity>
implements RootAuthenticationSessionModel
-
Nested Class Summary
Nested classes/interfaces inherited from class org.keycloak.models.sessions.infinispan.changes.remote.updater.BaseUpdater
BaseUpdater.UpdaterState
-
Field Summary
Fields inherited from interface org.keycloak.models.sessions.infinispan.changes.remote.updater.Updater
NO_VERSION
-
Method Summary
Modifier and TypeMethodDescriptionapply
(String ignored, RootAuthenticationSessionEntity cachedEntity) Computes the expiration data for Infinispan cache.create
(String key, RootAuthenticationSessionEntity entity) Create a new authentication session and returns it.getAuthenticationSession
(ClientModel client, String tabId) Returns an authentication session for the particular client and tab or null if it doesn't yet exists.Returns authentication sessions for the root authentication session.getId()
Returns id of the root authentication session.getRealm()
Returns realm associated to the root authentication session.int
Returns timestamp when the root authentication session was created or updated.void
initialize
(KeycloakSession session, RealmModel realm, int authSessionsLimit) boolean
protected boolean
void
Removes the authentication session specified by tab id from the root authentication session.void
restartSession
(RealmModel realm) Will completely restart whole state of authentication session.void
setTimestamp
(int timestamp) Sets a timestamp when the root authentication session was created or updated.wrap
(String key, RootAuthenticationSessionEntity value, long version) Methods inherited from class org.keycloak.models.sessions.infinispan.changes.remote.updater.BaseUpdater
equals, getKey, getValue, getVersionRead, hashCode, isCreated, isDeleted, isReadOnly, isTransient, markDeleted, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
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
-
initialize
-
isInitialized
public boolean isInitialized()- Returns:
true
if it is already initialized.
-
isUnchanged
protected boolean isUnchanged()- Specified by:
isUnchanged
in classBaseUpdater<String,
RootAuthenticationSessionEntity> - Returns:
true
if the entity was changed after being created/read.
-
create
public static RootAuthenticationSessionUpdater create(String key, RootAuthenticationSessionEntity entity) -
wrap
public static RootAuthenticationSessionUpdater wrap(String key, RootAuthenticationSessionEntity value, long version) -
delete
-
computeExpiration
Description copied from interface:Updater
Computes the expiration data for Infinispan cache.- Specified by:
computeExpiration
in interfaceUpdater<String,
RootAuthenticationSessionEntity> - Returns:
- The
Expiration
data.
-
apply
public RootAuthenticationSessionEntity apply(String ignored, RootAuthenticationSessionEntity cachedEntity) - Specified by:
apply
in interfaceBiFunction<String,
RootAuthenticationSessionEntity, RootAuthenticationSessionEntity>
-
getId
Description copied from interface:RootAuthenticationSessionModel
Returns id of the root authentication session.- Specified by:
getId
in interfaceRootAuthenticationSessionModel
- Returns:
String
-
getRealm
Description copied from interface:RootAuthenticationSessionModel
Returns realm associated to the root authentication session.- Specified by:
getRealm
in interfaceRootAuthenticationSessionModel
- Returns:
RealmModel
-
getTimestamp
public int getTimestamp()Description copied from interface:RootAuthenticationSessionModel
Returns timestamp when the root authentication session was created or updated.- Specified by:
getTimestamp
in interfaceRootAuthenticationSessionModel
- Returns:
int
-
setTimestamp
public void setTimestamp(int timestamp) Description copied from interface:RootAuthenticationSessionModel
Sets a timestamp when the root authentication session was created or updated. It also updates the expiration time for the root authentication session entity.- Specified by:
setTimestamp
in interfaceRootAuthenticationSessionModel
- Parameters:
timestamp
-int
-
getAuthenticationSessions
Description copied from interface:RootAuthenticationSessionModel
Returns authentication sessions for the root authentication session. Key is tabId, Value is AuthenticationSessionModel.- Specified by:
getAuthenticationSessions
in interfaceRootAuthenticationSessionModel
- Returns:
Map<String, AuthenticationSessionModel>
authentication sessions or empty map if no authentication sessions are present. Never return null.
-
getAuthenticationSession
Description copied from interface:RootAuthenticationSessionModel
Returns an authentication session for the particular client and tab or null if it doesn't yet exists.- Specified by:
getAuthenticationSession
in interfaceRootAuthenticationSessionModel
- Parameters:
client
-ClientModel
Ifnull
is provided the method will returnnull
.tabId
-String
Ifnull
is provided the method will returnnull
.- Returns:
AuthenticationSessionModel
ornull
in no authentication session is found.
-
createAuthenticationSession
Description copied from interface:RootAuthenticationSessionModel
Create a new authentication session and returns it.- Specified by:
createAuthenticationSession
in interfaceRootAuthenticationSessionModel
- Parameters:
client
-ClientModel
Can't benull
.- Returns:
AuthenticationSessionModel
non-null fresh authentication session. Never returnsnull
.
-
removeAuthenticationSessionByTabId
Description copied from interface:RootAuthenticationSessionModel
Removes the authentication session specified by tab id from the root authentication session. If there's no child authentication session left in the root authentication session, it's removed as well.- Specified by:
removeAuthenticationSessionByTabId
in interfaceRootAuthenticationSessionModel
- Parameters:
tabId
-String
Can't benull
.
-
restartSession
Description copied from interface:RootAuthenticationSessionModel
Will completely restart whole state of authentication session. It will just keep same ID. It will setup it with provided realm.- Specified by:
restartSession
in interfaceRootAuthenticationSessionModel
- Parameters:
realm
-RealmModel
Associated realm to the root authentication session.
-