Class CacheResource


  • public class CacheResource
    extends Object
    Interacts with the CacheManager. Called from CacheRpc.
    • 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 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

        public Collection<Map<String,​Long>> getCacheStatistics()
        Returns all cache statistics.
        Returns:
        A collection of hashtables representing the cache statistics
      • getCacheStatistics

        public Map<String,​Long> getCacheStatistics​(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