|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.parthparekh.service.cache.CouchbaseImpl
public class CouchbaseImpl
Couchbase cache implementation
Field Summary | |
---|---|
private com.couchbase.client.CouchbaseClientIF |
cache
|
private static org.slf4j.Logger |
logger
|
private org.codehaus.jackson.map.ObjectMapper |
objectMapper
|
Constructor Summary | |
---|---|
CouchbaseImpl()
|
Method Summary | ||
---|---|---|
boolean |
evict(java.lang.String key)
Removes data from cache with specified key |
|
|
get(java.lang.String key,
java.lang.Class<T> clazz)
Retrieves data from cache with specified key |
|
CacheType |
getType()
Returns the CacheType for the cache |
|
|
put(java.lang.String key,
T value)
Adds data to the cache |
|
|
put(java.lang.String key,
T value,
int ttl)
Adds data to the cache with specific ttl |
|
void |
setCache(com.couchbase.client.CouchbaseClientIF cache)
|
|
void |
setObjectMapper(org.codehaus.jackson.map.ObjectMapper objectMapper)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static org.slf4j.Logger logger
private com.couchbase.client.CouchbaseClientIF cache
@Autowired @Qualifier(value="defaultObjectMapper") private org.codehaus.jackson.map.ObjectMapper objectMapper
Constructor Detail |
---|
public CouchbaseImpl()
Method Detail |
---|
public void setObjectMapper(org.codehaus.jackson.map.ObjectMapper objectMapper)
public void setCache(com.couchbase.client.CouchbaseClientIF cache)
public <T> boolean put(java.lang.String key, T value)
Cache
put
in interface Cache
key
- - cache keyvalue
- - value of object
public <T> boolean put(java.lang.String key, T value, int ttl)
Cache
put
in interface Cache
key
- - cache keyvalue
- - value of objectttl
- in seconds
public boolean evict(java.lang.String key)
Cache
evict
in interface Cache
key
- - cache key
public <T> T get(java.lang.String key, java.lang.Class<T> clazz)
Cache
get
in interface Cache
key
- - cache keyclazz
- - class type of object
public CacheType getType()
Cache
getType
in interface Cache
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |