Interface ResourceDataCache
-
public interface ResourceDataCache
Abstraction that represents the underlying cache store.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Remove all mappings from the cache.void
evictData(Object key)
Evict the mapping for thiskey
from this cache if it is present.Object
getData(Object key)
Finds a cached data object for aResource
representation from the underlying cache store by the givenkey
.void
putData(Object key, Object data)
Associates the specified cacheabledata
object for aResource
representation with the specifiedkey
in the underlying cache store.Object
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 Detail
-
getData
Object getData(Object key)
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
void putData(Object key, Object data)
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
Object 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.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
void evictData(Object key)
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.
-
-