Class CacheResource
java.lang.Object
com.atlassian.confluence.functest.rest.admin.CacheResource
@Consumes("application/json")
@Produces("application/json")
@Path("/admin/cache-manager")
public class CacheResource
extends Object
Interacts with the CacheManager. Called from CacheRpc.
-
Constructor Summary
ConstructorsConstructorDescriptionCacheResource(com.atlassian.cache.CacheManager cacheManager, CacheConfigManager cacheConfigManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidflushCache(String cacheName) getCacheConfig(String cacheName) intgetCacheMaxEntries(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.jakarta.ws.rs.core.ResponseputStringMappingInCache(String cacheName, String key, String value) Map a key to a value for a given cache.voidsetCacheMaxEntries(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
@DELETE @Path("/cache") public void flushAllCaches() -
flushCache
@DELETE @Path("/cache/{cacheName}") public void flushCache(@PathParam("cacheName") String cacheName) -
getCacheMaxEntries
@GET @Path("/cache/{cacheName}/maxEntries") public int getCacheMaxEntries(@PathParam("cacheName") 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
@PUT @Path("/cache/{cacheName}/maxEntries") public void setCacheMaxEntries(@PathParam("cacheName") 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
@PUT @Path("/cache/{cacheName}/entry/{key}") public jakarta.ws.rs.core.Response putStringMappingInCache(@PathParam("cacheName") String cacheName, @PathParam("key") 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
@GET @Path("/cache/{cacheName}/stats") public Map<String,Long> getCacheStatistics(@PathParam("cacheName") String cacheName) 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
-