com.atlassian.crowd.manager.cache
Interface CacheManager

All Known Implementing Classes:
CacheManagerEhcache

public interface CacheManager


Method Summary
 Object get(String key)
          Retrieves cached object from the default cache.
 Object get(String cacheName, Serializable key)
          Retrieves cached object.
 List getAllKeys()
          Retrieves all keys from the default cache.
 List getAllKeys(String cacheName)
          Retrieve all keys from the cache.
 void put(String key, Serializable obj)
          Saves object to the default cache
 void put(String cacheName, Serializable key, Serializable obj)
          Saves object to the cache.
 boolean remove(String key)
          Removes cached object from the default cache
 boolean remove(String cacheName, Serializable key)
          Removes cached object from the cache.
 void removeAll()
          Remove all the entries from the default 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

put

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

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

get

Object get(String key)
           throws CacheManagerException,
                  NotInCacheException
Retrieves cached object from the default cache.

Parameters:
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 key)
               throws CacheManagerException
Removes cached object from the default cache

Parameters:
key - key of the object
Returns:
true if the key exists
Throws:
CacheManagerException - if any problems arise during the operation

removeAll

void removeAll()
               throws CacheManagerException
Remove all the entries from the default cache.

Throws:
CacheManagerException - if any problems arise during the operation

getAllKeys

List getAllKeys()
                throws CacheManagerException
Retrieves all keys from the default cache.

Returns:
list of keys
Throws:
CacheManagerException - if any problems arise during the operation


Copyright © 2013 Atlassian. All Rights Reserved.