Class CacheResource
java.lang.Object
com.atlassian.confluence.functest.rest.admin.CacheResource
Interacts with the CacheManager. Called from CacheRpc.
-
Constructor Summary
ConstructorDescriptionCacheResource
(com.atlassian.cache.CacheManager cacheManager, CacheConfigManager cacheConfigManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
flushCache
(String cacheName) getCacheConfig
(String cacheName) int
getCacheMaxEntries
(String cacheName) Returns the configured maximum number of elements in the given cacheReturns all cache statistics.getCacheStatistics
(String cacheName) Returns the cache statistics for a particular named cache.javax.ws.rs.core.Response
putStringMappingInCache
(String cacheName, String key, String value) Map a key to a value for a given cache.void
setCacheMaxEntries
(String cacheName, int maxNumElements) (Re)configures the maximum number of elements in the given cache
-
Constructor Details
-
CacheResource
@Inject public CacheResource(com.atlassian.cache.CacheManager cacheManager, CacheConfigManager cacheConfigManager)
-
-
Method Details
-
getCacheConfig
-
getCacheConfig
-
flushAllCaches
public void flushAllCaches() -
flushCache
-
getCacheMaxEntries
Returns the configured maximum number of elements in the given cache- Parameters:
cacheName
- the key of the cache, rather than the "niceName"
-
setCacheMaxEntries
(Re)configures the maximum number of elements in the given cache- Parameters:
cacheName
- the key of the cache, rather than the "niceName"maxNumElements
- the new size for the cache
-
putStringMappingInCache
public javax.ws.rs.core.Response putStringMappingInCache(String cacheName, String key, String value) Map a key to a value for a given cache. Only accepts strings. This allows us to manipulate the number of entries in the cache. This method will create the named cache if it doesn't exist. -
getCacheStatistics
Returns all cache statistics.- Returns:
- A collection of hashtables representing the cache statistics
-
getCacheStatistics
Returns the cache statistics for a particular named cache.- Parameters:
cacheName
- the key of the cache, rather than the "niceName"- Returns:
- A hashtable representing the cache statistics
-