Class RealmCacheManager
java.lang.Object
org.keycloak.models.cache.infinispan.CacheManager
org.keycloak.models.cache.infinispan.RealmCacheManager
- Author:
- Stian Thorgersen
-
Field Summary
Fields inherited from class org.keycloak.models.cache.infinispan.CacheManager
cache, counter, revisions
-
Constructor Summary
ConstructorDescriptionRealmCacheManager
(org.infinispan.Cache<String, Revisioned> cache, org.infinispan.Cache<String, Long> revisions) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addInvalidationsFromEvent
(InvalidationEvent event, Set<String> invalidations) void
void
void
clientScopeAdded
(String realmId, Set<String> invalidations) void
clientScopeRemoval
(String realmId, Set<String> invalidations) void
clientScopeUpdated
(String realmId, Set<String> invalidations) void
<T> T
computeSerialized
(KeycloakSession session, String id, BiFunction<String, KeycloakSession, T> compute) Compute a cached realm and ensure that this happens only once with the current Keycloak instance.protected org.jboss.logging.Logger
void
groupNameInvalidations
(String groupId, Set<String> invalidations) void
groupQueriesInvalidations
(String realmId, Set<String> invalidations) void
realmRemoval
(String id, String name, Set<String> invalidations) void
realmUpdated
(String id, String name, Set<String> invalidations) void
void
void
roleUpdated
(String roleContainerId, String roleName, Set<String> invalidations) Methods inherited from class org.keycloak.models.cache.infinispan.CacheManager
addInvalidations, addRevisioned, addRevisioned, bumpVersion, clear, endRevisionBatch, get, getCache, getCurrentCounter, getCurrentRevision, invalidateObject, invalidationEventReceived, sendInvalidationEvents
-
Constructor Details
-
RealmCacheManager
public RealmCacheManager(org.infinispan.Cache<String, Revisioned> cache, org.infinispan.Cache<String, Long> revisions)
-
-
Method Details
-
getLogger
protected org.jboss.logging.Logger getLogger()- Specified by:
getLogger
in classCacheManager
-
realmUpdated
-
realmRemoval
-
roleAdded
-
roleUpdated
-
roleRemoval
-
clientScopeAdded
-
clientScopeUpdated
-
clientScopeRemoval
-
groupQueriesInvalidations
-
groupNameInvalidations
-
clientAdded
-
clientUpdated
-
clientRemoval
-
addInvalidationsFromEvent
- Specified by:
addInvalidationsFromEvent
in classCacheManager
-
computeSerialized
public <T> T computeSerialized(KeycloakSession session, String id, BiFunction<String, KeycloakSession, T> compute) Compute a cached realm and ensure that this happens only once with the current Keycloak instance. Use this to avoid concurrent preparations of a realm in parallel threads. This helps to break the load on a stampede after a server has started, were a lot of requests come in for the same realm that hasn't been cached yet. Instead of each request loading the realm in parallel, this lets the first request load the realm, and all other requests will use the cached realm, which is much more efficient.
-