Update MRI projects for Aluminium
[openflowplugin.git] / applications / southbound-cli / src / main / java / org / opendaylight / openflowplugin / applications / southboundcli / cli / ReconciliationCount.java
index bb59716956c9c7ccec8381a6715f5ab52c7e4cfb..8290d799699d308a744948c41910686e34f0b3cd 100644 (file)
@@ -8,11 +8,11 @@
 
 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;
 
@@ -26,21 +26,22 @@ public class ReconciliationCount extends OsgiCommandSupport {
         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();