
| Constructor and Description |
|---|
PrefixedCacheImpl(Cache cache,
String requestedName,
String namePrefixSeparator) |
| Modifier and Type | Method and Description |
|---|---|
<T> boolean |
add(String key,
int exp,
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.
|
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 key,
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 key,
int exp,
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.
|
public Collection<SocketAddress> getAvailableServers()
CachegetAvailableServers in interface Cachepublic Collection<String> getAliases()
CachegetAliases in interface Cachepublic CacheProperties getProperties()
getProperties in interface Cachepublic <T> boolean add(String key, int exp, Object value, SerializationType serializationType) throws TimeoutException, CacheException
Cacheadd in interface Cachekey - the keyexp - 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 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 <T> T get(String key, SerializationType serializationType) throws TimeoutException, CacheException
Cacheget in interface Cachekey - the keyserializationType - the type of serialization to useTimeoutExceptionCacheExceptionpublic Map<String,Object> getBulk(Collection<String> keys, SerializationType serializationType) throws TimeoutException, CacheException
getBulk 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 <T> void set(String key, int exp, Object value, SerializationType serializationType) throws TimeoutException, CacheException
Cacheset in interface Cachekey - stored keyexp - 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 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 CacheCopyright © 2019. All rights reserved.