edu.qut.cs.rcmd.common.mongo.cache
Class BaseMongoCache<K,V>

java.lang.Object
  extended by edu.qut.cs.rcmd.common.mongo.cache.BaseMongoCache<K,V>
All Implemented Interfaces:
MongoCache<K,V>
Direct Known Subclasses:
AutoFetchMongoCache

public class BaseMongoCache<K,V>
extends Object
implements MongoCache<K,V>


Field Summary
protected  com.mongodb.DBCollection dbCollection
           
 
Constructor Summary
BaseMongoCache(com.mongodb.DBCollection dbCollection)
           
 
Method Summary
 void clear()
           
 boolean containsKey(K key)
           
 V get(K key)
           
 void put(K key, V value)
           
protected  com.mongodb.DBObject toKeyDBObject(K key)
           
protected  V toValue(com.mongodb.DBObject dbObject)
           
protected  com.mongodb.DBObject toValueDBObject(V value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbCollection

protected com.mongodb.DBCollection dbCollection
Constructor Detail

BaseMongoCache

public BaseMongoCache(com.mongodb.DBCollection dbCollection)
Method Detail

get

public V get(K key)
Specified by:
get in interface MongoCache<K,V>

clear

public void clear()
Specified by:
clear in interface MongoCache<K,V>

put

public void put(K key,
                V value)
Specified by:
put in interface MongoCache<K,V>

containsKey

public boolean containsKey(K key)
Specified by:
containsKey in interface MongoCache<K,V>

toValueDBObject

protected com.mongodb.DBObject toValueDBObject(V value)

toKeyDBObject

protected com.mongodb.DBObject toKeyDBObject(K key)

toValue

protected V toValue(com.mongodb.DBObject dbObject)


Copyright © 2012. All Rights Reserved.