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.google.common.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 |
invalidateTenantCaches()
Invalidates all caches of the current tenant.
|
static long |
invalidateTenantCaches(String tenantId)
Invalidates all caches of the given tenant.
|
static long |
invalidateUserCaches()
Invalidates all caches of the current user.
|
static long |
invalidateUserCaches(String tenantId,
String userName)
Invalidates all caches of the given user.
|
static long |
invalidateUserEntries(com.google.common.cache.Cache<CacheKey,?> cache)
Invalidates all cache entries of the current tenant-specific user.
|
static long |
invalidateUserEntries(String tenantId,
String userName,
com.google.common.cache.Cache<CacheKey,?> cache)
Invalidates all cache entries of the given tenant-specific user.
|
static <T> com.google.common.cache.Cache<CacheKey,T> |
register(com.google.common.cache.Cache<CacheKey,T> cache)
Registers a cache at in the
CacheManager . |
@Nonnull public static com.google.common.collect.ImmutableList<com.google.common.cache.Cache<CacheKey,?>> getCacheList()
CacheManager
.@Nonnull public static <T> com.google.common.cache.Cache<CacheKey,T> register(@Nonnull com.google.common.cache.Cache<CacheKey,T> cache)
CacheManager
.T
- The type of the values in the cache.cache
- The cache to be registered.public static void cleanUp()
public static long invalidateAll()
public static long invalidateTenantCaches() throws TenantNotAvailableException, TenantAccessException
TenantNotAvailableException
- If the current tenant is not available.TenantAccessException
- If there is an issue while accessing the current tenant.public static long invalidateTenantCaches(String tenantId)
tenantId
- The tenant to invalidate all caches for.public static long invalidateUserCaches() throws TenantNotAvailableException, TenantAccessException, UserNotAuthenticatedException, UserAccessException
TenantNotAvailableException
- If the current tenant is not available.TenantAccessException
- If there is an issue while accessing the current tenant.UserNotAuthenticatedException
- If the current user is not authenticated.UserAccessException
- If there is an issue while accessing the current user.public static long invalidateUserCaches(String tenantId, String userName)
tenantId
- The Id of the tenant for which all user caches should be invalidated.userName
- The name of the user for which all caches should be invalidated.public static long invalidateUserEntries(com.google.common.cache.Cache<CacheKey,?> cache) throws TenantNotAvailableException, TenantAccessException, UserNotAuthenticatedException, UserAccessException
cache
- The cache in which all caches of the current user should be invalidated.TenantNotAvailableException
- If the current tenant is not available.TenantAccessException
- If there is an issue while accessing the current tenant.UserNotAuthenticatedException
- If the current user is not authenticated.UserAccessException
- If there is an issue while accessing the current user.public static long invalidateUserEntries(String tenantId, String userName, com.google.common.cache.Cache<CacheKey,?> cache)
tenantId
- The Id of the tenant for which all user cache emtries should be invalidated.userName
- The name of the user for which all cache entries should be invalidated.cache
- The cache in which the entries of the user should be invalidated.Copyright © 2019 SAP SE. All rights reserved.