| Constructor and Description |
|---|
CacheMemcachedImpl(org.slf4j.Logger logger,
NinjaProperties ninjaProperties) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String key,
Object value,
int expiration)
Add object to cache.
|
void |
clear()
Clear all values in cache.
|
long |
decr(String key,
int by)
Decrements key by value.
|
void |
delete(String key)
Delete key from cache.
|
Object |
get(String key)
Returns the object for this key or null if not found.
|
Map<String,Object> |
get(String[] keys)
Returns all objects for the keys.
|
long |
incr(String key,
int by)
Increments key by value.
|
void |
replace(String key,
Object value,
int expiration)
Replaces key with new value.
|
boolean |
safeAdd(String key,
Object value,
int expiration)
Similar to
delete method. |
boolean |
safeDelete(String key)
Similar to
delete method. |
boolean |
safeReplace(String key,
Object value,
int expiration)
Similar to
delete method. |
boolean |
safeSet(String key,
Object value,
int expiration)
Similar to
delete method. |
void |
set(String key,
Object value,
int expiration)
Adds object of cache.
|
void |
stop() |
@Inject
public CacheMemcachedImpl(org.slf4j.Logger logger,
NinjaProperties ninjaProperties)
throws Exception
Exceptionpublic void add(String key, Object value, int expiration)
Cachepublic Object get(String key)
Cachepublic void clear()
Cachepublic void delete(String key)
Cachepublic Map<String,Object> get(String[] keys)
Cachepublic long incr(String key, int by)
Cachepublic long decr(String key, int by)
Cachepublic void replace(String key, Object value, int expiration)
Cachepublic boolean safeAdd(String key, Object value, int expiration)
Cachedelete method.
BUT it blocks until execution succeeds / fails AND wraps
exceptions in a simple true / false return valuepublic boolean safeDelete(String key)
Cachedelete method.
BUT it blocks until execution succeeds / fails AND wraps
exceptions in a simple true / false return valuesafeDelete in interface Cachekey - The key to deletepublic boolean safeReplace(String key, Object value, int expiration)
Cachedelete method.
BUT it blocks until execution succeeds / fails AND wraps
exceptions in a simple true / false return valuesafeReplace in interface Cachekey - The key of the object to use for caching.value - The value of the object to replace in the cache.expiration - Expiration time in seconds.public boolean safeSet(String key, Object value, int expiration)
Cachedelete method.
BUT it blocks until execution succeeds / fails AND wraps
exceptions in a simple true / false return valuepublic void set(String key, Object value, int expiration)
Cachepublic void stop()
Copyright © 2019 ninjaframework. All rights reserved.