
public interface CacheClient
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(String key,
int exp,
Object value) |
<T> boolean |
add(String key,
int exp,
T value,
CacheTranscoder transcoder) |
long |
decr(String key,
int by) |
long |
decr(String key,
int by,
long def) |
void |
delete(Collection<String> keys)
Deletes values under given keys.
|
boolean |
delete(String key)
Deletes value under given key.
|
void |
flush()
Flushes all data.
|
Object |
get(String key)
Get value by key.
|
<T> T |
get(String key,
CacheTranscoder transcoder)
Get value by key.
|
<T> T |
get(String key,
CacheTranscoder transcoder,
long timeout)
Get value by key.
|
Collection<SocketAddress> |
getAvailableServers()
Gets available cache servers.
|
Map<String,Object> |
getBulk(Collection<String> keys) |
<T> Map<String,T> |
getBulk(Collection<String> keys,
CacheTranscoder transcoder) |
Object |
getNativeClient()
Expose native memcached client.
|
CacheTranscoder |
getTranscoder()
Gets default transcoder.
|
long |
incr(String key,
int by) |
long |
incr(String key,
int by,
long def) |
long |
incr(String key,
int by,
long def,
int exp) |
boolean |
set(String key,
int exp,
Object value) |
<T> boolean |
set(String key,
int exp,
T value,
CacheTranscoder transcoder)
Store key-value item to memcached.
|
void |
shutdown()
Shutdowns memcached client.
|
boolean add(String key, int exp, Object value) throws TimeoutException, CacheException
TimeoutExceptionCacheException<T> boolean add(String key, int exp, T value, CacheTranscoder transcoder) throws TimeoutException, CacheException
TimeoutExceptionCacheExceptionlong decr(String key, int by) throws TimeoutException, CacheException
TimeoutExceptionCacheExceptionlong decr(String key, int by, long def) throws TimeoutException, CacheException
TimeoutExceptionCacheExceptionboolean delete(String key) throws TimeoutException, CacheException
key - the keyTimeoutExceptionCacheExceptionvoid delete(Collection<String> keys) throws TimeoutException, CacheException
keys - TimeoutExceptionCacheExceptionvoid flush()
throws TimeoutException,
CacheException
TimeoutExceptionCacheExceptionObject get(String key) throws TimeoutException, CacheException
key - the keyTimeoutExceptionCacheException<T> T get(String key, CacheTranscoder transcoder) throws TimeoutException, CacheException
T - key - the keytranscoder - the transcoder to useTimeoutExceptionCacheException<T> T get(String key, CacheTranscoder transcoder, long timeout) throws TimeoutException, CacheException
T - key - the keytranscoder - the transcoder to usetimeout - the timeout, if the method is not returned in this time, throws TimeoutExceptionTimeoutExceptionCacheExceptionCollection<SocketAddress> getAvailableServers()
Map<String,Object> getBulk(Collection<String> keys) throws TimeoutException, CacheException
TimeoutExceptionCacheException<T> Map<String,T> getBulk(Collection<String> keys, CacheTranscoder transcoder) throws TimeoutException, CacheException
TimeoutExceptionCacheExceptionCacheTranscoder getTranscoder()
long incr(String key, int by) throws TimeoutException, CacheException
TimeoutExceptionCacheExceptionlong incr(String key, int by, long def) throws TimeoutException, CacheException
TimeoutExceptionCacheExceptionlong incr(String key, int by, long def, int exp) throws TimeoutException, CacheException
TimeoutExceptionCacheExceptionboolean set(String key, int exp, Object value) throws TimeoutException, CacheException
TimeoutExceptionCacheException<T> boolean set(String key, int exp, T value, CacheTranscoder transcoder) throws TimeoutException, CacheException
T - key - stored keyexp - expire timevalue - stored datatranscoder - the transcoder to useTimeoutExceptionCacheExceptionvoid shutdown()
Object getNativeClient()
Copyright © 2019. All rights reserved.