package org.opendaylight.openflowplugin.applications.southboundcli.cli;
+import java.util.Collection;
import java.util.Formatter;
-import java.util.List;
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.openflowplugin.applications.southboundcli.util.ShellUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.app.reconciliation.service.rev180227.reconciliation.counter.ReconcileCounter;
this.dataBroker = dataBroker;
}
+ @SuppressWarnings("checkstyle:RegexpSinglelineJava")
@Override
- protected Object doExecute() throws Exception {
- List<ReconcileCounter> result = ShellUtil.getReconcileCount(dataBroker);
+ protected Object doExecute() {
+ Collection<ReconcileCounter> result = ShellUtil.getReconcileCount(dataBroker);
if (result.isEmpty()) {
- session.getConsole().println("Reconciliation is not yet completed or connected device not found.");
+ 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()).toString());
+ reconcile.getLastRequestTime().getValue()).toString());
stringBuilder.setLength(0);
}
formatter.close();