Interface ResourceDataCache
public interface ResourceDataCache
Abstraction that represents the underlying cache store.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Remove all mappings from the cache.void
Evict the mapping for thiskey
from this cache if it is present.Finds a cached data object for aResource
representation from the underlying cache store by the givenkey
.void
Associates the specified cacheabledata
object for aResource
representation with the specifiedkey
in the underlying cache store.putDataIfAbsent
(Object key, Object data) Associates the specified cacheabledata
object for aResource
representation with the specifiedkey
in the underlying cache store if it is not set already.
-
Method Details
-
getData
Finds a cached data object for aResource
representation from the underlying cache store by the givenkey
.- Parameters:
key
- cache key- Returns:
- a cached data object for a
Resource
representation from the underlying cache store by the givenkey
-
putData
Associates the specified cacheabledata
object for aResource
representation with the specifiedkey
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 keydata
- cacheabledata
object for aResource
representation
-
putDataIfAbsent
Associates the specified cacheabledata
object for aResource
representation with the specifiedkey
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 returnnull
instead.- Parameters:
key
- cache keydata
- cacheabledata
object for aResource
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 returnnull
instead.
-
evictData
Evict the mapping for thiskey
from this cache if it is present.- Parameters:
key
- cache key
-
clear
void clear()Remove all mappings from the cache.
-