|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.servicemix.store.mongo.MongoStore
public class MongoStore
A store which uses MongoDB.
| Field Summary |
|---|
| Fields inherited from interface org.apache.servicemix.store.Store |
|---|
CLUSTERED, PERSISTENT, TRANSACTIONAL |
| Constructor Summary | |
|---|---|
MongoStore(com.mongodb.DB db,
java.lang.String collectionName)
Constructor with the Mongo DB and collection name to use. |
|
MongoStore(com.mongodb.DB db,
java.lang.String collectionName,
java.lang.Long timeout)
Constructor with the Mongo DB and collection name to use. |
|
| Method Summary | |
|---|---|
protected void |
evict()
Removes objects that have been expired. |
boolean |
hasFeature(java.lang.String feature)
Returns true if feature is provided by the store, false else. |
java.lang.Object |
load(java.lang.String id)
Retrieves the data of the object with the given . |
java.lang.Object |
peek(java.lang.String id)
Retrieves the data of the object with the given without removing it. |
java.lang.String |
store(java.lang.Object data)
Stores to a DBObject and return the generated ID. |
void |
store(java.lang.String id,
java.lang.Object data)
Stores to a DBObject with the given . |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MongoStore(com.mongodb.DB db,
java.lang.String collectionName)
Constructor with the Mongo DB and collection name to use.
db - the Mongo DB.collectionName - the Mongo collection name.
public MongoStore(com.mongodb.DB db,
java.lang.String collectionName,
java.lang.Long timeout)
Constructor with the Mongo DB and collection name to use. This constructor defines a connection timeout too.
db - the Mongo DB.collectionName - the Mongo collection name.timeout - the connection timeout.| Method Detail |
|---|
public boolean hasFeature(java.lang.String feature)
Returns true if feature is provided by the store, false else.
hasFeature in interface Storefeature - the feature.
public void store(java.lang.String id,
java.lang.Object data)
throws java.io.IOException
Stores to a DBObject with the given .
store in interface Storeid - the id of the object to storedata - the object to store
java.io.IOException
public java.lang.String store(java.lang.Object data)
throws java.io.IOException
Stores to a DBObject and return the generated ID.
store in interface Storedata - the object to store
java.io.IOException
public java.lang.Object load(java.lang.String id)
throws java.io.IOException
Retrieves the data of the object with the given .
load in interface Storeid - the id of the object
java.io.IOException
public java.lang.Object peek(java.lang.String id)
throws java.io.IOException
Retrieves the data of the object with the given without removing it.
peek in interface Storeid - the id of the object
java.io.IOExceptionprotected void evict()
Removes objects that have been expired.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||