| Modifier and Type | Field and Description |
|---|---|
static String |
COLLECTION_COMMITS |
static String |
COLLECTION_NODES |
static String |
COLLECTION_SYNC |
static String |
INITIAL_COMMIT_DIFF |
static String |
INITIAL_COMMIT_MESSAGE |
static String |
INITIAL_COMMIT_PATH |
| Constructor and Description |
|---|
MongoNodeStore(com.mongodb.DB db)
Constructs a new
NodeStoreMongo. |
| Modifier and Type | Method and Description |
|---|---|
void |
cache(Commit commit)
Caches the commit.
|
void |
cache(MongoNode node)
Caches the node.
|
String |
commit(Commit commit) |
String |
diff(String fromRevision,
String toRevision,
String path,
int depth) |
void |
evict(MongoCommit commit)
Evicts the commit from the
commitCache. |
com.mongodb.DBCollection |
getCommitCollection()
Returns the commit
DBCollection. |
MongoCommit |
getFromCache(long revisionId)
Returns the commit from the cache or null if the commit is not in the cache.
|
MongoNode |
getFromCache(String path,
String branchId,
long revisionId)
Returns the node from the cache or null if the node is not in the cache.
|
String |
getHeadRevision() |
String |
getJournal(String fromRevisionId,
String toRevisionId,
String path) |
com.mongodb.DBCollection |
getNodeCollection()
Returns the node
DBCollection. |
Node |
getNodes(String path,
String revisionId,
int depth,
long offset,
int maxChildNodes,
String filter) |
String |
getRevisionHistory(long since,
int maxEntries,
String path) |
com.mongodb.DBCollection |
getSyncCollection()
Returns the sync
DBCollection. |
String |
merge(String branchRevisionId,
String message) |
boolean |
nodeExists(String path,
String revisionId) |
String |
waitForCommit(String oldHeadRevisionId,
long timeout) |
public static final String INITIAL_COMMIT_MESSAGE
public static final String INITIAL_COMMIT_PATH
public static final String INITIAL_COMMIT_DIFF
public static final String COLLECTION_COMMITS
public static final String COLLECTION_NODES
public static final String COLLECTION_SYNC
public MongoNodeStore(com.mongodb.DB db)
NodeStoreMongo.db - Mongo DB.public String diff(String fromRevision, String toRevision, String path, int depth) throws Exception
diff in interface NodeStorefromRevision - a revision id, if null the current head revision is assumedtoRevision - another revision id, if null the current head revision is assumedpath - optional path filter; if null or "".
The default ("/") will be assumed, i.e. no filter will be applieddepth - Depth limit; if -1 no limit will be appliedorg.apache.jackrabbit.mk.api.MicroKernelException - if any of the specified revisions doesn't exist or if another error occursExceptionMicroKernel.diff(String, String, String, int)public String getHeadRevision() throws Exception
getHeadRevision in interface NodeStoreException - If an error occurred while retrieving the head revision.MicroKernel.getHeadRevision()public Node getNodes(String path, String revisionId, int depth, long offset, int maxChildNodes, String filter) throws Exception
getNodes in interface NodeStorepath - The path of the root of nodes to retrieve.revisionId - The revision id of the nodes or null if the latest head revision
should be retrieved.depth - The maximum depth of the retrieved node tree or -1 to retrieve all nodes.offset - The offset of the child list to retrieve.maxChildNodes - The count of children to retrieve or -1 to retrieve all children.filter - An optional filter for the retrieved nodes.Node of the root node.Exception - If an error occurred while retrieving the nodes.MicroKernel.getNodes(String, String, int, long, int, String)public boolean nodeExists(String path, String revisionId) throws Exception
nodeExists in interface NodeStorepath - The path of the node to test.revisionId - The revision id of the node or null for the head revision.true if the node for the specific revision exists else false.Exception - If an error occurred while testing the node.MicroKernel.nodeExists(String, String)public String getJournal(String fromRevisionId, String toRevisionId, String path) throws Exception
getJournal in interface NodeStorefromRevisionId - id of first revision to be returned in journaltoRevisionId - id of last revision to be returned in journal,
if null the current head revision is assumedpath - optional path filter; if null or ""
the default ("/") will be assumed, i.e. no filter will be appliedException - if an error occurred while getting the journal.MicroKernel.getJournal(String, String, String)public String getRevisionHistory(long since, int maxEntries, String path) throws Exception
getRevisionHistory in interface NodeStoresince - timestamp (ms) of earliest revision to be returnedmaxEntries - maximum #entries to be returned; if < 0, no limit will be applied.path - optional path filter; if null or "" the default
("/") will be assumed, i.e. no filter will be appliedException - if an error occurred while getting the revision history.MicroKernel.getRevisionHistory(long, int, String)public String waitForCommit(String oldHeadRevisionId, long timeout) throws Exception
waitForCommit in interface NodeStoreoldHeadRevisionId - id of earlier head revisiontimeout - the maximum time to wait in millisecondsException - if an error occurred while waiting.MicroKernel.waitForCommit(String, long)public com.mongodb.DBCollection getCommitCollection()
DBCollection.DBCollection.public com.mongodb.DBCollection getSyncCollection()
DBCollection.DBCollection.public com.mongodb.DBCollection getNodeCollection()
DBCollection.DBCollection.public void cache(Commit commit)
commit - Commit to cache.public void evict(MongoCommit commit)
commitCache.commit - the commit.public MongoCommit getFromCache(long revisionId)
revisionId - Commit revision id.public void cache(MongoNode node)
node - Node to cache.Copyright © 2012-2013 The Apache Software Foundation. All Rights Reserved.