// no arguments to read, just call getNodes
List resNodes = client.getNodes();
if (resNodes != null && resNodes.size() > 0) {
for (Iterator i = resNodes.iterator(); i.hasNext();) {
ResourceNode node = (ResourceNode) i.next();
System.out.println("node: [id=" + node.getNodeId()
+ ",capacity=" + node.getCapacity() + ",url="
+ node.getIpAddr() + "]");
}
}
} else if (operation.equals("--getExecNode")) {
String jobId = null;
for (int i = 4; i < args.length; i++) {
if (args[i].equals("--id")) {
jobId = args[++i];
}
}
if (jobId == null) {
System.err.println(getExecutionNodeOperation);
System.exit(1);
}
String execNode = client.getExecutionNode(jobId);
if (execNode == null || (execNode != null && execNode.equals(""))) {
System.out.println("Job: [" + jobId
+ "] not executing on any known node!");
} else {
System.out.println(execNode);
}
} else if (operation.equals("--kill")) {
String jobId = null;
for (int i = 4; i < args.length; i++) {
if (args[i].equals("--id")) {
jobId = args[++i];
}
}
if (jobId == null) {
System.err.println(killOperation);
System.exit(1);
}
if (client.killJob(jobId)) {
System.out.println("Job: [" + jobId + "] successfully killed.");
} else {
System.out.println("Unable to kill job: [" + jobId + "]");
}
} else if (operation.equals("--getNodeById")) {
String nodeId = null;
for (int i = 4; i < args.length; i++) {
if (args[i].equals("--nodeId")) {
nodeId = args[++i];
}
}
if (nodeId == null) {
System.err.println(getNodeByIdOperation);
System.exit(1);
}
ResourceNode node = client.getNodeById(nodeId);
if (node != null) {
System.out.println("node: [id=" + node.getNodeId()
+ ",capacity=" + node.getCapacity() + ",url="
+ node.getIpAddr() + "]");
}
} else if (operation.equals("--getJobInfo")) {
String jobId = null;
for (int i = 4; i < args.length; i++) {