Package org.craftercms.core.service
Interface CacheService
- All Known Implementing Classes:
CacheServiceImpl
public interface CacheService
- Author:
- Sumer Jabri, Alfonso Vásquez
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.Retrieves an item's value from the scope of the given context, or null if not found.Retrieves an item from the scope of the given context, or null if not found.Collection<?>
Returns a list of the keys of the items present in the scope of the given context.Returns the list of scopes this cache manages.int
Returns the quantity of items present in scope of the given context.getStatistics
(Context context) Returns the statistics for the scope of the given context.boolean
Returns true if there's and item with the specified key in the scope of the given context.boolean
Returns true if the scope of the given context exists.void
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
Removes an item from the scope of the given context.void
removeScope
(Context context) Removes the scope associated to the given context
-
Method Details
-
getScopes
Returns the list of scopes this cache manages.- Throws:
InternalCacheEngineException
-
clearAll
Clears the contents of the entire cache.- Throws:
InternalCacheEngineException
-
addScope
Adds a new scope to the cache for the given context.- Throws:
InternalCacheEngineException
-
removeScope
Removes the scope associated to the given context -
hasScope
Returns true if the scope of the given context exists. -
getSize
Returns the quantity of items present in scope of the given context. -
getKeys
Returns a list of the keys of the items present in the scope of the given context. -
hasKey
boolean hasKey(Context context, Object key) throws InvalidContextException, InternalCacheEngineException Returns true if there's and item with the specified key in the scope of the given context. -
getItem
CacheItem getItem(Context context, Object key) throws InvalidContextException, InternalCacheEngineException Retrieves an item from the scope of the given context, or null if not found. -
get
Object get(Context context, Object key) throws InvalidContextException, InternalCacheEngineException Retrieves an item's value from the scope of the given context, or null if not found. -
put
void put(Context context, Object key, Object value) throws InvalidContextException, InternalCacheEngineException Puts an item in the scope of the given context. -
put
void put(Context context, Object key, Object value, CachingOptions cachingOptions, CacheLoader loader, Object... loaderParams) throws InvalidContextException, InternalCacheEngineException Puts and item in the scope of the given context. -
remove
boolean remove(Context context, Object key) throws InvalidContextException, InternalCacheEngineException Removes an item from the scope of the given context. -
clearScope
Clears the contents of the scope of the given context. -
getStatistics
Returns the statistics for the scope of the given context.
-