Implemented a globally unique next id generator in FlowObjectStore

Change-Id: Ib98b2996e1ebcca56ad816ea94f25d838c5f4d44
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 690fcc7..fd6ac55 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
@@ -47,4 +47,10 @@
      */
     void next(DeviceId deviceId, NextObjective nextObjective);
 
+    /**
+     * Obtains a globally unique next objective.
+     * @return an integer
+     */
+    int allocateNextId();
+
 }
diff --git a/core/api/src/main/java/org/onosproject/net/flowobjective/FlowObjectiveStore.java b/core/api/src/main/java/org/onosproject/net/flowobjective/FlowObjectiveStore.java
index e667618..033558c 100644
--- a/core/api/src/main/java/org/onosproject/net/flowobjective/FlowObjectiveStore.java
+++ b/core/api/src/main/java/org/onosproject/net/flowobjective/FlowObjectiveStore.java
@@ -38,4 +38,11 @@
      * @return a next group
      */
     NextGroup getNextGroup(Integer nextId);
+
+    /**
+     * Allocates a next objective id. This id is globally unique
+     *
+     * @return an integer
+     */
+    int allocateNextId();
 }