Interface ResourceDataCache


public interface ResourceDataCache
Abstraction that represents the underlying cache store.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Remove all mappings from the cache.
    void
    Evict the mapping for this key from this cache if it is present.
    Finds a cached data object for a Resource representation from the underlying cache store by the given key.
    void
    putData(Object key, Object data)
    Associates the specified cacheable data object for a Resource representation with the specified key in the underlying cache store.
    Associates the specified cacheable data object for a Resource representation with the specified key in the underlying cache store if it is not set already.
  • Method Details

    • getData

      Object getData(Object key)
      Finds a cached data object for a Resource representation from the underlying cache store by the given key.
      Parameters:
      key - cache key
      Returns:
      a cached data object for a Resource representation from the underlying cache store by the given key
    • putData

      void putData(Object key, Object data)
      Associates the specified cacheable data object for a Resource representation with the specified key in the underlying cache store.

      If the cache previously contained a mapping for this key, the old cache data object is replaced by the specified cacheable data object.

      Parameters:
      key - cache key
      data - cacheable data object for a Resource representation
    • putDataIfAbsent

      Object putDataIfAbsent(Object key, Object data)
      Associates the specified cacheable data object for a Resource representation with the specified key in the underlying cache store if it is not set already.

      If the cache previously contained a mapping for this key, the existing cache data object is not going to be replaced by the specified cacheable data object, but the existing cache data object will be simply returned without replacement. If there was no mapping for this key, then it should return null instead.

      Parameters:
      key - cache key
      data - cacheable data object for a Resource representation
      Returns:
      If the cache previously contained a mapping for this key, the existing cache data object is not going to be replaced by the specified cacheable data object, but the existing cache data object will be simply returned without replacement. If there was no mapping for this key, then it should return null instead.
    • evictData

      void evictData(Object key)
      Evict the mapping for this key from this cache if it is present.
      Parameters:
      key - cache key
    • clear

      void clear()
      Remove all mappings from the cache.