|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.octo.android.robospice.persistence.ObjectPersister<T>
T
- the class of the objects this ObjectPersister
can
persist/unpersist.public abstract class ObjectPersister<T>
Super class of all entities responsible for loading/saving objects of a given class in the cache.
Constructor Summary | |
---|---|
ObjectPersister(android.app.Application application,
Class<T> clazz)
|
Method Summary | |
---|---|
boolean |
canHandleClass(Class<?> clazz)
Whether or not this bus element can persist/unpersist objects of the given class clazz. |
abstract List<Object> |
getAllCacheKeys()
|
android.app.Application |
getApplication()
|
abstract long |
getCreationDateInCache(Object cacheKey)
Return the creation date of creation of cache. entry for a given cacheKey. |
Class<T> |
getHandledClass()
|
boolean |
isAsyncSaveEnabled()
|
abstract boolean |
isDataInCache(Object cacheKey,
long maxTimeInCacheBeforeExpiry)
|
abstract List<T> |
loadAllDataFromCache()
|
abstract T |
loadDataFromCache(Object cacheKey,
long maxTimeInCache)
Load data from cache if not expired. |
abstract void |
removeAllDataFromCache()
|
abstract boolean |
removeDataFromCache(Object cacheKey)
|
abstract T |
saveDataToCacheAndReturnData(T data,
Object cacheKey)
|
void |
setAsyncSaveEnabled(boolean isAsyncSaveEnabled)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectPersister(android.app.Application application, Class<T> clazz)
Method Detail |
---|
public android.app.Application getApplication()
public Class<T> getHandledClass()
public boolean canHandleClass(Class<?> clazz)
Persister
canHandleClass
in interface Persister
clazz
- the class of objets we are looking forward to persist.
public abstract T loadDataFromCache(Object cacheKey, long maxTimeInCache) throws CacheLoadingException
cacheKey
- the cacheKey of the data to load.maxTimeInCache
- the maximum time the data can have been stored in cached
before being considered expired. 0 means infinite.
CacheLoadingException
- if the data in cache is expired.public abstract List<T> loadAllDataFromCache() throws CacheLoadingException
CacheLoadingException
public abstract List<Object> getAllCacheKeys()
public abstract T saveDataToCacheAndReturnData(T data, Object cacheKey) throws CacheSavingException
CacheSavingException
public abstract boolean removeDataFromCache(Object cacheKey)
public abstract void removeAllDataFromCache()
removeAllDataFromCache
in interface CacheCleaner
public abstract long getCreationDateInCache(Object cacheKey) throws CacheLoadingException
cacheKey
- the cachekey identifying the object to look for.
CacheLoadingException
- if there is no such element in cache.public boolean isAsyncSaveEnabled()
public void setAsyncSaveEnabled(boolean isAsyncSaveEnabled)
public abstract boolean isDataInCache(Object cacheKey, long maxTimeInCacheBeforeExpiry)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |