public class InfinispanUserSessionProvider extends Object implements UserSessionProvider
| Constructor and Description |
|---|
InfinispanUserSessionProvider(KeycloakSession session,
RemoteCacheInvoker remoteCacheInvoker,
CrossDCLastSessionRefreshStore lastSessionRefreshStore,
CrossDCLastSessionRefreshStore offlineLastSessionRefreshStore,
PersisterLastSessionRefreshStore persisterLastSessionRefreshStore,
InfinispanKeyGenerator keyGenerator,
org.infinispan.Cache<String,SessionEntityWrapper<UserSessionEntity>> sessionCache,
org.infinispan.Cache<String,SessionEntityWrapper<UserSessionEntity>> offlineSessionCache,
org.infinispan.Cache<UUID,SessionEntityWrapper<AuthenticatedClientSessionEntity>> clientSessionCache,
org.infinispan.Cache<UUID,SessionEntityWrapper<AuthenticatedClientSessionEntity>> offlineClientSessionCache,
org.infinispan.Cache<LoginFailureKey,SessionEntityWrapper<LoginFailureEntity>> loginFailureCache) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetOfflineUserSessionByBrokerUserId, getOfflineUserSessions, getOfflineUserSessions, getUserSessionByBrokerUserId, getUserSessions, getUserSessions, getUserSessionsprotected final KeycloakSession session
protected final org.infinispan.Cache<String,SessionEntityWrapper<UserSessionEntity>> sessionCache
protected final org.infinispan.Cache<String,SessionEntityWrapper<UserSessionEntity>> offlineSessionCache
protected final org.infinispan.Cache<UUID,SessionEntityWrapper<AuthenticatedClientSessionEntity>> clientSessionCache
protected final org.infinispan.Cache<UUID,SessionEntityWrapper<AuthenticatedClientSessionEntity>> offlineClientSessionCache
protected final org.infinispan.Cache<LoginFailureKey,SessionEntityWrapper<LoginFailureEntity>> loginFailureCache
protected final InfinispanChangelogBasedTransaction<String,UserSessionEntity> sessionTx
protected final InfinispanChangelogBasedTransaction<String,UserSessionEntity> offlineSessionTx
protected final InfinispanChangelogBasedTransaction<UUID,AuthenticatedClientSessionEntity> clientSessionTx
protected final InfinispanChangelogBasedTransaction<UUID,AuthenticatedClientSessionEntity> offlineClientSessionTx
protected final InfinispanChangelogBasedTransaction<LoginFailureKey,LoginFailureEntity> loginFailuresTx
protected final SessionEventsSenderTransaction clusterEventsSenderTx
protected final CrossDCLastSessionRefreshStore lastSessionRefreshStore
protected final CrossDCLastSessionRefreshStore offlineLastSessionRefreshStore
protected final PersisterLastSessionRefreshStore persisterLastSessionRefreshStore
protected final RemoteCacheInvoker remoteCacheInvoker
protected final InfinispanKeyGenerator keyGenerator
public InfinispanUserSessionProvider(KeycloakSession session, RemoteCacheInvoker remoteCacheInvoker, CrossDCLastSessionRefreshStore lastSessionRefreshStore, CrossDCLastSessionRefreshStore offlineLastSessionRefreshStore, PersisterLastSessionRefreshStore persisterLastSessionRefreshStore, InfinispanKeyGenerator keyGenerator, org.infinispan.Cache<String,SessionEntityWrapper<UserSessionEntity>> sessionCache, org.infinispan.Cache<String,SessionEntityWrapper<UserSessionEntity>> offlineSessionCache, org.infinispan.Cache<UUID,SessionEntityWrapper<AuthenticatedClientSessionEntity>> clientSessionCache, org.infinispan.Cache<UUID,SessionEntityWrapper<AuthenticatedClientSessionEntity>> offlineClientSessionCache, org.infinispan.Cache<LoginFailureKey,SessionEntityWrapper<LoginFailureEntity>> loginFailureCache)
protected org.infinispan.Cache<String,SessionEntityWrapper<UserSessionEntity>> getCache(boolean offline)
protected InfinispanChangelogBasedTransaction<String,UserSessionEntity> getTransaction(boolean offline)
protected org.infinispan.Cache<UUID,SessionEntityWrapper<AuthenticatedClientSessionEntity>> getClientSessionCache(boolean offline)
protected InfinispanChangelogBasedTransaction<UUID,AuthenticatedClientSessionEntity> getClientSessionTransaction(boolean offline)
protected CrossDCLastSessionRefreshStore getLastSessionRefreshStore()
protected CrossDCLastSessionRefreshStore getOfflineLastSessionRefreshStore()
protected PersisterLastSessionRefreshStore getPersisterLastSessionRefreshStore()
public AuthenticatedClientSessionModel createClientSession(RealmModel realm, ClientModel client, UserSessionModel userSession)
createClientSession in interface UserSessionProviderpublic UserSessionModel createUserSession(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId)
createUserSession in interface UserSessionProviderpublic UserSessionModel createUserSession(String id, RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId, UserSessionModel.SessionPersistenceState persistenceState)
createUserSession in interface UserSessionProviderpublic UserSessionModel getUserSession(RealmModel realm, String id)
getUserSession in interface UserSessionProviderprotected UserSessionAdapter getUserSession(RealmModel realm, String id, boolean offline)
protected Stream<UserSessionModel> getUserSessionsStream(RealmModel realm, Predicate<Map.Entry<String,SessionEntityWrapper<UserSessionEntity>>> predicate, boolean offline)
public AuthenticatedClientSessionAdapter getClientSession(UserSessionModel userSession, ClientModel client, UUID clientSessionId, boolean offline)
getClientSession in interface UserSessionProviderpublic Stream<UserSessionModel> getUserSessionsStream(RealmModel realm, UserModel user)
getUserSessionsStream in interface UserSessionProviderpublic Stream<UserSessionModel> getUserSessionByBrokerUserIdStream(RealmModel realm, String brokerUserId)
getUserSessionByBrokerUserIdStream in interface UserSessionProviderpublic UserSessionModel getUserSessionByBrokerSessionId(RealmModel realm, String brokerSessionId)
getUserSessionByBrokerSessionId in interface UserSessionProviderpublic Stream<UserSessionModel> getUserSessionsStream(RealmModel realm, ClientModel client)
getUserSessionsStream in interface UserSessionProviderpublic Stream<UserSessionModel> getUserSessionsStream(RealmModel realm, ClientModel client, int firstResult, int maxResults)
getUserSessionsStream in interface UserSessionProviderprotected Stream<UserSessionModel> getUserSessionsStream(RealmModel realm, ClientModel client, int firstResult, int maxResults, boolean offline)
protected Stream<UserSessionModel> getUserSessionModels(RealmModel realm, int firstResult, int maxResults, boolean offline, UserSessionPredicate predicate)
public UserSessionModel getUserSessionWithPredicate(RealmModel realm, String id, boolean offline, Predicate<UserSessionModel> predicate)
getUserSessionWithPredicate in interface UserSessionProviderpublic long getActiveUserSessions(RealmModel realm, ClientModel client)
getActiveUserSessions in interface UserSessionProviderpublic Map<String,Long> getActiveClientSessionStats(RealmModel realm, boolean offline)
getActiveClientSessionStats in interface UserSessionProviderprotected long getUserSessionsCount(RealmModel realm, ClientModel client, boolean offline)
public void removeUserSession(RealmModel realm, UserSessionModel session)
removeUserSession in interface UserSessionProviderpublic void removeUserSessions(RealmModel realm, UserModel user)
removeUserSessions in interface UserSessionProviderprotected void removeUserSessions(RealmModel realm, UserModel user, boolean offline)
public void removeExpired(RealmModel realm)
removeExpired in interface UserSessionProviderpublic void removeUserSessions(RealmModel realm)
removeUserSessions in interface UserSessionProviderprotected void onRemoveUserSessionsEvent(String realmId)
public UserLoginFailureModel getUserLoginFailure(RealmModel realm, String userId)
getUserLoginFailure in interface UserSessionProviderpublic UserLoginFailureModel addUserLoginFailure(RealmModel realm, String userId)
addUserLoginFailure in interface UserSessionProviderpublic void removeUserLoginFailure(RealmModel realm, String userId)
removeUserLoginFailure in interface UserSessionProviderpublic void removeAllUserLoginFailures(RealmModel realm)
removeAllUserLoginFailures in interface UserSessionProviderprotected void onRemoveAllUserLoginFailuresEvent(String realmId)
public void onRealmRemoved(RealmModel realm)
onRealmRemoved in interface UserSessionProviderprotected void onRealmRemovedEvent(String realmId)
public void onClientRemoved(RealmModel realm, ClientModel client)
onClientRemoved in interface UserSessionProviderprotected void onUserRemoved(RealmModel realm, UserModel user)
public void close()
close in interface UserSessionProviderclose in interface Providerprotected void removeUserSession(UserSessionEntity sessionEntity, boolean offline)
public UserSessionModel createOfflineUserSession(UserSessionModel userSession)
createOfflineUserSession in interface UserSessionProviderpublic UserSessionAdapter getOfflineUserSession(RealmModel realm, String userSessionId)
getOfflineUserSession in interface UserSessionProviderpublic UserSessionModel getOfflineUserSessionByBrokerSessionId(RealmModel realm, String brokerSessionId)
getOfflineUserSessionByBrokerSessionId in interface UserSessionProviderpublic Stream<UserSessionModel> getOfflineUserSessionByBrokerUserIdStream(RealmModel realm, String brokerUserId)
getOfflineUserSessionByBrokerUserIdStream in interface UserSessionProviderpublic void removeOfflineUserSession(RealmModel realm, UserSessionModel userSession)
removeOfflineUserSession in interface UserSessionProviderpublic AuthenticatedClientSessionModel createOfflineClientSession(AuthenticatedClientSessionModel clientSession, UserSessionModel offlineUserSession)
createOfflineClientSession in interface UserSessionProviderpublic Stream<UserSessionModel> getOfflineUserSessionsStream(RealmModel realm, UserModel user)
getOfflineUserSessionsStream in interface UserSessionProviderpublic long getOfflineSessionsCount(RealmModel realm, ClientModel client)
getOfflineSessionsCount in interface UserSessionProviderpublic Stream<UserSessionModel> getOfflineUserSessionsStream(RealmModel realm, ClientModel client, int first, int max)
getOfflineUserSessionsStream in interface UserSessionProviderpublic void importUserSessions(Collection<UserSessionModel> persistentUserSessions, boolean offline)
importUserSessions in interface UserSessionProviderprotected UserSessionAdapter importUserSession(UserSessionModel userSession, boolean offline)
Copyright © 2021 JBoss by Red Hat. All rights reserved.