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
ConstructorsConstructorDescriptionRealmCacheManager(org.infinispan.Cache<String, Revisioned> cache, org.infinispan.Cache<String, Long> revisions) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddInvalidationsFromEvent(InvalidationEvent event, Set<String> invalidations) voidclientAdded(String realmId, Set<String> invalidations) voidvoidclientScopeAdded(String realmId, Set<String> invalidations) voidclientScopeRemoval(String realmId, Set<String> invalidations) voidclientScopeUpdated(String realmId, Set<String> invalidations) void<T> TcomputeSerialized(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.LoggervoidgroupNameInvalidations(String groupId, Set<String> invalidations) voidgroupQueriesInvalidations(String realmId, Set<String> invalidations) voidrealmRemoval(String id, String name, Set<String> invalidations) voidrealmUpdated(String id, String name, Set<String> invalidations) voidvoidvoidroleUpdated(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, invalidateCacheKey, 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:
getLoggerin classCacheManager
-
realmUpdated
-
realmRemoval
-
roleAdded
-
roleUpdated
-
roleRemoval
-
clientScopeAdded
-
clientScopeUpdated
-
clientScopeRemoval
-
groupQueriesInvalidations
-
groupNameInvalidations
-
clientAdded
-
clientUpdated
-
clientRemoval
-
addInvalidationsFromEvent
- Specified by:
addInvalidationsFromEventin 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.
-