Fixes/improvements containing the following six listed changes
[vpnservice.git] / fibmanager / fibmanager-shell / src / main / java / org / opendaylight / vpnservice / fibmanager / shell / ShowFibCommand.java
diff --git a/fibmanager/fibmanager-shell/src/main/java/org/opendaylight/vpnservice/fibmanager/shell/ShowFibCommand.java b/fibmanager/fibmanager-shell/src/main/java/org/opendaylight/vpnservice/fibmanager/shell/ShowFibCommand.java
new file mode 100644 (file)
index 0000000..4a8d4d6
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.vpnservice.fibmanager.shell;
+
+import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.fibmanager.api.IFibManager;
+
+@Command(scope = "vpnservice", name = "fib-show", description = "Displays fib entries")
+public class ShowFibCommand extends OsgiCommandSupport {
+    private IFibManager fibManager;
+
+    public void setFibManager(IFibManager fibManager) {
+        this.fibManager = fibManager;
+    }
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for (String p : fibManager.printFibEntries()) {
+            System.out.println(p);
+        }
+        return null;
+    }
+}