class MemcacheClientWrapper extends AbstractMemcacheClientWrapper
Constructor and Description |
---|
MemcacheClientWrapper(net.spy.memcached.MemcachedClientIF memcachedClient) |
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) |
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 expiration) |
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.
|
delete
MemcacheClientWrapper(net.spy.memcached.MemcachedClientIF memcachedClient)
public boolean add(String key, int exp, Object value) throws TimeoutException, CacheException
TimeoutException
CacheException
public <T> boolean add(String key, int exp, T value, CacheTranscoder transcoder) throws TimeoutException, CacheException
TimeoutException
CacheException
public long decr(String key, int by) throws TimeoutException, CacheException
TimeoutException
CacheException
public long decr(String key, int by, long def) throws TimeoutException, CacheException
TimeoutException
CacheException
public boolean delete(String key) throws TimeoutException, CacheException
CacheClient
key
- the keyTimeoutException
CacheException
public void flush() throws CacheException
CacheClient
CacheException
public Object get(String key) throws TimeoutException, CacheException
CacheClient
key
- the keyTimeoutException
CacheException
public <T> T get(String key, CacheTranscoder transcoder) throws CacheException, TimeoutException
CacheClient
key
- the keytranscoder
- the transcoder to useCacheException
TimeoutException
public <T> T get(String key, CacheTranscoder transcoder, long timeout) throws TimeoutException, CacheException
CacheClient
key
- the keytranscoder
- the transcoder to usetimeout
- the timeout, if the method is not returned in this time, throws TimeoutExceptionTimeoutException
CacheException
public Collection<SocketAddress> getAvailableServers()
CacheClient
public Map<String,Object> getBulk(Collection<String> keys) throws TimeoutException, CacheException
TimeoutException
CacheException
public <T> Map<String,T> getBulk(Collection<String> keys, CacheTranscoder transcoder) throws TimeoutException, CacheException
TimeoutException
CacheException
public long incr(String key, int by) throws TimeoutException, CacheException
TimeoutException
CacheException
public long incr(String key, int by, long def) throws TimeoutException, CacheException
TimeoutException
CacheException
public long incr(String key, int by, long def, int expiration) throws TimeoutException, CacheException
TimeoutException
CacheException
public boolean set(String key, int exp, Object value) throws TimeoutException, CacheException
TimeoutException
CacheException
public <T> boolean set(String key, int exp, T value, CacheTranscoder transcoder) throws TimeoutException, CacheException
CacheClient
key
- stored keyexp
- expire timevalue
- stored datatranscoder
- the transcoder to useTimeoutException
CacheException
public void shutdown()
CacheClient
public CacheTranscoder getTranscoder()
CacheClient
public Object getNativeClient()
CacheClient
Copyright © 2019. All rights reserved.