com.atlassian.crowd.manager.cache
Interface CacheManager

All Known Implementing Classes:
CacheManagerEhcache

public interface CacheManager


Method Summary
 Object get(String cacheName, Serializable key)
          Retrieves cached object.
 List getAllKeys(String cacheName)
          Retrieve all keys from the cache.
 void put(String cacheName, Serializable key, Serializable obj)
          Saves object to the cache.
 boolean remove(String cacheName, Serializable key)
          Removes cached object from the cache.
 void removeAll(String cacheName)
          Removes all the entries from the given cache.
 

Method Detail

put

void put(String cacheName,
         Serializable key,
         Serializable obj)
         throws CacheManagerException
Saves object to the cache.

Parameters:
cacheName - cache name
key - key of the object
obj - actual object to be cached
Throws:
CacheManagerException - if any problems arise during the operation

get

Object get(String cacheName,
           Serializable key)
           throws CacheManagerException,
                  NotInCacheException
Retrieves cached object.

Parameters:
cacheName - cache name
key - key of the object
Returns:
cached object
Throws:
CacheManagerException - if any problems arise during the operation
NotInCacheException - if the key does not exist

remove

boolean remove(String cacheName,
               Serializable key)
               throws CacheManagerException
Removes cached object from the cache.

Parameters:
cacheName - cache name
key - key of the object
Returns:
if an element was removed as a result of this call
Throws:
CacheManagerException - if any problems arise during the operation

removeAll

void removeAll(String cacheName)
               throws CacheManagerException
Removes all the entries from the given cache.

Parameters:
cacheName - cache name.
Throws:
CacheManagerException - if any problems arise during the operation

getAllKeys

List getAllKeys(String cacheName)
                throws CacheManagerException
Retrieve all keys from the cache.

Parameters:
cacheName - cache name.
Returns:
list of keys.
Throws:
CacheManagerException


Copyright © 2014 Atlassian. All Rights Reserved.