public class CouchbaseCache extends Object implements Cache
CouchbaseCache class implements the Spring Cache interface on top of Couchbase Server and the Couchbase
Java SDK.Cache.ValueWrapper| Constructor and Description |
|---|
CouchbaseCache(String name,
com.couchbase.client.CouchbaseClient client)
Construct the cache and pass in the CouchbaseClient instance.
|
CouchbaseCache(String name,
com.couchbase.client.CouchbaseClient client,
int ttl)
Construct the cache and pass in the CouchbaseClient instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the complete cache.
|
void |
evict(Object key)
Remove an object from Couchbase.
|
Cache.ValueWrapper |
get(Object key)
Get an element from the cache.
|
<T> T |
get(Object key,
Class<T> clazz) |
String |
getName()
Returns the name of the cache.
|
com.couchbase.client.CouchbaseClient |
getNativeCache()
Returns the actual CouchbaseClient instance.
|
int |
getTtl()
Returns the TTL value for this cache.
|
void |
put(Object key,
Object value)
Store a object in Couchbase.
|
Cache.ValueWrapper |
putIfAbsent(Object key,
Object value) |
public CouchbaseCache(String name, com.couchbase.client.CouchbaseClient client)
name - the name of the cache reference.client - the CouchbaseClient instance.public CouchbaseCache(String name, com.couchbase.client.CouchbaseClient client, int ttl)
name - the name of the cache reference.client - the CouchbaseClient instance.ttl - TTL value for objects in this cachepublic final String getName()
public final com.couchbase.client.CouchbaseClient getNativeCache()
getNativeCache in interface Cachepublic final int getTtl()
public final Cache.ValueWrapper get(Object key)
public final void evict(Object key)
public final void clear()
public Cache.ValueWrapper putIfAbsent(Object key, Object value)
putIfAbsent in interface CacheCopyright © 2011-2015–2016 Pivotal Software, Inc.. All rights reserved.