REST API for obj-nextids
Change-Id: Ibad03de0a6ffa8a478037120c84edfe6722f4d9b
(cherry picked from commit 0acb326963dda08a5eef16134eca5cba84b8e75d)
diff --git a/core/api/src/main/java/org/onosproject/net/flowobjective/FlowObjectiveService.java b/core/api/src/main/java/org/onosproject/net/flowobjective/FlowObjectiveService.java
index 103691c..11a7f5f 100644
--- a/core/api/src/main/java/org/onosproject/net/flowobjective/FlowObjectiveService.java
+++ b/core/api/src/main/java/org/onosproject/net/flowobjective/FlowObjectiveService.java
@@ -24,6 +24,7 @@
import com.google.common.collect.ListMultimap;
import com.google.common.collect.Maps;
import org.apache.commons.lang.NotImplementedException;
+import org.apache.commons.lang3.tuple.Pair;
import org.onosproject.net.DeviceId;
/**
@@ -93,6 +94,18 @@
/**
* Retrieve all nextObjective to group mappings known to this onos instance,
+ * in a format meant for display via REST API, to help with debugging. Applications
+ * are only aware of next-Ids, while the group sub-system is only aware of group-ids.
+ * This method fills in the gap by providing information on the mapping
+ * between next-ids and group-ids done by device-drivers.
+ *
+ * @return a map of key as a pair of next-id and Device id to group-id mapping.
+ * Consumed by the REST API.
+ */
+ Map<Pair<Integer, DeviceId>, List<String>> getNextMappingsChain();
+
+ /**
+ * Retrieve all nextObjective to group mappings known to this onos instance,
* in a format meant for display on the CLI, to help with debugging. Applications
* are only aware of next-Ids, while the group sub-system is only aware of group-ids.
* This method fills in the gap by providing information on the mapping
diff --git a/core/api/src/test/java/org/onosproject/net/flowobjective/FlowObjectiveServiceAdapter.java b/core/api/src/test/java/org/onosproject/net/flowobjective/FlowObjectiveServiceAdapter.java
index 360c1f2..0b17ce8 100644
--- a/core/api/src/test/java/org/onosproject/net/flowobjective/FlowObjectiveServiceAdapter.java
+++ b/core/api/src/test/java/org/onosproject/net/flowobjective/FlowObjectiveServiceAdapter.java
@@ -17,7 +17,10 @@
package org.onosproject.net.flowobjective;
import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
import org.onosproject.net.DeviceId;
+import org.apache.commons.lang3.tuple.Pair;
+import java.util.Map;
import java.util.List;
@@ -65,4 +68,10 @@
public List<String> getPendingFlowObjectives() {
return ImmutableList.of();
}
+
+ @Override
+ public Map<Pair<Integer, DeviceId>, List<String>> getNextMappingsChain() {
+ return ImmutableMap.of();
+ }
+
}