First shot at Broadcom OFDPA 1.0 pipeline
Requires changes to the group description to accept groupId from callers.

Change-Id: Ic21dfe8ae7c246b7d3a6b00e8e5c986e1dc21fa0
diff --git a/core/api/src/main/java/org/onosproject/net/group/DefaultGroupDescription.java b/core/api/src/main/java/org/onosproject/net/group/DefaultGroupDescription.java
index 3ffb2c2..5ea2d2e 100644
--- a/core/api/src/main/java/org/onosproject/net/group/DefaultGroupDescription.java
+++ b/core/api/src/main/java/org/onosproject/net/group/DefaultGroupDescription.java
@@ -32,11 +32,17 @@
     private final GroupKey appCookie;
     private final ApplicationId appId;
     private final DeviceId deviceId;
+    private final Integer givenGroupId;
 
     /**
      * Constructor to be used by north bound applications.
      * NOTE: The caller of this subsystem MUST ensure the appCookie
-     * provided in this API is immutable
+     * provided in this API is immutable.
+     * NOTE: The caller may choose to pass in 'null' for the groupId. This is
+     * the typical case, where the caller allows the group subsystem to choose
+     * the groupId in a globally unique way. If the caller passes in the groupId,
+     * the caller MUST ensure that the id is globally unique (not just unique
+     * per device).
      *
      * @param deviceId device identifier
      * @param type type of the group
@@ -49,11 +55,13 @@
                                    GroupDescription.Type type,
                                    GroupBuckets buckets,
                                    GroupKey appCookie,
+                                   Integer groupId,
                                    ApplicationId appId) {
         this.type = checkNotNull(type);
         this.deviceId = checkNotNull(deviceId);
         this.buckets = checkNotNull(buckets);
         this.appCookie = appCookie;
+        this.givenGroupId = groupId;
         this.appId = appId;
     }
 
@@ -70,6 +78,7 @@
         this.buckets = groupDesc.buckets();
         this.appCookie = groupDesc.appCookie();
         this.appId = groupDesc.appId();
+        this.givenGroupId = groupDesc.givenGroupId();
     }
 
     /**
@@ -85,7 +94,7 @@
     public DefaultGroupDescription(DeviceId deviceId,
                                    GroupDescription.Type type,
                                    GroupBuckets buckets) {
-        this(deviceId, type, buckets, null, null);
+        this(deviceId, type, buckets, null, null, null);
     }
 
     /**
@@ -138,6 +147,17 @@
         return this.buckets;
     }
 
+    /**
+     * Returns groupId passed in by application.
+     *
+     * @return Integer group Id passed in by caller. May be null if caller passed
+     *                 in null during GroupDescription creation.
+     */
+    @Override
+    public Integer givenGroupId() {
+        return this.givenGroupId;
+    }
+
     @Override
     /*
      * The deviceId, type and buckets are used for hash.
@@ -177,6 +197,7 @@
                 .add("type", type)
                 .add("buckets", buckets)
                 .add("appId", appId)
+                .add("givenGroupId", givenGroupId)
                 .toString();
     }
 }
\ No newline at end of file