
| Constructor and Description |
|---|
CacheImpl(String name,
Collection<String> aliases,
CacheClient cacheClient,
SerializationType defaultSerializationType,
JsonTranscoder jsonTranscoder,
JavaTranscoder javaTranscoder,
CacheTranscoder customTranscoder,
CacheProperties properties) |
| Modifier and Type | Method and Description |
|---|---|
<T> boolean |
add(String cacheKey,
int expiration,
Object value,
SerializationType serializationType)
Add object to cache if it doesn't exist.
|
<T> boolean |
addSilently(String cacheKey,
int expiration,
Object value,
SerializationType serializationType)
Add object to cache if it doesn't exist.
|
(package private) void |
changeCacheClient(CacheClient newCacheClient) |
long |
decr(String key,
int by)
Decrement counter in cache by given value.
|
void |
delete(Collection<String> keys)
Deletes values under given keys.
|
boolean |
delete(String key)
Deletes value under given key.
|
void |
flush()
Flushes all data.
|
<T> T |
get(String cacheKey,
SerializationType serializationType)
Get value by key.
|
Collection<String> |
getAliases()
Gets optional cache's aliases.
|
Collection<SocketAddress> |
getAvailableServers()
Gets available cache servers.
|
Map<String,Object> |
getBulk(Collection<String> keys,
SerializationType serializationType) |
Long |
getCounter(String cacheKey)
Gets counter from cache without incrementing.
|
String |
getName()
Gets name of the cache.
|
Object |
getNativeClient()
Expose native memcached client.
|
CacheProperties |
getProperties() |
long |
incr(String key,
int by,
long def)
Increments counter in cache by given value.
|
long |
incr(String key,
int by,
long def,
int exp)
Increments counter in cache by given value.
|
boolean |
isEnabled() |
<T> void |
set(String cacheKey,
int expiration,
Object value,
SerializationType serializationType)
Store key-value item to memcached.
|
void |
setCounter(String cacheKey,
int expiration,
long value)
Sets initial value of counter.
|
<T> void |
setSilently(String cacheKey,
int expiration,
Object value,
SerializationType serializationType)
Store key-value item to memcached.
|
void |
shutdown()
Shutdowns cache.
|
CacheImpl(String name, Collection<String> aliases, CacheClient cacheClient, SerializationType defaultSerializationType, JsonTranscoder jsonTranscoder, JavaTranscoder javaTranscoder, CacheTranscoder customTranscoder, CacheProperties properties)
public Collection<SocketAddress> getAvailableServers()
CachegetAvailableServers in interface Cachepublic <T> T get(String cacheKey, SerializationType serializationType) throws TimeoutException, CacheException
Cacheget in interface CachecacheKey - the keyserializationType - the type of serialization to useTimeoutExceptionCacheExceptionpublic <T> void set(String cacheKey, int expiration, Object value, SerializationType serializationType) throws TimeoutException, CacheException
Cacheset in interface CachecacheKey - stored keyexpiration - expiration time in seconds as defined in memcached specificationvalue - stored dataserializationType - the type of serialization to useTimeoutExceptionCacheExceptionpublic <T> void setSilently(String cacheKey, int expiration, Object value, SerializationType serializationType)
CachesetSilently in interface CachecacheKey - stored keyexpiration - expiration time in seconds as defined in memcached specificationvalue - stored dataserializationType - the type of serialization to usepublic <T> boolean add(String cacheKey, int expiration, Object value, SerializationType serializationType) throws TimeoutException, CacheException
Cacheadd in interface CachecacheKey - the keyexpiration - expiration time in seconds as defined in memcached specificationvalue - the value to addserializationType - type of serializationTimeoutExceptionCacheExceptionpublic <T> boolean addSilently(String cacheKey, int expiration, Object value, SerializationType serializationType)
CacheaddSilently in interface CachecacheKey - the cache keyexpiration - the expiration time in seconds as defined in memcached specificationvalue - the value to addserializationType - the type of serializationpublic Map<String,Object> getBulk(Collection<String> keys, SerializationType serializationType) throws TimeoutException, CacheException
getBulk in interface CacheTimeoutExceptionCacheExceptionpublic long decr(String key, int by) throws TimeoutException, CacheException
Cachedecr in interface Cachekey - the keyby - decrement valueTimeoutExceptionCacheExceptionpublic boolean delete(String key) throws TimeoutException, CacheException
Cachedelete in interface Cachekey - the keyTimeoutExceptionCacheExceptionpublic void delete(Collection<String> keys) throws TimeoutException, CacheException
Cachedelete in interface CacheTimeoutExceptionCacheExceptionpublic void flush()
throws TimeoutException,
CacheException
Cacheflush in interface CacheTimeoutExceptionCacheExceptionpublic long incr(String key, int by, long def) throws TimeoutException, CacheException
Cacheincr in interface Cachekey - the keyby - increment valuedef - initial valueTimeoutExceptionCacheExceptionpublic long incr(String key, int by, long def, int exp) throws TimeoutException, CacheException
Cacheincr in interface Cachekey - the keyby - increment valuedef - initial valueexp - expiration time in seconds as defined in memcached specificationTimeoutExceptionCacheExceptionpublic boolean isEnabled()
public Long getCounter(String cacheKey) throws TimeoutException, CacheException
CachegetCounter in interface CacheTimeoutExceptionCacheExceptionpublic void setCounter(String cacheKey, int expiration, long value) throws TimeoutException, CacheException
CachesetCounter in interface CachecacheKey - the keyexpiration - expiration time in seconds as defined in memcached specificationvalue - the valueTimeoutExceptionCacheExceptionpublic void shutdown()
Cachepublic Object getNativeClient()
CachegetNativeClient in interface Cachevoid changeCacheClient(CacheClient newCacheClient)
@Generated(value="lombok") public String getName()
Cache@Generated(value="lombok") public Collection<String> getAliases()
CachegetAliases in interface Cache@Generated(value="lombok") public CacheProperties getProperties()
getProperties in interface CacheCopyright © 2019. All rights reserved.