public interface CacheStoreAdapter
| Modifier and Type | Method and Description |
|---|---|
void |
addScope(String scope,
int maxItemsInMemory)
Adds a new scope to the underlying store.
|
void |
clearAll()
Clears the contents of the entire store.
|
void |
clearScope(String scope)
Clears the contents of the specified scope in the underlying store.
|
CacheItem |
get(String scope,
Object key)
Retrieves an item from a scope.
|
Collection<Object> |
getKeys(String scope)
Returns a list of the keys of the items present in the specified scope.
|
Collection<String> |
getScopes()
Returns the scopes managed by the underlying store.
|
int |
getSize(String scope)
Returns the quantity of items present in the specified scope.
|
CacheStatistics |
getStatistics(String scope)
Returns the statistics of the specified scope from the underlying store.
|
boolean |
hasKey(String scope,
Object key)
Returns true if there's and item with the specified key in the specified scope.
|
boolean |
hasScope(String scope)
Returns true if the specified scope exists in the cache.
|
void |
put(CacheItem item)
Puts an item in a scope.
|
boolean |
remove(String scope,
Object key)
Removes an item from a scope.
|
void |
removeScope(String scope)
Removes an existing scope and all the items that are in it.
|
boolean hasScope(String scope) throws Exception
ExceptionCollection<String> getScopes() throws Exception
Exceptionvoid addScope(String scope, int maxItemsInMemory) throws Exception
scope - the name of the scopemaxItemsInMemory - the maximum number of items in memory, before they are evictedExceptionvoid removeScope(String scope) throws Exception
scope - scope to removeExceptionint getSize(String scope) throws Exception
ExceptionCollection<Object> getKeys(String scope) throws Exception
Exceptionboolean hasKey(String scope, Object key) throws Exception
ExceptionCacheItem get(String scope, Object key) throws Exception
scope - scope to get the item fromkey - unique key for the item within this scopeExceptionvoid put(CacheItem item) throws Exception
CacheItem.getScope().item - the item to putExceptionboolean remove(String scope, Object key) throws Exception
scope - scope to remove the item fromkey - unique key for the item within this scopeExceptionvoid clearAll()
throws Exception
Exceptionvoid clearScope(String scope) throws Exception
scope - scope to clearExceptionCacheStatistics getStatistics(String scope)
scope - scope to inspectCopyright © 2018 CrafterCMS. All rights reserved.