com.atlassian.confluence.functest.rest.admin
Class CacheResource

java.lang.Object
  extended by com.atlassian.confluence.functest.rest.admin.CacheResource

public class CacheResource
extends java.lang.Object

Interacts with the CacheManager. Called from CacheRpc.


Constructor Summary
CacheResource(com.atlassian.cache.CacheManager cacheManager, CacheStatisticsManager cacheStatisticsManager, CacheConfigManager cacheConfigManager)
           
 
Method Summary
 void flushAllCaches()
           
 int getCacheMaxEntries(java.lang.String cacheName)
          Returns the configured maximum number of elements in the given cache
 java.util.Collection<java.util.Hashtable> getCacheStatistics()
          Returns all cache statistics.
 java.util.Hashtable getCacheStatistics(java.lang.String cacheName)
          Returns the cache statistics for a particular named cache.
 java.util.Collection<java.lang.String> getCacheStatisticsCapabilities()
           
 void putStringMappingInCache(java.lang.String cacheName, java.lang.String key, java.lang.String value)
          Map a key to a value for a given cache.
 void setCacheMaxEntries(java.lang.String cacheName, int maxNumElements)
          (Re)configures the maximum number of elements in the given cache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheResource

public CacheResource(com.atlassian.cache.CacheManager cacheManager,
                     CacheStatisticsManager cacheStatisticsManager,
                     CacheConfigManager cacheConfigManager)
Method Detail

flushAllCaches

public void flushAllCaches()

getCacheMaxEntries

public int getCacheMaxEntries(java.lang.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(java.lang.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(java.lang.String cacheName,
                                    java.lang.String key,
                                    java.lang.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 java.util.Collection<java.util.Hashtable> getCacheStatistics()
Returns all cache statistics.

Returns:
A collection of hashtables representing the cache statistics

getCacheStatistics

public java.util.Hashtable getCacheStatistics(java.lang.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

getCacheStatisticsCapabilities

public java.util.Collection<java.lang.String> getCacheStatisticsCapabilities()


Copyright © 2003-2014 Atlassian. All Rights Reserved.