this.nodeListener = nodeListener;
}
+ @SuppressWarnings("checkstyle:RegexpSinglelineJava")
@Override
protected Object doExecute() throws Exception {
List<OFNode> ofNodeList = ShellUtil.getAllNodes(nodeListener);
if (ofNodeList.isEmpty()) {
- session.getConsole().println("No node is connected yet");
+ System.out.println("No node is connected yet");
} else {
StringBuilder stringBuilder = new StringBuilder();
Formatter formatter = new Formatter(stringBuilder);
- session.getConsole().println("Number of nodes: " + ofNodeList.size());
- session.getConsole().println(getAllLocalNodesHeaderOutput());
- session.getConsole().println("--------------------------------------------------------------------------");
+ System.out.println("Number of nodes: " + ofNodeList.size());
+ System.out.println(getAllLocalNodesHeaderOutput());
+ System.out.println("--------------------------------------------------------------------------");
for (OFNode ofNode : ofNodeList) {
- session.getConsole().println(formatter.format("%-15s %3s %-15s %n",
+ System.out.println(formatter.format("%-15s %3s %-15s %n",
ofNode.getNodeId(), "", ofNode.getNodeName()).toString());
stringBuilder.setLength(0);
}
formatter.close();
return header;
}
-}
+}
\ No newline at end of file
@Option(name = "-all", description = "Reconcile all operative NODEs")
boolean reconcileAllNodes;
+ @SuppressWarnings("checkstyle:RegexpSinglelineJava")
@Override
protected Object doExecute() throws Exception {
List<Uint64> nodes = nodeIds == null
try {
RpcResult<ReconcileOutput> rpcResult = rpcOutput.get();
if (rpcResult.isSuccessful()) {
- session.getConsole().println("Reconciliation triggered for the node(s)");
+ System.out.println("Reconciliation triggered for the node(s)");
printInProgressNodes(rpcResult.getResult());
} else {
- session.getConsole().println(rpcResult.getErrors().stream().findFirst().get().getMessage());
+ System.out.println(rpcResult.getErrors().stream().findFirst().get().getMessage());
}
} catch (ExecutionException e) {
LOG.error("Error occurred while invoking reconcile RPC for node {}", nodes, e);
return null;
}
+ @SuppressWarnings("checkstyle:RegexpSinglelineJava")
private void printInProgressNodes(ReconcileOutput reconcileOutput) {
List<Uint64> inprogressNodes = reconcileOutput.getInprogressNodes();
if (inprogressNodes.size() > 0) {
StringBuilder stringBuilder = new StringBuilder();
final Formatter formatter = new Formatter(stringBuilder);
- session.getConsole().println(getReconcileHeaderOutput());
- session.getConsole().println("----------------------------------------------------");
+ System.out.println(getReconcileHeaderOutput());
+ System.out.println("----------------------------------------------------");
for (Uint64 node : inprogressNodes) {
- session.getConsole().println(formatter.format("%-15s %n", node).toString());
+ System.out.println(formatter.format("%-15s %n",node).toString());
stringBuilder.setLength(0);
}
}
this.dataBroker = dataBroker;
}
+ @SuppressWarnings("checkstyle:RegexpSinglelineJava")
@Override
protected Object doExecute() {
List<ReconcileCounter> result = ShellUtil.getReconcileCount(dataBroker);
if (result.isEmpty()) {
- session.getConsole().println("Reconciliation count not yet available for openflow nodes.");
+ System.out.println("Reconciliation count not yet available for openflow nodes.");
} else {
StringBuilder stringBuilder = new StringBuilder();
final Formatter formatter = new Formatter(stringBuilder);
- session.getConsole().println(getReconcileCountHeaderOutput());
- session.getConsole().println("--------------------------------------------------------------------------"
+ System.out.println(getReconcileCountHeaderOutput());
+ System.out.println("--------------------------------------------------------------------------"
+ "---------------------------");
for (ReconcileCounter reconcile : result) {
- session.getConsole().println(formatter.format("%-15s %3s %-15s %9s %-20s %4s %-20s %n",
+ System.out.println(formatter.format("%-15s %3s %-15s %9s %-20s %4s %-20s %n",
reconcile.getNodeId(), "", reconcile.getSuccessCount(), "", reconcile.getFailureCount(), "",
reconcile.getLastRequestTime().getValue()).toString());
stringBuilder.setLength(0);
this.dataBroker = dataBroker;
}
+ @SuppressWarnings("checkstyle:RegexpSinglelineJava")
@Override
protected Object doExecute() {
if (nodeId == null) {
- session.getConsole().println("NodeID not specified");
+ System.out.println("NodeID not specified");
return null;
}
OFNode node = ShellUtil.getNode(Long.parseLong(nodeId), dataBroker);
printHeaderSeparator();
printNodeOutput(node);
} else {
- session.getConsole().println("No node available for this NodeID");
+ System.out.println("No node available for this NodeID");
}
return null;
}
+ @SuppressWarnings("checkstyle:RegexpSinglelineJava")
private void printNodeHeaderOutput() {
Formatter formatter = new Formatter();
String header = formatter.format(OUTPUT_FORMAT, "NodeId", "Name", "Ports").toString();
formatter.close();
- session.getConsole().println(header);
+ System.out.println(header);
}
+ @SuppressWarnings("checkstyle:RegexpSinglelineJava")
private void printHeaderSeparator() {
- session.getConsole().println(HEADER_SEPARATOR);
+ System.out.println(HEADER_SEPARATOR);
}
@SuppressWarnings("checkstyle:RegexpSinglelineJava")