Interface SessionCachedContextProvider
- All Known Implementing Classes:
DefaultSessionCachedContextProvider
public interface SessionCachedContextProvider
Service to cache elements in session.
-
Method Summary
Modifier and TypeMethodDescription<T> voidaddItemToListCache(String cacheKey, T value) Add a value to a cachedList.<K,V> void addItemToMapCache(String cacheKey, K key, V value) Add an element to a cachedMap<T> voidaddItemToSetCache(String cacheKey, T value) Add a value to a cachedSet.voidclearListCache(String cacheKey) Clear a list cache by its key.voidclearMapCache(String cacheKey) Clear a map cache by its key.voidclearSetCache(String cacheKey) Clear a set cache by its key.voidcreateEmptyListCache(String cacheKey) Creates an empty cachedList.<T> List<T>getAllItemsFromListCache(String cacheKey) Return a cachedList.<K,V> Map<K, V> getAllItemsFromMapCache(String cacheKey) Returns a cachedMap<T> Set<T>getAllItemsFromSetCache(String cacheKey) Return a cachedSet.booleanhasCacheKey(String cacheKey) Checks if there's a cache with the given key.<T> voidremoveItemFromListCache(String cacheKey, T value) Remove element from a cached list.<K> voidremoveItemFromMapCache(String cacheKey, K key) Remove an element from a cached list<T> voidremoveItemFromSetCache(String cacheKey, T value) Remove element from a cached set.
-
Method Details
-
addItemToSetCache
Add a value to a cachedSet.- Type Parameters:
T- type of the value- Parameters:
cacheKey- the cache key to find a cached setvalue- the value to add to a cached set
-
getAllItemsFromSetCache
Return a cachedSet.- Type Parameters:
T- type of a set element- Parameters:
cacheKey- the cache key to find a cached set- Returns:
- the cached
Set.
-
removeItemFromSetCache
Remove element from a cached set.- Type Parameters:
T- type of the value- Parameters:
cacheKey- the cache key to find a cached setvalue- the value to remove from a cached set
-
clearSetCache
Clear a set cache by its key.- Parameters:
cacheKey- the cache key
-
addItemToListCache
Add a value to a cachedList.- Type Parameters:
T- type of the value- Parameters:
cacheKey- the cache key to find a cached listvalue- the value to add to a cached list
-
createEmptyListCache
Creates an empty cachedList.- Parameters:
cacheKey- the cache key
-
getAllItemsFromListCache
Return a cachedList.- Type Parameters:
T- type of a list element- Parameters:
cacheKey- the cache key to find a cached list- Returns:
- the cached
List. - Throws:
IllegalStateException- if cacheKey does not exist
-
removeItemFromListCache
Remove element from a cached list.- Type Parameters:
T- type of the value- Parameters:
cacheKey- the cache key to find a cached listvalue- the value to remove from a cached list- Throws:
IllegalStateException- if cacheKey does not exist
-
clearListCache
Clear a list cache by its key.- Parameters:
cacheKey- the cache key- Throws:
IllegalStateException- if cacheKey does not exist
-
addItemToMapCache
Add an element to a cachedMap- Type Parameters:
K- type of the keyV- type of the value- Parameters:
cacheKey- the cache key to find a cached mapkey- the key for the valuevalue- the value
-
getAllItemsFromMapCache
Returns a cachedMap- Type Parameters:
K- type of the keyV- type of the value- Parameters:
cacheKey- the cache key to find a cached map- Returns:
- the
Map - Throws:
IllegalStateException- if cacheKey does not exist
-
removeItemFromMapCache
Remove an element from a cached list- Type Parameters:
K- type of the key- Parameters:
cacheKey- the cache key to find a cached mapkey- the key to remove- Throws:
IllegalStateException- if cacheKey does not exist
-
clearMapCache
Clear a map cache by its key.- Parameters:
cacheKey- the cache key- Throws:
IllegalStateException- if cacheKey does not exist
-
hasCacheKey
Checks if there's a cache with the given key.- Parameters:
cacheKey- the cache key- Returns:
- true if there's a cache with the given key. false otherwise.
-