public final class CacheManager extends Object
| Constructor and Description |
|---|
CacheManager() |
| Modifier and Type | Method and Description |
|---|---|
static void |
cleanUp()
Cleans up all cache entries that have been invalidated.
|
static com.google.common.collect.ImmutableList<com.github.benmanes.caffeine.cache.Cache<CacheKey,?>> |
getCacheList()
Getter for a list of all caches registered in the
CacheManager. |
static long |
invalidateAll()
Invalidates all entries in all caches.
|
static long |
invalidatePrincipalCaches()
Invalidates all caches of the current principal.
|
static long |
invalidatePrincipalCaches(String tenantId,
String principalId)
Invalidates all caches of the given principal.
|
static long |
invalidatePrincipalEntries(com.github.benmanes.caffeine.cache.Cache<CacheKey,?> cache)
Invalidates all cache entries of the current tenant-specific principal.
|
static long |
invalidatePrincipalEntries(String tenantId,
String principalId,
com.github.benmanes.caffeine.cache.Cache<CacheKey,?> cache)
Invalidates all cache entries of the given tenant-specific principal.
|
static long |
invalidateTenantCaches()
Invalidates all caches of the current tenant.
|
static long |
invalidateTenantCaches(String tenantId)
Invalidates all caches of the given tenant.
|
static <T> com.github.benmanes.caffeine.cache.Cache<CacheKey,T> |
register(com.github.benmanes.caffeine.cache.Cache<CacheKey,T> cache)
Registers a cache at in the
CacheManager. |
static <T> com.github.benmanes.caffeine.cache.Cache<CacheKey,T> |
unregister(com.github.benmanes.caffeine.cache.Cache<CacheKey,T> cache)
Unregisters a cache from the
CacheManager. |
@Nonnull public static com.google.common.collect.ImmutableList<com.github.benmanes.caffeine.cache.Cache<CacheKey,?>> getCacheList()
CacheManager.@Nonnull public static <T> com.github.benmanes.caffeine.cache.Cache<CacheKey,T> register(@Nonnull com.github.benmanes.caffeine.cache.Cache<CacheKey,T> cache)
CacheManager.T - The type of the values in the cache.cache - The cache to be registered.@Beta @Nonnull public static <T> com.github.benmanes.caffeine.cache.Cache<CacheKey,T> unregister(@Nonnull com.github.benmanes.caffeine.cache.Cache<CacheKey,T> cache)
CacheManager.
Note: The given cache will not be cleared / manipulated with this
method.
T - The type of the values for the cache.cache - The cache to be unregistered.public static void cleanUp()
public static long invalidateAll()
public static long invalidateTenantCaches()
public static long invalidateTenantCaches(@Nullable String tenantId)
tenantId - The tenant or zone to invalidate all caches for.public static long invalidatePrincipalCaches()
public static long invalidatePrincipalCaches(@Nullable String tenantId, @Nullable String principalId)
tenantId - The identifier of the tenant or zone for which all principal caches should be invalidated.principalId - The identifier of the principal for which all caches should be invalidated.public static long invalidatePrincipalEntries(@Nonnull com.github.benmanes.caffeine.cache.Cache<CacheKey,?> cache)
cache - The cache in which all caches of the current principal should be invalidated.public static long invalidatePrincipalEntries(@Nullable String tenantId, @Nullable String principalId, @Nonnull com.github.benmanes.caffeine.cache.Cache<CacheKey,?> cache)
tenantId - The identifier of the tenant or zone for which all principal cache entries should be invalidated.principalId - The identifier of the principal for which all cache entries should be invalidated.cache - The cache in which the entries of the principal should be invalidated.Copyright © 2022 SAP SE. All rights reserved.