Resource group to share resources between intents

Change-Id: I5bf7d4261197449924d07dabac841cf8ccbe9389
diff --git a/core/api/src/main/java/org/onosproject/net/intent/LinkCollectionIntent.java b/core/api/src/main/java/org/onosproject/net/intent/LinkCollectionIntent.java
index 2b5d663..0361e98 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/LinkCollectionIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/LinkCollectionIntent.java
@@ -27,6 +27,7 @@
 import org.onosproject.net.FilteredConnectPoint;
 import org.onosproject.net.Link;
 import org.onosproject.net.NetworkResource;
+import org.onosproject.net.ResourceGroup;
 import org.onosproject.net.flow.TrafficSelector;
 import org.onosproject.net.flow.TrafficTreatment;
 
@@ -67,6 +68,7 @@
      * @param priority    priority to use for the flows generated by this intent
      * @param egressTreatment true if treatment should be applied by the egress device
      * @param cost the cost of the links
+     * @param resourceGroup resource group for this intent
      * @throws NullPointerException {@code path} is null
      */
     private LinkCollectionIntent(ApplicationId appId,
@@ -80,8 +82,9 @@
                                  List<Constraint> constraints,
                                  int priority,
                                  boolean egressTreatment,
-                                 double cost) {
-        super(appId, key, resources(resources, links), selector, treatment, constraints, priority);
+                                 double cost,
+                                 ResourceGroup resourceGroup) {
+        super(appId, key, resources(resources, links), selector, treatment, constraints, priority, resourceGroup);
         this.links = links;
         this.ingressPoints = ingressPoints;
         this.egressPoints = egressPoints;
@@ -163,6 +166,11 @@
             return (Builder) super.resources(resources);
         }
 
+        @Override
+        public Builder resourceGroup(ResourceGroup resourceGroup) {
+            return (Builder) super.resourceGroup(resourceGroup);
+        }
+
         /**
          * Sets the ingress point of the single point to multi point intent
          * that will be built.
@@ -280,7 +288,8 @@
                     constraints,
                     priority,
                     egressTreatmentFlag,
-                    cost
+                    cost,
+                    resourceGroup
             );
         }
     }
@@ -372,7 +381,8 @@
                 .add("links", links())
                 .add("ingress", ingressPoints())
                 .add("egress", egressPoints())
-                .add("treatementOnEgress", applyTreatmentOnEgress())
+                .add("treatmentOnEgress", applyTreatmentOnEgress())
+                .add("resourceGroup", resourceGroup())
                 .add("cost", cost())
                 .toString();
     }