public class DefaultCouchbaseCacheWriter extends Object implements CouchbaseCacheWriter
| Constructor and Description |
|---|
DefaultCouchbaseCacheWriter(CouchbaseClientFactory clientFactory) |
| Modifier and Type | Method and Description |
|---|---|
long |
clear(String collectionName,
String pattern)
Clears the cache with the given key pattern prefix.
|
Object |
get(String collectionName,
String key,
com.couchbase.client.java.codec.Transcoder transcoder)
Get the binary value representation from Couchbase stored for the given key.
|
void |
put(String collectionName,
String key,
Object value,
Duration expiry,
com.couchbase.client.java.codec.Transcoder transcoder)
Write the given key/value pair to Couchbase an set the expiration time if defined.
|
Object |
putIfAbsent(String collectionName,
String key,
Object value,
Duration expiry,
com.couchbase.client.java.codec.Transcoder transcoder)
Write the given value to Couchbase if the key does not already exist.
|
boolean |
remove(String collectionName,
String key)
Remove the given key from Couchbase.
|
public DefaultCouchbaseCacheWriter(CouchbaseClientFactory clientFactory)
public void put(String collectionName, String key, Object value, Duration expiry, com.couchbase.client.java.codec.Transcoder transcoder)
CouchbaseCacheWriterput in interface CouchbaseCacheWritercollectionName - The cache name must not be null.key - The key for the cache entry. Must not be null.value - The value stored for the key. Must not be null.expiry - Optional expiration time. Can be null.transcoder - Optional transcoder to use. Can be null.public Object putIfAbsent(String collectionName, String key, Object value, Duration expiry, com.couchbase.client.java.codec.Transcoder transcoder)
CouchbaseCacheWriterputIfAbsent in interface CouchbaseCacheWritercollectionName - The cache name must not be null.key - The key for the cache entry. Must not be null.value - The value stored for the key. Must not be null.expiry - Optional expiration time. Can be null.transcoder - Optional transcoder to use. Can be null.public Object get(String collectionName, String key, com.couchbase.client.java.codec.Transcoder transcoder)
CouchbaseCacheWriterget in interface CouchbaseCacheWritercollectionName - must not be null.key - must not be null.transcoder - Optional transcoder to use. Can be null.public boolean remove(String collectionName, String key)
CouchbaseCacheWriterremove in interface CouchbaseCacheWritercollectionName - The cache name must not be null.key - The key for the cache entry. Must not be null.public long clear(String collectionName, String pattern)
CouchbaseCacheWriterclear in interface CouchbaseCacheWriterpattern - the pattern to clear.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.