Class CouchbaseCache
java.lang.Object
org.springframework.cache.support.AbstractValueAdaptingCache
org.springframework.data.couchbase.cache.CouchbaseCache
- All Implemented Interfaces:
Cache
Couchbase-backed Cache Methods that take a Class return non-wrapped objects - cache-miss cannot be distinguished from
cached null - this is what AbstractValueAdaptingCache does Methods that do not take a Class return wrapped objects -
the wrapper is null for cache-miss - the exception is T get(final Object key, final Callable<T> valueLoader), which
does not return a wrapper because if there is a cache-miss, it gets the value from valueLoader (and caches it). There
are anomalies with get(key, ValueLoader) - which returns non-wrapped object.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.cache.Cache
Cache.ValueRetrievalException, Cache.ValueWrapper
-
Constructor Summary
ModifierConstructorDescriptionprotected
CouchbaseCache
(String name, CouchbaseCacheWriter cacheWriter, CouchbaseCacheConfiguration cacheConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
protected String
convertKey
(Object key) Convertkey
to aString
representation used for cache key creation.protected String
createCacheKey
(Object key) Customization hook for creating cache key before it gets serialized.void
boolean
evictIfPresent
(Object key) <T> T
<T> T
<T> T
Returns the configuration for thisCouchbaseCache
.getName()
boolean
protected Object
protected Object
same as inherited, but passes clazz for transcodervoid
putIfAbsent
(Object key, Object value) <T> T
putIfAbsent
(Object key, Object value, Class<T> clazz) Not sure why this isn't in AbstractValueAdaptingCacheMethods inherited from class org.springframework.cache.support.AbstractValueAdaptingCache
fromStoreValue, get, isAllowNullValues, toStoreValue, toValueWrapper
-
Constructor Details
-
CouchbaseCache
protected CouchbaseCache(String name, CouchbaseCacheWriter cacheWriter, CouchbaseCacheConfiguration cacheConfig)
-
-
Method Details
-
getName
-
getNativeCache
-
lookup
same as inherited, but passes clazz for transcoder -
lookup
- Specified by:
lookup
in classAbstractValueAdaptingCache
-
getCacheConfiguration
Returns the configuration for thisCouchbaseCache
. -
get
-
get
- Specified by:
get
in interfaceCache
- Overrides:
get
in classAbstractValueAdaptingCache
-
get
-
put
-
putIfAbsent
-
putIfAbsent
Not sure why this isn't in AbstractValueAdaptingCache- Type Parameters:
T
-- Parameters:
key
-value
-clazz
-- Returns:
-
evict
-
evictIfPresent
-
invalidate
public boolean invalidate() -
clear
public void clear() -
createCacheKey
Customization hook for creating cache key before it gets serialized.- Parameters:
key
- will never be null.- Returns:
- never null.
-
convertKey
Convertkey
to aString
representation used for cache key creation.- Parameters:
key
- will never be null.- Returns:
- never null.
- Throws:
IllegalStateException
- ifkey
cannot be converted toString
.
-