Interface SessionCachedContextProvider

All Known Implementing Classes:
DefaultSessionCachedContextProvider

public interface SessionCachedContextProvider
Service to cache elements in session.
  • Method Details

    • addItemToSetCache

      <T> void addItemToSetCache(String cacheKey, T value)
      Add a value to a cached Set.
      Type Parameters:
      T - type of the value
      Parameters:
      cacheKey - the cache key to find a cached set
      value - the value to add to a cached set
    • getAllItemsFromSetCache

      <T> Set<T> getAllItemsFromSetCache(String cacheKey)
      Return a cached Set.
      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(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 set
      value - the value to remove from a cached set
    • clearSetCache

      void clearSetCache(String cacheKey)
      Clear a set cache by its key.
      Parameters:
      cacheKey - the cache key
    • addItemToListCache

      <T> void addItemToListCache(String cacheKey, T value)
      Add a value to a cached List.
      Type Parameters:
      T - type of the value
      Parameters:
      cacheKey - the cache key to find a cached list
      value - the value to add to a cached list
    • createEmptyListCache

      void createEmptyListCache(String cacheKey)
      Creates an empty cached List.
      Parameters:
      cacheKey - the cache key
    • getAllItemsFromListCache

      <T> List<T> getAllItemsFromListCache(String cacheKey)
      Return a cached List.
      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

      <T> void removeItemFromListCache(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 list
      value - the value to remove from a cached list
      Throws:
      IllegalStateException - if cacheKey does not exist
    • clearListCache

      void clearListCache(String cacheKey)
      Clear a list cache by its key.
      Parameters:
      cacheKey - the cache key
      Throws:
      IllegalStateException - if cacheKey does not exist
    • addItemToMapCache

      <K, V> void addItemToMapCache(String cacheKey, K key, V value)
      Add an element to a cached Map
      Type Parameters:
      K - type of the key
      V - type of the value
      Parameters:
      cacheKey - the cache key to find a cached map
      key - the key for the value
      value - the value
    • getAllItemsFromMapCache

      <K, V> Map<K,V> getAllItemsFromMapCache(String cacheKey)
      Returns a cached Map
      Type Parameters:
      K - type of the key
      V - 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

      <K> void removeItemFromMapCache(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 map
      key - the key to remove
      Throws:
      IllegalStateException - if cacheKey does not exist
    • clearMapCache

      void clearMapCache(String cacheKey)
      Clear a map cache by its key.
      Parameters:
      cacheKey - the cache key
      Throws:
      IllegalStateException - if cacheKey does not exist
    • hasCacheKey

      boolean hasCacheKey(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.