Interface SessionCachedContextProvider
-
- All Known Implementing Classes:
DefaultSessionCachedContextProvider
public interface SessionCachedContextProviderService to cache elements in session.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> voidaddItemToListCache(java.lang.String cacheKey, T value)Add a value to a cachedList.<K,V>
voidaddItemToMapCache(java.lang.String cacheKey, K key, V value)Add an element to a cachedMap<T> voidaddItemToSetCache(java.lang.String cacheKey, T value)Add a value to a cachedSet.voidclearListCache(java.lang.String cacheKey)Clear a list cache by its key.voidclearMapCache(java.lang.String cacheKey)Clear a map cache by its key.voidclearSetCache(java.lang.String cacheKey)Clear a set cache by its key.voidcreateEmptyListCache(java.lang.String cacheKey)Creates an empty cachedList.<T> java.util.List<T>getAllItemsFromListCache(java.lang.String cacheKey)Return a cachedList.<K,V>
java.util.Map<K,V>getAllItemsFromMapCache(java.lang.String cacheKey)Returns a cachedMap<T> java.util.Set<T>getAllItemsFromSetCache(java.lang.String cacheKey)Return a cachedSet.booleanhasCacheKey(java.lang.String cacheKey)Checks if there's a cache with the given key.<T> voidremoveItemFromListCache(java.lang.String cacheKey, T value)Remove element from a cached list.<K> voidremoveItemFromMapCache(java.lang.String cacheKey, K key)Remove an element from a cached list<T> voidremoveItemFromSetCache(java.lang.String cacheKey, T value)Remove element from a cached set.
-
-
-
Method Detail
-
addItemToSetCache
<T> void addItemToSetCache(java.lang.String cacheKey, T value)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
<T> java.util.Set<T> getAllItemsFromSetCache(java.lang.String cacheKey)
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
<T> void removeItemFromSetCache(java.lang.String cacheKey, T value)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
void clearSetCache(java.lang.String cacheKey)
Clear a set cache by its key.- Parameters:
cacheKey- the cache key
-
addItemToListCache
<T> void addItemToListCache(java.lang.String cacheKey, T value)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
void createEmptyListCache(java.lang.String cacheKey)
Creates an empty cachedList.- Parameters:
cacheKey- the cache key
-
getAllItemsFromListCache
<T> java.util.List<T> getAllItemsFromListCache(java.lang.String cacheKey)
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:
java.lang.IllegalStateException- if cacheKey does not exist
-
removeItemFromListCache
<T> void removeItemFromListCache(java.lang.String cacheKey, T value)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:
java.lang.IllegalStateException- if cacheKey does not exist
-
clearListCache
void clearListCache(java.lang.String cacheKey)
Clear a list cache by its key.- Parameters:
cacheKey- the cache key- Throws:
java.lang.IllegalStateException- if cacheKey does not exist
-
addItemToMapCache
<K,V> void addItemToMapCache(java.lang.String cacheKey, K key, V value)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
<K,V> java.util.Map<K,V> getAllItemsFromMapCache(java.lang.String cacheKey)
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:
java.lang.IllegalStateException- if cacheKey does not exist
-
removeItemFromMapCache
<K> void removeItemFromMapCache(java.lang.String cacheKey, K key)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:
java.lang.IllegalStateException- if cacheKey does not exist
-
clearMapCache
void clearMapCache(java.lang.String cacheKey)
Clear a map cache by its key.- Parameters:
cacheKey- the cache key- Throws:
java.lang.IllegalStateException- if cacheKey does not exist
-
hasCacheKey
boolean hasCacheKey(java.lang.String cacheKey)
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.
-
-