public class RealmCacheSession extends Object implements CacheRealmProvider
Modifier and Type | Field and Description |
---|---|
protected RealmCacheManager |
cache |
protected boolean |
clearAll |
protected ClientProvider |
clientDelegate |
protected ClientScopeProvider |
clientScopeDelegate |
protected GroupProvider |
groupDelegate |
protected Set<InvalidationEvent> |
invalidationEvents |
protected Set<String> |
invalidations |
protected Set<String> |
listInvalidations |
protected static org.jboss.logging.Logger |
logger |
protected Map<String,ClientModel> |
managedApplications |
protected Map<String,ClientScopeAdapter> |
managedClientScopes |
protected Map<String,GroupAdapter> |
managedGroups |
protected Map<String,RealmAdapter> |
managedRealms |
protected Map<String,RoleAdapter> |
managedRoles |
static String |
REALM_CLIENTS_QUERY_SUFFIX |
protected RealmProvider |
realmDelegate |
protected RoleProvider |
roleDelegate |
static String |
ROLES_QUERY_SUFFIX |
protected KeycloakSession |
session |
protected boolean |
setRollbackOnly |
protected long |
startupRevision |
protected boolean |
transactionActive |
Constructor and Description |
---|
RealmCacheSession(RealmCacheManager cache,
KeycloakSession session) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addClientRole, addClientRole, createGroup, createGroup, createGroup, decreaseRemainingCount, getAlwaysDisplayInConsoleClients, getClientByClientId, getClientById, getClientRole, getClientRoles, getClientRoles, getClients, getClients, getClientScopeById, getGroupById, getGroups, getGroupsByRole, getRealmRoles, getRealmRoles, getRealms, getRealmsWithProviderType, getRoleById, getTopLevelGroups, getTopLevelGroups, listClientInitialAccess, removeClient, removeRole, searchClientsByClientId, searchForClientRoles, searchForGroupByName, searchForRoles
getGroupsStream, getGroupsStream
protected static final org.jboss.logging.Logger logger
public static final String REALM_CLIENTS_QUERY_SUFFIX
public static final String ROLES_QUERY_SUFFIX
protected RealmCacheManager cache
protected KeycloakSession session
protected RealmProvider realmDelegate
protected ClientProvider clientDelegate
protected ClientScopeProvider clientScopeDelegate
protected GroupProvider groupDelegate
protected RoleProvider roleDelegate
protected boolean transactionActive
protected boolean setRollbackOnly
protected Map<String,RealmAdapter> managedRealms
protected Map<String,ClientModel> managedApplications
protected Map<String,ClientScopeAdapter> managedClientScopes
protected Map<String,RoleAdapter> managedRoles
protected Map<String,GroupAdapter> managedGroups
protected Set<InvalidationEvent> invalidationEvents
protected boolean clearAll
protected final long startupRevision
public RealmCacheSession(RealmCacheManager cache, KeycloakSession session)
public long getStartupRevision()
public boolean isInvalid(String id)
public void clear()
clear
in interface CacheRealmProvider
public RealmProvider getRealmDelegate()
getRealmDelegate
in interface CacheRealmProvider
public ClientProvider getClientDelegate()
public ClientScopeProvider getClientScopeDelegate()
public RoleProvider getRoleDelegate()
public GroupProvider getGroupDelegate()
public void registerRealmInvalidation(String id, String name)
registerRealmInvalidation
in interface CacheRealmProvider
public void registerClientInvalidation(String id, String clientId, String realmId)
registerClientInvalidation
in interface CacheRealmProvider
public void registerClientScopeInvalidation(String id, String realmId)
registerClientScopeInvalidation
in interface CacheRealmProvider
public void registerRoleInvalidation(String id, String roleName, String roleContainerId)
registerRoleInvalidation
in interface CacheRealmProvider
public void registerGroupInvalidation(String id)
registerGroupInvalidation
in interface CacheRealmProvider
protected void runInvalidations()
public RealmModel createRealm(String name)
createRealm
in interface RealmProvider
public RealmModel createRealm(String id, String name)
createRealm
in interface RealmProvider
public RealmModel getRealm(String id)
getRealm
in interface RealmProvider
public RealmModel getRealmByName(String name)
getRealmByName
in interface RealmProvider
public Stream<RealmModel> getRealmsWithProviderTypeStream(Class<?> type)
getRealmsWithProviderTypeStream
in interface RealmProvider
public Stream<RealmModel> getRealmsStream()
getRealmsStream
in interface RealmProvider
public boolean removeRealm(String id)
removeRealm
in interface RealmProvider
public void evictRealmOnRemoval(RealmModel realm)
public ClientModel addClient(RealmModel realm, String clientId)
addClient
in interface ClientProvider
addClient
in interface RealmProvider
public ClientModel addClient(RealmModel realm, String id, String clientId)
addClient
in interface ClientProvider
addClient
in interface RealmProvider
public Stream<ClientModel> getClientsStream(RealmModel realm, Integer firstResult, Integer maxResults)
getClientsStream
in interface ClientProvider
public Stream<ClientModel> getClientsStream(RealmModel realm)
getClientsStream
in interface ClientProvider
public Stream<ClientModel> getAlwaysDisplayInConsoleClientsStream(RealmModel realm)
getAlwaysDisplayInConsoleClientsStream
in interface ClientProvider
public Map<ClientModel,Set<String>> getAllRedirectUrisOfEnabledClients(RealmModel realm)
getAllRedirectUrisOfEnabledClients
in interface ClientProvider
public void removeClients(RealmModel realm)
removeClients
in interface ClientProvider
public boolean removeClient(RealmModel realm, String id)
removeClient
in interface ClientProvider
public RoleModel addRealmRole(RealmModel realm, String name)
addRealmRole
in interface RealmProvider
addRealmRole
in interface RoleProvider
public RoleModel addRealmRole(RealmModel realm, String id, String name)
addRealmRole
in interface RealmProvider
addRealmRole
in interface RoleProvider
public Stream<RoleModel> getRealmRolesStream(RealmModel realm)
getRealmRolesStream
in interface RoleProvider
public Stream<RoleModel> getClientRolesStream(ClientModel client)
getClientRolesStream
in interface RoleProvider
public Stream<RoleModel> getRealmRolesStream(RealmModel realm, Integer first, Integer max)
getRealmRolesStream
in interface RoleProvider
public Stream<RoleModel> getClientRolesStream(ClientModel client, Integer first, Integer max)
getClientRolesStream
in interface RoleProvider
public Stream<RoleModel> searchForClientRolesStream(ClientModel client, String search, Integer first, Integer max)
searchForClientRolesStream
in interface RoleLookupProvider
public Stream<RoleModel> searchForRolesStream(RealmModel realm, String search, Integer first, Integer max)
searchForRolesStream
in interface RoleLookupProvider
public RoleModel addClientRole(ClientModel client, String name)
addClientRole
in interface RoleProvider
public RoleModel addClientRole(ClientModel client, String id, String name)
addClientRole
in interface RoleProvider
public RoleModel getRealmRole(RealmModel realm, String name)
getRealmRole
in interface RealmProvider
getRealmRole
in interface RoleLookupProvider
public RoleModel getClientRole(ClientModel client, String name)
getClientRole
in interface RoleLookupProvider
public boolean removeRole(RoleModel role)
removeRole
in interface RoleProvider
public void removeRoles(RealmModel realm)
removeRoles
in interface RoleProvider
public void removeRoles(ClientModel client)
removeRoles
in interface RoleProvider
public RoleModel getRoleById(RealmModel realm, String id)
getRoleById
in interface RoleLookupProvider
public GroupModel getGroupById(RealmModel realm, String id)
getGroupById
in interface RealmProvider
getGroupById
in interface GroupLookupProvider
public void moveGroup(RealmModel realm, GroupModel group, GroupModel toParent)
moveGroup
in interface GroupProvider
moveGroup
in interface RealmProvider
public Stream<GroupModel> getGroupsStream(RealmModel realm)
getGroupsStream
in interface GroupProvider
public Stream<GroupModel> getGroupsStream(RealmModel realm, Stream<String> ids, String search, Integer first, Integer max)
getGroupsStream
in interface GroupProvider
public Long getGroupsCount(RealmModel realm, Stream<String> ids, String search)
getGroupsCount
in interface GroupProvider
public Long getGroupsCount(RealmModel realm, Boolean onlyTopGroups)
getGroupsCount
in interface GroupProvider
getGroupsCount
in interface RealmProvider
public long getClientsCount(RealmModel realm)
getClientsCount
in interface ClientProvider
getClientsCount
in interface RealmProvider
public Long getGroupsCountByNameContaining(RealmModel realm, String search)
getGroupsCountByNameContaining
in interface GroupProvider
getGroupsCountByNameContaining
in interface RealmProvider
public Stream<GroupModel> getGroupsByRoleStream(RealmModel realm, RoleModel role, Integer firstResult, Integer maxResults)
getGroupsByRoleStream
in interface GroupProvider
public Stream<GroupModel> getTopLevelGroupsStream(RealmModel realm)
getTopLevelGroupsStream
in interface GroupProvider
public Stream<GroupModel> getTopLevelGroupsStream(RealmModel realm, Integer first, Integer max)
getTopLevelGroupsStream
in interface GroupProvider
public Stream<GroupModel> searchForGroupByNameStream(RealmModel realm, String search, Integer first, Integer max)
searchForGroupByNameStream
in interface GroupLookupProvider
public boolean removeGroup(RealmModel realm, GroupModel group)
removeGroup
in interface GroupProvider
removeGroup
in interface RealmProvider
public GroupModel createGroup(RealmModel realm, String id, String name, GroupModel toParent)
createGroup
in interface GroupProvider
createGroup
in interface RealmProvider
public void addTopLevelGroup(RealmModel realm, GroupModel subGroup)
addTopLevelGroup
in interface GroupProvider
addTopLevelGroup
in interface RealmProvider
public ClientModel getClientById(RealmModel realm, String id)
getClientById
in interface ClientLookupProvider
protected ClientModel cacheClient(RealmModel realm, ClientModel delegate, Long revision)
protected ClientModel validateCache(RealmModel realm, CachedClient cached)
public Stream<ClientModel> searchClientsByClientIdStream(RealmModel realm, String clientId, Integer firstResult, Integer maxResults)
searchClientsByClientIdStream
in interface ClientLookupProvider
public Stream<ClientModel> searchClientsByAttributes(RealmModel realm, Map<String,String> attributes, Integer firstResult, Integer maxResults)
searchClientsByAttributes
in interface ClientLookupProvider
public ClientModel getClientByClientId(RealmModel realm, String clientId)
getClientByClientId
in interface ClientLookupProvider
public ClientScopeModel getClientScopeById(RealmModel realm, String id)
getClientScopeById
in interface RealmProvider
getClientScopeById
in interface ClientScopeLookupProvider
public Stream<ClientScopeModel> getClientScopesStream(RealmModel realm)
getClientScopesStream
in interface ClientScopeProvider
public ClientScopeModel addClientScope(RealmModel realm, String name)
addClientScope
in interface ClientScopeProvider
public ClientScopeModel addClientScope(RealmModel realm, String id, String name)
addClientScope
in interface ClientScopeProvider
public boolean removeClientScope(RealmModel realm, String id)
removeClientScope
in interface ClientScopeProvider
public void removeClientScopes(RealmModel realm)
removeClientScopes
in interface ClientScopeProvider
public void addClientScopes(RealmModel realm, ClientModel client, Set<ClientScopeModel> clientScopes, boolean defaultScope)
addClientScopes
in interface ClientProvider
public void removeClientScope(RealmModel realm, ClientModel client, ClientScopeModel clientScope)
removeClientScope
in interface ClientProvider
public Map<String,ClientScopeModel> getClientScopes(RealmModel realm, ClientModel client, boolean defaultScopes)
getClientScopes
in interface ClientLookupProvider
public ClientInitialAccessModel createClientInitialAccessModel(RealmModel realm, int expiration, int count)
createClientInitialAccessModel
in interface RealmProvider
public ClientInitialAccessModel getClientInitialAccessModel(RealmModel realm, String id)
getClientInitialAccessModel
in interface RealmProvider
public void removeClientInitialAccessModel(RealmModel realm, String id)
removeClientInitialAccessModel
in interface RealmProvider
public Stream<ClientInitialAccessModel> listClientInitialAccessStream(RealmModel realm)
listClientInitialAccessStream
in interface RealmProvider
public void removeExpiredClientInitialAccess()
removeExpiredClientInitialAccess
in interface RealmProvider
public void saveLocalizationText(RealmModel realm, String locale, String key, String text)
saveLocalizationText
in interface RealmProvider
public void saveLocalizationTexts(RealmModel realm, String locale, Map<String,String> localizationTexts)
saveLocalizationTexts
in interface RealmProvider
public boolean updateLocalizationText(RealmModel realm, String locale, String key, String text)
updateLocalizationText
in interface RealmProvider
public boolean deleteLocalizationTextsByLocale(RealmModel realm, String locale)
deleteLocalizationTextsByLocale
in interface RealmProvider
public boolean deleteLocalizationText(RealmModel realm, String locale, String key)
deleteLocalizationText
in interface RealmProvider
public String getLocalizationTextsById(RealmModel realm, String locale, String key)
getLocalizationTextsById
in interface RealmProvider
Copyright © 2021 JBoss by Red Hat. All rights reserved.