public class GetNodesCommand extends BaseCommand<Node>
Command for MongoMicroKernel#getNodes(String, String, int, long, int, String)nodeStore| Constructor and Description |
|---|
GetNodesCommand(MongoNodeStore nodeStore,
String path,
Long revisionId)
Constructs a new
GetNodesCommandMongo. |
| Modifier and Type | Method and Description |
|---|---|
Node |
execute()
Executes the
Command and returns its result. |
int |
getNumOfRetries()
Returns the number of retries this
Command should be retried in
case of an error or false result. |
boolean |
needsRetry(Exception e)
Will be called in case of an
Exception during the execution and
a given number of retries which has not exceeded. |
void |
setBranchId(String branchId)
Sets the branchId for the command.
|
void |
setDepth(int depth)
Sets the depth for the command.
|
needsRetrypublic GetNodesCommand(MongoNodeStore nodeStore, String path, Long revisionId)
GetNodesCommandMongo.nodeStore - Node store.path - The root path of the nodes to get.revisionId - The revision id or null for head revision.public void setBranchId(String branchId)
branchId - Branch id.public void setDepth(int depth)
depth - The depth for the command or -1 for limitless depth.public Node execute() throws Exception
CommandCommand and returns its result.Exception - If an error occurred while executing.public int getNumOfRetries()
CommandCommand should be retried in
case of an error or false result.
The number of reties is evaluated in the following way:
In order to determine whether the Command should be retired on
Command.needsRetry(Exception) or Command.needsRetry(Object) will be called.
getNumOfRetries in interface Command<Node>getNumOfRetries in class BaseCommand<Node>Command.needsRetry(Exception),
Command.needsRetry(Object)public boolean needsRetry(Exception e)
CommandException during the execution and
a given number of retries which has not exceeded.needsRetry in interface Command<Node>needsRetry in class BaseCommand<Node>e - The Exception which was thrown.true if a retry should be performed, else false.Copyright © 2012-2013 The Apache Software Foundation. All Rights Reserved.