Class CacheResource
- java.lang.Object
-
- com.atlassian.confluence.functest.rest.admin.CacheResource
-
public class CacheResource extends Object
Interacts with the CacheManager. Called from CacheRpc.
-
-
Constructor Summary
Constructors Constructor Description CacheResource(com.atlassian.cache.CacheManager cacheManager, CacheConfigManager cacheConfigManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flushAllCaches()
void
flushCache(String cacheName)
int
getCacheMaxEntries(String cacheName)
Returns the configured maximum number of elements in the given cacheCollection<Map<String,Long>>
getCacheStatistics()
Returns all cache statistics.Map<String,Long>
getCacheStatistics(String cacheName)
Returns the cache statistics for a particular named cache.void
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 Detail
-
CacheResource
public CacheResource(com.atlassian.cache.CacheManager cacheManager, CacheConfigManager cacheConfigManager)
-
-
Method Detail
-
flushAllCaches
public void flushAllCaches()
-
flushCache
public void flushCache(String cacheName)
-
getCacheMaxEntries
public int getCacheMaxEntries(String cacheName)
Returns the configured maximum number of elements in the given cache- Parameters:
cacheName
- the key of the cache, rather than the "niceName"
-
setCacheMaxEntries
public void setCacheMaxEntries(String cacheName, int maxNumElements)
(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 void 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
public Collection<Map<String,Long>> getCacheStatistics()
Returns all cache statistics.- Returns:
- A collection of hashtables representing the cache statistics
-
-