public interface CacheService
| Modifier and Type | Method and Description |
|---|---|
void |
addScope(Context context)
Adds a new scope to the cache for the given context.
|
void |
clearAll()
Clears the contents of the entire cache.
|
void |
clearScope(Context context)
Clears the contents of the scope of the given context.
|
Object |
get(Context context,
Object key)
Retrieves an item's value from the scope of the given context, or null if not found.
|
CacheItem |
getItem(Context context,
Object key)
Retrieves an item from the scope of the given context, or null if not found.
|
Collection<?> |
getKeys(Context context)
Returns a list of the keys of the items present in the scope of the given context.
|
Collection<String> |
getScopes()
Returns the list of scopes this cache manages.
|
int |
getSize(Context context)
Returns the quantity of items present in scope of the given context.
|
CacheStatistics |
getStatistics(Context context)
Returns the statistics for the scope of the given context.
|
boolean |
hasKey(Context context,
Object key)
Returns true if there's and item with the specified key in the scope of the given context.
|
boolean |
hasScope(Context context)
Returns true if the scope of the given context exists.
|
void |
put(Context context,
Object key,
Object value)
Puts an item in the scope of the given context.
|
void |
put(Context context,
Object key,
Object value,
CachingOptions cachingOptions,
CacheLoader loader,
Object... loaderParams)
Puts and item in the scope of the given context.
|
boolean |
remove(Context context,
Object key)
Removes an item from the scope of the given context.
|
void |
removeScope(Context context)
Removes the scope associated to the given context
|
Collection<String> getScopes() throws InternalCacheEngineException
InternalCacheEngineExceptionvoid clearAll()
throws InternalCacheEngineException
InternalCacheEngineExceptionvoid addScope(Context context) throws InternalCacheEngineException
InternalCacheEngineExceptionvoid removeScope(Context context) throws InvalidContextException, InternalCacheEngineException
boolean hasScope(Context context) throws InvalidContextException, InternalCacheEngineException
int getSize(Context context) throws InvalidContextException, InternalCacheEngineException
Collection<?> getKeys(Context context) throws InvalidContextException, InternalCacheEngineException
boolean hasKey(Context context, Object key) throws InvalidContextException, InternalCacheEngineException
CacheItem getItem(Context context, Object key) throws InvalidContextException, InternalCacheEngineException
Object get(Context context, Object key) throws InvalidContextException, InternalCacheEngineException
void put(Context context, Object key, Object value) throws InvalidContextException, InternalCacheEngineException
void put(Context context, Object key, Object value, CachingOptions cachingOptions, CacheLoader loader, Object... loaderParams) throws InvalidContextException, InternalCacheEngineException
boolean remove(Context context, Object key) throws InvalidContextException, InternalCacheEngineException
void clearScope(Context context) throws InvalidContextException, InternalCacheEngineException
CacheStatistics getStatistics(Context context)
Copyright © 2018 CrafterCMS. All rights reserved.