Class RealmCacheSession

java.lang.Object
org.keycloak.models.cache.infinispan.RealmCacheSession
All Implemented Interfaces:
org.keycloak.models.cache.CacheRealmProvider, org.keycloak.models.ClientProvider, org.keycloak.models.ClientScopeProvider, org.keycloak.models.GroupProvider, org.keycloak.models.RealmProvider, org.keycloak.models.RoleProvider, org.keycloak.provider.Provider, org.keycloak.storage.client.ClientLookupProvider, org.keycloak.storage.clientscope.ClientScopeLookupProvider, org.keycloak.storage.group.GroupLookupProvider, org.keycloak.storage.role.RoleLookupProvider

public class RealmCacheSession extends Object implements org.keycloak.models.cache.CacheRealmProvider
- the high level architecture of this cache is an invalidation cache. - the cache is manual/custom versioned. When a model is updated, we remove it from the cache which causes an invalidation message to be sent across the cluster. - We had to do it this way because Infinispan REPEATABLE_READ wouldn't cut it in invalidation mode. Also, REPEATABLE_READ doesn't work very well on relationships and items that are not in the cache. - There are two Infinispan caches. One clustered that holds actual objects and a another local one that holds revision numbers of cached objects. Whenever a cached object is removed (invalidated), the local revision cache number or that key is bumped higher based on a local version counter. Whenever a cache entry is fetched, this revision number is also fetched and compared against the revision number in the cache entry to see if the cache entry is stale. Whenever a cache entry is added, this revision number is also checked against the revision cache. - Revision entries are actually never removed (although they could be evicted by cache eviction policies). The reason for this is that it is possible for a stale object to be inserted if one thread loads and the data is updated in the database before it is added to the cache. So, we keep the version number around for this. - In a transaction, objects are registered to be invalidated. If an object is marked for invalidation within a transaction a cached object should never be returned. An DB adapter should always be returned. - After DB commits, the objects marked for invalidation are invalidated, or rather removed from the cache. At this time the revision cache entry for this object has its version number bumped. - Whenever an object is marked for invalidation, the cache is also searched for any objects that are related to this object and need to also be evicted/removed. We use the Infinispan Stream SPI for this. ClientList caches: - lists of clients are cached in a specific cache entry i.e. realm clients, find client by clientId - realm client lists need to be invalidated and evited whenever a client is added or removed from a realm. RealmProvider now has addClient/removeClient at its top level. All adapters should use these methods so that the appropriate invalidations can be registered. - whenever a client is added/removed the realm of the client is added to a listInvalidations set this set must be checked before sending back or caching a cached query. This check is required to avoid caching an uncommitted removal/add in a query cache. - when a client is removed, any queries that contain that client must also be removed. - a client removal will also cause anything that is contained and cached within that client to be removed Clustered caches: - There is a Infinispan @Listener registered. If an invalidation event happens, this is treated like the object was removed from the database and will perform evictions based on that assumption. - Eviction events will also cascade other evictions, but not assume this is a db removal. - With an invalidation cache, if you remove an entry on node 1 and this entry does not exist on node 2, node 2 will not receive a @Listener invalidation event. so, hat we have to put a marker entry in the invalidation cache before we read from the DB, so if the DB changes in between reading and adding a cache entry, the cache will be notified and bump the version information. DBs with Repeatable Read: - DBs like MySQL are Repeatable Read by default. So, if you query a Client for instance, it will always return the same result in the same transaction even if the DB was updated in between these queries. This makes it possible to store stale cache entries. To avoid this problem, this class stores the current local version counter at the beginning of the transaction. Whenever an entry is added to the cache, the current counter is compared against the counter at the beginning of the tx. If the current is greater, then don't cache. Groups and Roles: - roles are tricky because of composites. Composite lists are cached too. So, when a role is removed we also iterate and invalidate any role or group that contains that role being removed. - any relationship should be resolved from session.realms(). For example if JPA.getClientByClientId() is invoked, JPA should find the id of the client and then call session.realms().getClientById(). THis is to ensure that the cached object is invoked and all proper invalidation are being invoked.
Version:
$Revision: 1 $
Author:
Bill Burke
  • Field Details

    • logger

      protected static final org.jboss.logging.Logger logger
    • REALM_CLIENTS_QUERY_SUFFIX

      public static final String REALM_CLIENTS_QUERY_SUFFIX
      See Also:
    • ROLES_QUERY_SUFFIX

      public static final String ROLES_QUERY_SUFFIX
      See Also:
    • cache

      protected RealmCacheManager cache
    • session

      protected org.keycloak.models.KeycloakSession session
    • realmDelegate

      protected org.keycloak.models.RealmProvider realmDelegate
    • clientDelegate

      protected org.keycloak.models.ClientProvider clientDelegate
    • clientScopeDelegate

      protected org.keycloak.models.ClientScopeProvider clientScopeDelegate
    • groupDelegate

      protected org.keycloak.models.GroupProvider groupDelegate
    • roleDelegate

      protected org.keycloak.models.RoleProvider roleDelegate
    • transactionActive

      protected boolean transactionActive
    • setRollbackOnly

      protected boolean setRollbackOnly
    • managedRealms

      protected Map<String,RealmAdapter> managedRealms
    • managedApplications

      protected Map<String,org.keycloak.models.ClientModel> managedApplications
    • managedClientScopes

      protected Map<String,ClientScopeAdapter> managedClientScopes
    • managedRoles

      protected Map<String,RoleAdapter> managedRoles
    • managedGroups

      protected Map<String,GroupAdapter> managedGroups
    • listInvalidations

      protected Set<String> listInvalidations
    • invalidations

      protected Set<String> invalidations
    • invalidationEvents

      protected Set<InvalidationEvent> invalidationEvents
    • startupRevision

      protected final long startupRevision
  • Constructor Details

    • RealmCacheSession

      public RealmCacheSession(RealmCacheManager cache, org.keycloak.models.KeycloakSession session)
  • Method Details

    • clear

      public void clear()
      Specified by:
      clear in interface org.keycloak.models.cache.CacheRealmProvider
    • getRealmDelegate

      public org.keycloak.models.RealmProvider getRealmDelegate()
      Specified by:
      getRealmDelegate in interface org.keycloak.models.cache.CacheRealmProvider
    • getClientDelegate

      public org.keycloak.models.ClientProvider getClientDelegate()
    • getClientScopeDelegate

      public org.keycloak.models.ClientScopeProvider getClientScopeDelegate()
    • getRoleDelegate

      public org.keycloak.models.RoleProvider getRoleDelegate()
    • getGroupDelegate

      public org.keycloak.models.GroupProvider getGroupDelegate()
    • isInvalid

      public boolean isInvalid(String key)
    • getCache

      public RealmCacheManager getCache()
    • getStartupRevision

      public long getStartupRevision()
    • registerInvalidation

      public void registerInvalidation(String id)
      Specified by:
      registerInvalidation in interface org.keycloak.models.cache.CacheRealmProvider
    • registerRealmInvalidation

      public void registerRealmInvalidation(String id, String name)
      Specified by:
      registerRealmInvalidation in interface org.keycloak.models.cache.CacheRealmProvider
    • registerClientInvalidation

      public void registerClientInvalidation(String id, String clientId, String realmId)
      Specified by:
      registerClientInvalidation in interface org.keycloak.models.cache.CacheRealmProvider
    • registerClientScopeInvalidation

      public void registerClientScopeInvalidation(String id, String realmId)
      Specified by:
      registerClientScopeInvalidation in interface org.keycloak.models.cache.CacheRealmProvider
    • registerRoleInvalidation

      public void registerRoleInvalidation(String id, String roleName, String roleContainerId)
      Specified by:
      registerRoleInvalidation in interface org.keycloak.models.cache.CacheRealmProvider
    • registerGroupInvalidation

      public void registerGroupInvalidation(String id)
      Specified by:
      registerGroupInvalidation in interface org.keycloak.models.cache.CacheRealmProvider
    • runInvalidations

      protected void runInvalidations()
    • createRealm

      public org.keycloak.models.RealmModel createRealm(String name)
      Specified by:
      createRealm in interface org.keycloak.models.RealmProvider
    • createRealm

      public org.keycloak.models.RealmModel createRealm(String id, String name)
      Specified by:
      createRealm in interface org.keycloak.models.RealmProvider
    • getRealm

      public org.keycloak.models.RealmModel getRealm(String id)
      Specified by:
      getRealm in interface org.keycloak.models.RealmProvider
    • getRealmByName

      public org.keycloak.models.RealmModel getRealmByName(String name)
      Specified by:
      getRealmByName in interface org.keycloak.models.RealmProvider
    • getRealmsWithProviderTypeStream

      public Stream<org.keycloak.models.RealmModel> getRealmsWithProviderTypeStream(Class<?> type)
      Specified by:
      getRealmsWithProviderTypeStream in interface org.keycloak.models.RealmProvider
    • getRealmsStream

      public Stream<org.keycloak.models.RealmModel> getRealmsStream()
      Specified by:
      getRealmsStream in interface org.keycloak.models.RealmProvider
    • getRealmsStream

      public Stream<org.keycloak.models.RealmModel> getRealmsStream(String search)
      Specified by:
      getRealmsStream in interface org.keycloak.models.RealmProvider
    • removeRealm

      public boolean removeRealm(String id)
      Specified by:
      removeRealm in interface org.keycloak.models.RealmProvider
    • evictRealmOnRemoval

      public void evictRealmOnRemoval(org.keycloak.models.RealmModel realm)
    • addClient

      public org.keycloak.models.ClientModel addClient(org.keycloak.models.RealmModel realm, String clientId)
      Specified by:
      addClient in interface org.keycloak.models.ClientProvider
    • addClient

      public org.keycloak.models.ClientModel addClient(org.keycloak.models.RealmModel realm, String id, String clientId)
      Specified by:
      addClient in interface org.keycloak.models.ClientProvider
    • getClientsStream

      public Stream<org.keycloak.models.ClientModel> getClientsStream(org.keycloak.models.RealmModel realm, Integer firstResult, Integer maxResults)
      Specified by:
      getClientsStream in interface org.keycloak.models.ClientProvider
    • getClientsStream

      public Stream<org.keycloak.models.ClientModel> getClientsStream(org.keycloak.models.RealmModel realm)
      Specified by:
      getClientsStream in interface org.keycloak.models.ClientProvider
    • getAlwaysDisplayInConsoleClientsStream

      public Stream<org.keycloak.models.ClientModel> getAlwaysDisplayInConsoleClientsStream(org.keycloak.models.RealmModel realm)
      Specified by:
      getAlwaysDisplayInConsoleClientsStream in interface org.keycloak.models.ClientProvider
    • getAllRedirectUrisOfEnabledClients

      public Map<org.keycloak.models.ClientModel,Set<String>> getAllRedirectUrisOfEnabledClients(org.keycloak.models.RealmModel realm)
      Specified by:
      getAllRedirectUrisOfEnabledClients in interface org.keycloak.models.ClientProvider
    • removeClients

      public void removeClients(org.keycloak.models.RealmModel realm)
      Specified by:
      removeClients in interface org.keycloak.models.ClientProvider
    • removeClient

      public boolean removeClient(org.keycloak.models.RealmModel realm, String id)
      Specified by:
      removeClient in interface org.keycloak.models.ClientProvider
    • close

      public void close()
      Specified by:
      close in interface org.keycloak.provider.Provider
    • addRealmRole

      public org.keycloak.models.RoleModel addRealmRole(org.keycloak.models.RealmModel realm, String name)
      Specified by:
      addRealmRole in interface org.keycloak.models.RoleProvider
    • addRealmRole

      public org.keycloak.models.RoleModel addRealmRole(org.keycloak.models.RealmModel realm, String id, String name)
      Specified by:
      addRealmRole in interface org.keycloak.models.RoleProvider
    • getRealmRolesStream

      public Stream<org.keycloak.models.RoleModel> getRealmRolesStream(org.keycloak.models.RealmModel realm)
      Specified by:
      getRealmRolesStream in interface org.keycloak.models.RoleProvider
    • getClientRolesStream

      public Stream<org.keycloak.models.RoleModel> getClientRolesStream(org.keycloak.models.ClientModel client)
      Specified by:
      getClientRolesStream in interface org.keycloak.models.RoleProvider
    • getRealmRolesStream

      public Stream<org.keycloak.models.RoleModel> getRealmRolesStream(org.keycloak.models.RealmModel realm, Integer first, Integer max)
      Specified by:
      getRealmRolesStream in interface org.keycloak.models.RoleProvider
    • getRolesStream

      public Stream<org.keycloak.models.RoleModel> getRolesStream(org.keycloak.models.RealmModel realm, Stream<String> ids, String search, Integer first, Integer max)
      Specified by:
      getRolesStream in interface org.keycloak.models.RoleProvider
    • getClientRolesStream

      public Stream<org.keycloak.models.RoleModel> getClientRolesStream(org.keycloak.models.ClientModel client, Integer first, Integer max)
      Specified by:
      getClientRolesStream in interface org.keycloak.models.RoleProvider
    • searchForClientRolesStream

      public Stream<org.keycloak.models.RoleModel> searchForClientRolesStream(org.keycloak.models.ClientModel client, String search, Integer first, Integer max)
      Specified by:
      searchForClientRolesStream in interface org.keycloak.storage.role.RoleLookupProvider
    • searchForClientRolesStream

      public Stream<org.keycloak.models.RoleModel> searchForClientRolesStream(org.keycloak.models.RealmModel realm, Stream<String> ids, String search, Integer first, Integer max)
      Specified by:
      searchForClientRolesStream in interface org.keycloak.storage.role.RoleLookupProvider
    • searchForClientRolesStream

      public Stream<org.keycloak.models.RoleModel> searchForClientRolesStream(org.keycloak.models.RealmModel realm, String search, Stream<String> excludedIds, Integer first, Integer max)
      Specified by:
      searchForClientRolesStream in interface org.keycloak.storage.role.RoleLookupProvider
    • searchForRolesStream

      public Stream<org.keycloak.models.RoleModel> searchForRolesStream(org.keycloak.models.RealmModel realm, String search, Integer first, Integer max)
      Specified by:
      searchForRolesStream in interface org.keycloak.storage.role.RoleLookupProvider
    • addClientRole

      public org.keycloak.models.RoleModel addClientRole(org.keycloak.models.ClientModel client, String name)
      Specified by:
      addClientRole in interface org.keycloak.models.RoleProvider
    • addClientRole

      public org.keycloak.models.RoleModel addClientRole(org.keycloak.models.ClientModel client, String id, String name)
      Specified by:
      addClientRole in interface org.keycloak.models.RoleProvider
    • getRealmRole

      public org.keycloak.models.RoleModel getRealmRole(org.keycloak.models.RealmModel realm, String name)
      Specified by:
      getRealmRole in interface org.keycloak.storage.role.RoleLookupProvider
    • getClientRole

      public org.keycloak.models.RoleModel getClientRole(org.keycloak.models.ClientModel client, String name)
      Specified by:
      getClientRole in interface org.keycloak.storage.role.RoleLookupProvider
    • removeRole

      public boolean removeRole(org.keycloak.models.RoleModel role)
      Specified by:
      removeRole in interface org.keycloak.models.RoleProvider
    • removeRoles

      public void removeRoles(org.keycloak.models.RealmModel realm)
      Specified by:
      removeRoles in interface org.keycloak.models.RoleProvider
    • removeRoles

      public void removeRoles(org.keycloak.models.ClientModel client)
      Specified by:
      removeRoles in interface org.keycloak.models.RoleProvider
    • getRoleById

      public org.keycloak.models.RoleModel getRoleById(org.keycloak.models.RealmModel realm, String id)
      Specified by:
      getRoleById in interface org.keycloak.storage.role.RoleLookupProvider
    • getCachedRole

      protected CachedRole getCachedRole(org.keycloak.models.RealmModel realm, String id)
    • getGroupById

      public org.keycloak.models.GroupModel getGroupById(org.keycloak.models.RealmModel realm, String id)
      Specified by:
      getGroupById in interface org.keycloak.storage.group.GroupLookupProvider
    • getGroupByName

      public org.keycloak.models.GroupModel getGroupByName(org.keycloak.models.RealmModel realm, org.keycloak.models.GroupModel parent, String name)
      Specified by:
      getGroupByName in interface org.keycloak.storage.group.GroupLookupProvider
    • moveGroup

      public void moveGroup(org.keycloak.models.RealmModel realm, org.keycloak.models.GroupModel group, org.keycloak.models.GroupModel toParent)
      Specified by:
      moveGroup in interface org.keycloak.models.GroupProvider
    • getGroupsStream

      public Stream<org.keycloak.models.GroupModel> getGroupsStream(org.keycloak.models.RealmModel realm)
      Specified by:
      getGroupsStream in interface org.keycloak.models.GroupProvider
    • getGroupsStream

      public Stream<org.keycloak.models.GroupModel> getGroupsStream(org.keycloak.models.RealmModel realm, Stream<String> ids, String search, Integer first, Integer max)
      Specified by:
      getGroupsStream in interface org.keycloak.models.GroupProvider
    • getGroupsCount

      public Long getGroupsCount(org.keycloak.models.RealmModel realm, Stream<String> ids, String search)
      Specified by:
      getGroupsCount in interface org.keycloak.models.GroupProvider
    • getGroupsCount

      public Long getGroupsCount(org.keycloak.models.RealmModel realm, Boolean onlyTopGroups)
      Specified by:
      getGroupsCount in interface org.keycloak.models.GroupProvider
    • getClientsCount

      public long getClientsCount(org.keycloak.models.RealmModel realm)
      Specified by:
      getClientsCount in interface org.keycloak.models.ClientProvider
    • getGroupsCountByNameContaining

      public Long getGroupsCountByNameContaining(org.keycloak.models.RealmModel realm, String search)
      Specified by:
      getGroupsCountByNameContaining in interface org.keycloak.models.GroupProvider
    • getGroupsByRoleStream

      public Stream<org.keycloak.models.GroupModel> getGroupsByRoleStream(org.keycloak.models.RealmModel realm, org.keycloak.models.RoleModel role, Integer firstResult, Integer maxResults)
      Specified by:
      getGroupsByRoleStream in interface org.keycloak.models.GroupProvider
    • getTopLevelGroupsStream

      public Stream<org.keycloak.models.GroupModel> getTopLevelGroupsStream(org.keycloak.models.RealmModel realm, String search, Boolean exact, Integer first, Integer max)
      Specified by:
      getTopLevelGroupsStream in interface org.keycloak.models.GroupProvider
    • searchForGroupByNameStream

      public Stream<org.keycloak.models.GroupModel> searchForGroupByNameStream(org.keycloak.models.RealmModel realm, String search, Integer first, Integer max)
      Specified by:
      searchForGroupByNameStream in interface org.keycloak.storage.group.GroupLookupProvider
    • searchForGroupByNameStream

      public Stream<org.keycloak.models.GroupModel> searchForGroupByNameStream(org.keycloak.models.RealmModel realm, String search, Boolean exact, Integer firstResult, Integer maxResults)
      Specified by:
      searchForGroupByNameStream in interface org.keycloak.storage.group.GroupLookupProvider
    • searchGroupsByAttributes

      public Stream<org.keycloak.models.GroupModel> searchGroupsByAttributes(org.keycloak.models.RealmModel realm, Map<String,String> attributes, Integer firstResult, Integer maxResults)
      Specified by:
      searchGroupsByAttributes in interface org.keycloak.storage.group.GroupLookupProvider
    • removeGroup

      public boolean removeGroup(org.keycloak.models.RealmModel realm, org.keycloak.models.GroupModel group)
      Specified by:
      removeGroup in interface org.keycloak.models.GroupProvider
    • createGroup

      public org.keycloak.models.GroupModel createGroup(org.keycloak.models.RealmModel realm, String id, org.keycloak.models.GroupModel.Type type, String name, org.keycloak.models.GroupModel toParent)
      Specified by:
      createGroup in interface org.keycloak.models.GroupProvider
    • addTopLevelGroup

      public void addTopLevelGroup(org.keycloak.models.RealmModel realm, org.keycloak.models.GroupModel subGroup)
      Specified by:
      addTopLevelGroup in interface org.keycloak.models.GroupProvider
    • getClientById

      public org.keycloak.models.ClientModel getClientById(org.keycloak.models.RealmModel realm, String id)
      Specified by:
      getClientById in interface org.keycloak.storage.client.ClientLookupProvider
    • cacheClient

      protected org.keycloak.models.ClientModel cacheClient(org.keycloak.models.RealmModel realm, org.keycloak.models.ClientModel delegate, long revision)
    • validateCache

      protected org.keycloak.models.ClientModel validateCache(org.keycloak.models.RealmModel realm, CachedClient cached)
    • searchClientsByClientIdStream

      public Stream<org.keycloak.models.ClientModel> searchClientsByClientIdStream(org.keycloak.models.RealmModel realm, String clientId, Integer firstResult, Integer maxResults)
      Specified by:
      searchClientsByClientIdStream in interface org.keycloak.storage.client.ClientLookupProvider
    • searchClientsByAttributes

      public Stream<org.keycloak.models.ClientModel> searchClientsByAttributes(org.keycloak.models.RealmModel realm, Map<String,String> attributes, Integer firstResult, Integer maxResults)
      Specified by:
      searchClientsByAttributes in interface org.keycloak.storage.client.ClientLookupProvider
    • searchClientsByAuthenticationFlowBindingOverrides

      public Stream<org.keycloak.models.ClientModel> searchClientsByAuthenticationFlowBindingOverrides(org.keycloak.models.RealmModel realm, Map<String,String> overrides, Integer firstResult, Integer maxResults)
      Specified by:
      searchClientsByAuthenticationFlowBindingOverrides in interface org.keycloak.storage.client.ClientLookupProvider
    • getClientByClientId

      public org.keycloak.models.ClientModel getClientByClientId(org.keycloak.models.RealmModel realm, String clientId)
      Specified by:
      getClientByClientId in interface org.keycloak.storage.client.ClientLookupProvider
    • getClientScopeById

      public org.keycloak.models.ClientScopeModel getClientScopeById(org.keycloak.models.RealmModel realm, String id)
      Specified by:
      getClientScopeById in interface org.keycloak.storage.clientscope.ClientScopeLookupProvider
    • getClientScopesStream

      public Stream<org.keycloak.models.ClientScopeModel> getClientScopesStream(org.keycloak.models.RealmModel realm)
      Specified by:
      getClientScopesStream in interface org.keycloak.models.ClientScopeProvider
    • addClientScope

      public org.keycloak.models.ClientScopeModel addClientScope(org.keycloak.models.RealmModel realm, String name)
      Specified by:
      addClientScope in interface org.keycloak.models.ClientScopeProvider
    • addClientScope

      public org.keycloak.models.ClientScopeModel addClientScope(org.keycloak.models.RealmModel realm, String id, String name)
      Specified by:
      addClientScope in interface org.keycloak.models.ClientScopeProvider
    • removeClientScope

      public boolean removeClientScope(org.keycloak.models.RealmModel realm, String id)
      Specified by:
      removeClientScope in interface org.keycloak.models.ClientScopeProvider
    • removeClientScopes

      public void removeClientScopes(org.keycloak.models.RealmModel realm)
      Specified by:
      removeClientScopes in interface org.keycloak.models.ClientScopeProvider
    • getClientScopesByProtocol

      public Stream<org.keycloak.models.ClientScopeModel> getClientScopesByProtocol(org.keycloak.models.RealmModel realm, String protocol)
      Specified by:
      getClientScopesByProtocol in interface org.keycloak.models.ClientScopeProvider
    • getClientScopesByAttributes

      public Stream<org.keycloak.models.ClientScopeModel> getClientScopesByAttributes(org.keycloak.models.RealmModel realm, Map<String,String> searchMap, boolean useOr)
      Specified by:
      getClientScopesByAttributes in interface org.keycloak.models.ClientScopeProvider
    • addClientScopes

      public void addClientScopes(org.keycloak.models.RealmModel realm, org.keycloak.models.ClientModel client, Set<org.keycloak.models.ClientScopeModel> clientScopes, boolean defaultScope)
      Specified by:
      addClientScopes in interface org.keycloak.models.ClientProvider
    • removeClientScope

      public void removeClientScope(org.keycloak.models.RealmModel realm, org.keycloak.models.ClientModel client, org.keycloak.models.ClientScopeModel clientScope)
      Specified by:
      removeClientScope in interface org.keycloak.models.ClientProvider
    • getClientScopes

      public Map<String,org.keycloak.models.ClientScopeModel> getClientScopes(org.keycloak.models.RealmModel realm, org.keycloak.models.ClientModel client, boolean defaultScopes)
      Specified by:
      getClientScopes in interface org.keycloak.storage.client.ClientLookupProvider
    • addClientScopeToAllClients

      public void addClientScopeToAllClients(org.keycloak.models.RealmModel realm, org.keycloak.models.ClientScopeModel clientScope, boolean defaultClientScope)
      Specified by:
      addClientScopeToAllClients in interface org.keycloak.models.ClientProvider
    • getCompositeRolesStream

      public Stream<org.keycloak.models.RoleModel> getCompositeRolesStream(org.keycloak.models.RealmModel realm, Set<String> parentRoleIds)
      Specified by:
      getCompositeRolesStream in interface org.keycloak.models.RoleProvider
    • createClientInitialAccessModel

      public org.keycloak.models.ClientInitialAccessModel createClientInitialAccessModel(org.keycloak.models.RealmModel realm, int expiration, int count)
      Specified by:
      createClientInitialAccessModel in interface org.keycloak.models.RealmProvider
    • getClientInitialAccessModel

      public org.keycloak.models.ClientInitialAccessModel getClientInitialAccessModel(org.keycloak.models.RealmModel realm, String id)
      Specified by:
      getClientInitialAccessModel in interface org.keycloak.models.RealmProvider
    • removeClientInitialAccessModel

      public void removeClientInitialAccessModel(org.keycloak.models.RealmModel realm, String id)
      Specified by:
      removeClientInitialAccessModel in interface org.keycloak.models.RealmProvider
    • listClientInitialAccessStream

      public Stream<org.keycloak.models.ClientInitialAccessModel> listClientInitialAccessStream(org.keycloak.models.RealmModel realm)
      Specified by:
      listClientInitialAccessStream in interface org.keycloak.models.RealmProvider
    • removeExpiredClientInitialAccess

      public void removeExpiredClientInitialAccess()
      Specified by:
      removeExpiredClientInitialAccess in interface org.keycloak.models.RealmProvider
    • saveLocalizationText

      public void saveLocalizationText(org.keycloak.models.RealmModel realm, String locale, String key, String text)
      Specified by:
      saveLocalizationText in interface org.keycloak.models.RealmProvider
    • saveLocalizationTexts

      public void saveLocalizationTexts(org.keycloak.models.RealmModel realm, String locale, Map<String,String> localizationTexts)
      Specified by:
      saveLocalizationTexts in interface org.keycloak.models.RealmProvider
    • updateLocalizationText

      public boolean updateLocalizationText(org.keycloak.models.RealmModel realm, String locale, String key, String text)
      Specified by:
      updateLocalizationText in interface org.keycloak.models.RealmProvider
    • deleteLocalizationTextsByLocale

      public boolean deleteLocalizationTextsByLocale(org.keycloak.models.RealmModel realm, String locale)
      Specified by:
      deleteLocalizationTextsByLocale in interface org.keycloak.models.RealmProvider
    • deleteLocalizationText

      public boolean deleteLocalizationText(org.keycloak.models.RealmModel realm, String locale, String key)
      Specified by:
      deleteLocalizationText in interface org.keycloak.models.RealmProvider
    • getLocalizationTextsById

      public String getLocalizationTextsById(org.keycloak.models.RealmModel realm, String locale, String key)
      Specified by:
      getLocalizationTextsById in interface org.keycloak.models.RealmProvider
    • preRemove

      public void preRemove(org.keycloak.models.RealmModel realm)
      Specified by:
      preRemove in interface org.keycloak.models.GroupProvider
    • refreshMasterAdminRole

      public boolean refreshMasterAdminRole(org.keycloak.models.RoleModel masterAdminRole, String clientId)
      Specified by:
      refreshMasterAdminRole in interface org.keycloak.models.cache.CacheRealmProvider