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
TimeoutException
CacheException
<T> boolean add(String key, int exp, T value, CacheTranscoder transcoder) throws TimeoutException, CacheException
TimeoutException
CacheException
long decr(String key, int by) throws TimeoutException, CacheException
TimeoutException
CacheException
long decr(String key, int by, long def) throws TimeoutException, CacheException
TimeoutException
CacheException
boolean delete(String key) throws TimeoutException, CacheException
key
- the keyTimeoutException
CacheException
void delete(Collection<String> keys) throws TimeoutException, CacheException
keys
- TimeoutException
CacheException
void flush() throws TimeoutException, CacheException
TimeoutException
CacheException
Object get(String key) throws TimeoutException, CacheException
key
- the keyTimeoutException
CacheException
<T> T get(String key, CacheTranscoder transcoder) throws TimeoutException, CacheException
T
- key
- the keytranscoder
- the transcoder to useTimeoutException
CacheException
<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 TimeoutExceptionTimeoutException
CacheException
Collection<SocketAddress> getAvailableServers()
Map<String,Object> getBulk(Collection<String> keys) throws TimeoutException, CacheException
TimeoutException
CacheException
<T> Map<String,T> getBulk(Collection<String> keys, CacheTranscoder transcoder) throws TimeoutException, CacheException
TimeoutException
CacheException
CacheTranscoder getTranscoder()
long incr(String key, int by) throws TimeoutException, CacheException
TimeoutException
CacheException
long incr(String key, int by, long def) throws TimeoutException, CacheException
TimeoutException
CacheException
long incr(String key, int by, long def, int exp) throws TimeoutException, CacheException
TimeoutException
CacheException
boolean set(String key, int exp, Object value) throws TimeoutException, CacheException
TimeoutException
CacheException
<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 useTimeoutException
CacheException
void shutdown()
Object getNativeClient()
Copyright © 2019. All rights reserved.