public class DisabledUserSessionPersisterProvider extends Object implements UserSessionPersisterProviderFactory, UserSessionPersisterProvider
Constructor and Description |
---|
DisabledUserSessionPersisterProvider() |
Modifier and Type | Method and Description |
---|---|
void |
close()
This is called when the server shuts down.
|
UserSessionPersisterProvider |
create(KeycloakSession session) |
void |
createClientSession(AuthenticatedClientSessionModel clientSession,
boolean offline) |
void |
createUserSession(UserSessionModel userSession,
boolean offline) |
String |
getId() |
int |
getUserSessionsCount(boolean offline)
Retrieves the count of user sessions for all realms.
|
int |
getUserSessionsCount(RealmModel realm,
ClientModel clientModel,
boolean offline)
Retrieves the count of user client-sessions for the given client
|
Map<String,Long> |
getUserSessionsCountsByClients(RealmModel realm,
boolean offline)
Returns a
Map containing the number of user-sessions aggregated by client id for the given realm. |
void |
init(Config.Scope config)
Only called once when the factory is first created.
|
UserSessionModel |
loadUserSession(RealmModel realm,
String userSessionId,
boolean offline)
Loads the user session with the given userSessionId.
|
Stream<UserSessionModel> |
loadUserSessionsStream(Integer firstResult,
Integer maxResults,
boolean offline,
String lastUserSessionId)
Called during startup.
|
Stream<UserSessionModel> |
loadUserSessionsStream(RealmModel realm,
ClientModel client,
boolean offline,
Integer firstResult,
Integer maxResults)
Loads the user sessions for the given
ClientModel in the given RealmModel if present. |
Stream<UserSessionModel> |
loadUserSessionsStream(RealmModel realm,
UserModel user,
boolean offline,
Integer firstResult,
Integer maxResults)
Loads the user sessions for the given
UserModel in the given RealmModel if present. |
void |
onClientRemoved(RealmModel realm,
ClientModel client) |
void |
onRealmRemoved(RealmModel realm) |
void |
onUserRemoved(RealmModel realm,
UserModel user) |
void |
postInit(KeycloakSessionFactory factory)
Called after all provider factories have been initialized
|
void |
removeClientSession(String userSessionId,
String clientUUID,
boolean offline) |
void |
removeExpired(RealmModel realm) |
void |
removeUserSession(String userSessionId,
boolean offline) |
void |
updateLastSessionRefreshes(RealmModel realm,
int lastSessionRefresh,
Collection<String> userSessionIds,
boolean offline) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
order
loadUserSessions
public static final String ID
public DisabledUserSessionPersisterProvider()
public UserSessionPersisterProvider create(KeycloakSession session)
create
in interface ProviderFactory<UserSessionPersisterProvider>
public void init(Config.Scope config)
ProviderFactory
init
in interface ProviderFactory<UserSessionPersisterProvider>
public void postInit(KeycloakSessionFactory factory)
ProviderFactory
postInit
in interface ProviderFactory<UserSessionPersisterProvider>
public void close()
ProviderFactory
close
in interface Provider
close
in interface ProviderFactory<UserSessionPersisterProvider>
public String getId()
getId
in interface ProviderFactory<UserSessionPersisterProvider>
public void createUserSession(UserSessionModel userSession, boolean offline)
createUserSession
in interface UserSessionPersisterProvider
public void createClientSession(AuthenticatedClientSessionModel clientSession, boolean offline)
createClientSession
in interface UserSessionPersisterProvider
public void removeUserSession(String userSessionId, boolean offline)
removeUserSession
in interface UserSessionPersisterProvider
public void removeClientSession(String userSessionId, String clientUUID, boolean offline)
removeClientSession
in interface UserSessionPersisterProvider
public void onRealmRemoved(RealmModel realm)
onRealmRemoved
in interface UserSessionPersisterProvider
public void onClientRemoved(RealmModel realm, ClientModel client)
onClientRemoved
in interface UserSessionPersisterProvider
public void onUserRemoved(RealmModel realm, UserModel user)
onUserRemoved
in interface UserSessionPersisterProvider
public void updateLastSessionRefreshes(RealmModel realm, int lastSessionRefresh, Collection<String> userSessionIds, boolean offline)
updateLastSessionRefreshes
in interface UserSessionPersisterProvider
public void removeExpired(RealmModel realm)
removeExpired
in interface UserSessionPersisterProvider
public UserSessionModel loadUserSession(RealmModel realm, String userSessionId, boolean offline)
UserSessionPersisterProvider
loadUserSession
in interface UserSessionPersisterProvider
public Stream<UserSessionModel> loadUserSessionsStream(RealmModel realm, ClientModel client, boolean offline, Integer firstResult, Integer maxResults)
UserSessionPersisterProvider
ClientModel
in the given RealmModel
if present.loadUserSessionsStream
in interface UserSessionPersisterProvider
public Stream<UserSessionModel> loadUserSessionsStream(RealmModel realm, UserModel user, boolean offline, Integer firstResult, Integer maxResults)
UserSessionPersisterProvider
UserModel
in the given RealmModel
if present.loadUserSessionsStream
in interface UserSessionPersisterProvider
public Stream<UserSessionModel> loadUserSessionsStream(Integer firstResult, Integer maxResults, boolean offline, String lastUserSessionId)
UserSessionPersisterProvider
loadUserSessionsStream
in interface UserSessionPersisterProvider
firstResult
- Integer
Index of the first desired user session. Ignored if negative or null
.maxResults
- Integer
Maximum number of returned user sessions. Ignored if negative or null
.offline
- boolean
Flag to include offline sessions.lastUserSessionId
- String
Id of the user session. It will return only user sessions with id's lexicographically greater than this.
it will compare the id in dictionary order and takes only those created later.UserSessionModel
. Never returns null
.public int getUserSessionsCount(boolean offline)
UserSessionPersisterProvider
getUserSessionsCount
in interface UserSessionPersisterProvider
public int getUserSessionsCount(RealmModel realm, ClientModel clientModel, boolean offline)
UserSessionPersisterProvider
getUserSessionsCount
in interface UserSessionPersisterProvider
public Map<String,Long> getUserSessionsCountsByClients(RealmModel realm, boolean offline)
UserSessionPersisterProvider
Map
containing the number of user-sessions aggregated by client id for the given realm.getUserSessionsCountsByClients
in interface UserSessionPersisterProvider
Map
with clientId as key and session count as valueCopyright © 2021 JBoss by Red Hat. All rights reserved.