com.octo.android.robospice.persistence
Interface ICacheManager

All Known Implementing Classes:
CacheManager

Deprecated. since version 1.4.6 of RS, easymock 3.2 makes this interface obsolete.

@Deprecated
public interface ICacheManager

This interface is mainly used for mocking/testing. Developpers should use directly the class CacheManager and should not have to implement this interface. Defines the behavior of a cache manager, a bus of ObjectPersister.

Author:
sni

Method Summary
 void addPersister(Persister persister)
          Deprecated.  
<T> List<Object>
getAllCacheKeys(Class<T> clazz)
          Deprecated. Get all cache keys associated to a given class.
 Date getDateOfDataInCache(Class<?> clazz, Object cacheKey)
          Deprecated. The date at which given data has been stored last in cache.
 boolean isDataInCache(Class<?> clazz, Object cacheKey, long maxTimeInCacheBeforeExpiry)
          Deprecated. Test whether or not some data is in cache.
<T> List<T>
loadAllDataFromCache(Class<T> clazz)
          Deprecated. Loads all data stored in cache for a given class.
<T> T
loadDataFromCache(Class<T> clazz, Object cacheKey, long maxTimeInCacheBeforeExpiry)
          Deprecated. Loads an instance of a class clazz, that is stored in cache under the key cacheKey.
 void removeAllDataFromCache()
          Deprecated. Removes all data in the cache.
 void removeAllDataFromCache(Class<?> clazz)
          Deprecated. Removes all data in the cache that are instances of class clazz.
 boolean removeDataFromCache(Class<?> clazz, Object cacheKey)
          Deprecated. Removes a given data in the cache that is an instance of class clazz.
 void removePersister(Persister persister)
          Deprecated.  
<T> T
saveDataToCacheAndReturnData(T data, Object cacheKey)
          Deprecated. Save an instance of a given class, into the cache identified by cacheKey.
 

Method Detail

addPersister

void addPersister(Persister persister)
Deprecated. 

removePersister

void removePersister(Persister persister)
Deprecated. 

getAllCacheKeys

<T> List<Object> getAllCacheKeys(Class<T> clazz)
Deprecated. 
Get all cache keys associated to a given class.

Parameters:
clazz - the class for which to get all cache keys.
Returns:
all cache keys associated to a given class. The empty list is nothing is found in cache.

loadDataFromCache

<T> T loadDataFromCache(Class<T> clazz,
                        Object cacheKey,
                        long maxTimeInCacheBeforeExpiry)
                    throws CacheLoadingException,
                           CacheCreationException
Deprecated. 
Loads an instance of a class clazz, that is stored in cache under the key cacheKey.

Parameters:
clazz - the class of the object that is supposed to be stored in cache.
cacheKey - the key used to identify this item in cache.
maxTimeInCacheBeforeExpiry - the maximum time (in ms) an item can be stored in cache before being considered expired.
Returns:
an instance of a class clazz, that is stored in cache under the key cacheKey. If the item is not found in cache or is older than maxTimeInCacheBeforeExpiry, then this method will return null.
Throws:
CacheLoadingException
CacheCreationException

loadAllDataFromCache

<T> List<T> loadAllDataFromCache(Class<T> clazz)
                             throws CacheLoadingException,
                                    CacheCreationException
Deprecated. 
Loads all data stored in cache for a given class.

Parameters:
clazz - the class for which to get all data stored in cache.
Returns:
all data stored in cache for a given class.
Throws:
CacheLoadingException
CacheCreationException

saveDataToCacheAndReturnData

<T> T saveDataToCacheAndReturnData(T data,
                                   Object cacheKey)
                               throws CacheCreationException,
                                      CacheSavingException
Deprecated. 
Save an instance of a given class, into the cache identified by cacheKey. Some ObjectPersister can modify the data they receive before saving it. Most ObjectPersister instances will just save the data as-is, in this case, they can even return it and save it asynchronously in a background thread for a better efficiency.

Parameters:
data - the data to be saved in cache.
cacheKey - the key used to identify this item in cache.
Returns:
the data that was saved.
Throws:
CacheCreationException
CacheSavingException

isDataInCache

boolean isDataInCache(Class<?> clazz,
                      Object cacheKey,
                      long maxTimeInCacheBeforeExpiry)
                      throws CacheCreationException
Deprecated. 
Test whether or not some data is in cache.

Parameters:
clazz - the class of the object that is supposed to be stored in cache.
cacheKey - the key used to identify this item in cache.
maxTimeInCacheBeforeExpiry - the maximum time (in ms) an item can be stored in cache before being considered expired.
Returns:
a boolean indicating whether or not the given data is in the cache.
Throws:
CacheCreationException

getDateOfDataInCache

Date getDateOfDataInCache(Class<?> clazz,
                          Object cacheKey)
                          throws CacheCreationException,
                                 CacheLoadingException
Deprecated. 
The date at which given data has been stored last in cache.

Parameters:
clazz - the class of the object that is supposed to be stored in cache.
cacheKey - the key used to identify this item in cache.
Returns:
the date at which data has been stored last in cache. Null if no such data exists.
Throws:
CacheCreationException
CacheLoadingException

removeDataFromCache

boolean removeDataFromCache(Class<?> clazz,
                            Object cacheKey)
Deprecated. 
Removes a given data in the cache that is an instance of class clazz.

Parameters:
clazz - the class of the data to be removed.
cacheKey - the identifier of the data to be removed from cache.
Returns:
a boolean indicating whether or not this data could be removed.

removeAllDataFromCache

void removeAllDataFromCache(Class<?> clazz)
Deprecated. 
Removes all data in the cache that are instances of class clazz.

Parameters:
clazz - the class of the data to be removed.

removeAllDataFromCache

void removeAllDataFromCache()
Deprecated. 
Removes all data in the cache.



Copyright © 2012-2014. All Rights Reserved.