CLI command to help debug the mapping of next-Objectives to the
groups that are created by device drivers.

Change-Id: Iff9e04e5e96b2cabbdb40e83215315d2e27791a6
diff --git a/cli/src/main/java/org/onosproject/cli/net/FlowObjectiveNextListCommand.java b/cli/src/main/java/org/onosproject/cli/net/FlowObjectiveNextListCommand.java
new file mode 100644
index 0000000..0b3c09c
--- /dev/null
+++ b/cli/src/main/java/org/onosproject/cli/net/FlowObjectiveNextListCommand.java
@@ -0,0 +1,33 @@
+package org.onosproject.cli.net;
+
+import java.util.List;
+
+//import org.apache.karaf.shell.commands.Argument;
+import org.apache.karaf.shell.commands.Command;
+import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.net.flowobjective.FlowObjectiveService;
+
+/**
+ * Returns a mapping of FlowObjective next-ids to the groups that get created
+ * by a device driver.
+ */
+@Command(scope = "onos", name = "next-ids",
+        description = "flow-objective next-ids to group-ids mapping")
+public class FlowObjectiveNextListCommand extends AbstractShellCommand {
+
+    /*@Argument(index = 1, name = "uri", description = "Device ID",
+            required = false, multiValued = false)
+    String uri = null;
+     */
+    private static final String FORMAT_MAPPING =
+            "  %s";
+    @Override
+    protected void execute() {
+        FlowObjectiveService service = get(FlowObjectiveService.class);
+        printNexts(service.getNextMappings());
+    }
+
+    private void printNexts(List<String> nextGroupMappings) {
+        nextGroupMappings.forEach(str -> print(FORMAT_MAPPING, str));
+    }
+}
diff --git a/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
index a98a38a..a7f533e 100644
--- a/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
+++ b/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -27,6 +27,10 @@
         </command>
 
         <command>
+            <action class="org.onosproject.cli.net.FlowObjectiveNextListCommand"/>
+        </command>
+
+        <command>
             <action class="org.onosproject.cli.net.FlowObjectiveCompositionCommand"/>
         </command>