Class InfinispanAuthenticationSessionProvider
- java.lang.Object
- 
- org.keycloak.models.sessions.infinispan.InfinispanAuthenticationSessionProvider
 
- 
- All Implemented Interfaces:
- Provider,- AuthenticationSessionProvider
 
 public class InfinispanAuthenticationSessionProvider extends Object implements AuthenticationSessionProvider - Author:
- Marek Posolda
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected SessionEventsSenderTransactionclusterEventsSenderTxprotected InfinispanKeycloakTransactiontx
 - 
Constructor SummaryConstructors Constructor Description InfinispanAuthenticationSessionProvider(KeycloakSession session, InfinispanKeyGenerator keyGenerator, org.infinispan.Cache<String,RootAuthenticationSessionEntity> cache, int authSessionsLimit)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()RootAuthenticationSessionModelcreateRootAuthenticationSession(RealmModel realm)Creates and registers a new authentication session with random ID.RootAuthenticationSessionModelcreateRootAuthenticationSession(RealmModel realm, String id)Creates a new root authentication session specified by the provided realm and id.protected StringgenerateTabId()org.infinispan.Cache<String,RootAuthenticationSessionEntity>getCache()RootAuthenticationSessionModelgetRootAuthenticationSession(RealmModel realm, String authenticationSessionId)Returns the root authentication session specified by the provided realm and id.voidonClientRemoved(RealmModel realm, ClientModel client)Removes all associated root authentication sessions to the given realm and client which was removed.protected voidonClientRemovedEvent(String realmId, String clientUuid)voidonRealmRemoved(RealmModel realm)Removes all associated root authentication sessions to the given realm which was removed.protected voidonRealmRemovedEvent(String realmId)voidremoveAllExpired()Remove expired authentication sessions in all the realmsvoidremoveExpired(RealmModel realm)Removes all expired root authentication sessions for the given realm.voidremoveRootAuthenticationSession(RealmModel realm, RootAuthenticationSessionModel authenticationSession)Removes provided root authentication session.voidupdateNonlocalSessionAuthNotes(AuthenticationSessionCompoundId compoundId, Map<String,String> authNotesFragment)Requests update of authNotes of a root authentication session that is not owned by this instance but might exist somewhere in the cluster.
 
- 
- 
- 
Field Detail- 
txprotected final InfinispanKeycloakTransaction tx 
 - 
clusterEventsSenderTxprotected final SessionEventsSenderTransaction clusterEventsSenderTx 
 
- 
 - 
Constructor Detail- 
InfinispanAuthenticationSessionProviderpublic InfinispanAuthenticationSessionProvider(KeycloakSession session, InfinispanKeyGenerator keyGenerator, org.infinispan.Cache<String,RootAuthenticationSessionEntity> cache, int authSessionsLimit) 
 
- 
 - 
Method Detail- 
createRootAuthenticationSessionpublic RootAuthenticationSessionModel createRootAuthenticationSession(RealmModel realm) Description copied from interface:AuthenticationSessionProviderCreates and registers a new authentication session with random ID. Authentication session entity will be prefilled with current timestamp, the given realm and client.- Specified by:
- createRootAuthenticationSessionin interface- AuthenticationSessionProvider
- Parameters:
- realm-- RealmModelCan't be- null.
- Returns:
- Returns created RootAuthenticationSessionModel. Never returnsnull.
 
 - 
createRootAuthenticationSessionpublic RootAuthenticationSessionModel createRootAuthenticationSession(RealmModel realm, String id) Description copied from interface:AuthenticationSessionProviderCreates a new root authentication session specified by the provided realm and id.- Specified by:
- createRootAuthenticationSessionin interface- AuthenticationSessionProvider
- Parameters:
- realm-- RealmModelCan't be- null.
- id-- StringId of newly created root authentication session. If- nulla random id will be generated.
- Returns:
- Returns created RootAuthenticationSessionModel. Never returnsnull.
 
 - 
removeAllExpiredpublic void removeAllExpired() Description copied from interface:AuthenticationSessionProviderRemove expired authentication sessions in all the realms- Specified by:
- removeAllExpiredin interface- AuthenticationSessionProvider
 
 - 
removeExpiredpublic void removeExpired(RealmModel realm) Description copied from interface:AuthenticationSessionProviderRemoves all expired root authentication sessions for the given realm.- Specified by:
- removeExpiredin interface- AuthenticationSessionProvider
- Parameters:
- realm-- RealmModelCan't be- null.
 
 - 
onRealmRemovedpublic void onRealmRemoved(RealmModel realm) Description copied from interface:AuthenticationSessionProviderRemoves all associated root authentication sessions to the given realm which was removed.- Specified by:
- onRealmRemovedin interface- AuthenticationSessionProvider
- Parameters:
- realm-- RealmModelCan't be- null.
 
 - 
onRealmRemovedEventprotected void onRealmRemovedEvent(String realmId) 
 - 
onClientRemovedpublic void onClientRemoved(RealmModel realm, ClientModel client) Description copied from interface:AuthenticationSessionProviderRemoves all associated root authentication sessions to the given realm and client which was removed.- Specified by:
- onClientRemovedin interface- AuthenticationSessionProvider
- Parameters:
- realm-- RealmModelCan't be- null.
- client-- ClientModelCan't be- null.
 
 - 
updateNonlocalSessionAuthNotespublic void updateNonlocalSessionAuthNotes(AuthenticationSessionCompoundId compoundId, Map<String,String> authNotesFragment) Description copied from interface:AuthenticationSessionProviderRequests update of authNotes of a root authentication session that is not owned by this instance but might exist somewhere in the cluster.- Specified by:
- updateNonlocalSessionAuthNotesin interface- AuthenticationSessionProvider
- Parameters:
- compoundId-- AuthenticationSessionCompoundIdThe method has no effect if- null.
- authNotesFragment-- Map<String, String>Map with authNote values. Auth note is removed if the corresponding value in the map is- null. Map itself can't be- null.
 
 - 
getRootAuthenticationSessionpublic RootAuthenticationSessionModel getRootAuthenticationSession(RealmModel realm, String authenticationSessionId) Description copied from interface:AuthenticationSessionProviderReturns the root authentication session specified by the provided realm and id.- Specified by:
- getRootAuthenticationSessionin interface- AuthenticationSessionProvider
- Parameters:
- realm-- RealmModelCan't be- null.
- authenticationSessionId-- RootAuthenticationSessionModelIf- nullthen- nullwill be returned.
- Returns:
- Returns found RootAuthenticationSessionModelornullif no root authentication session is found.
 
 - 
removeRootAuthenticationSessionpublic void removeRootAuthenticationSession(RealmModel realm, RootAuthenticationSessionModel authenticationSession) Description copied from interface:AuthenticationSessionProviderRemoves provided root authentication session.- Specified by:
- removeRootAuthenticationSessionin interface- AuthenticationSessionProvider
- Parameters:
- realm-- RealmModelAssociated realm to the given root authentication session.
- authenticationSession-- RootAuthenticationSessionModelCan't be- null.
 
 - 
getCachepublic org.infinispan.Cache<String,RootAuthenticationSessionEntity> getCache() 
 - 
generateTabIdprotected String generateTabId() 
 
- 
 
-