Resource group to share resources between intents

Change-Id: I5bf7d4261197449924d07dabac841cf8ccbe9389
diff --git a/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java b/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java
index 113845d..827a042 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java
@@ -21,6 +21,7 @@
 import org.onosproject.core.ApplicationId;
 import org.onosproject.net.Link;
 import org.onosproject.net.NetworkResource;
+import org.onosproject.net.ResourceGroup;
 import org.onosproject.net.flow.DefaultTrafficSelector;
 import org.onosproject.net.flow.DefaultTrafficTreatment;
 import org.onosproject.net.flow.TrafficSelector;
@@ -64,7 +65,9 @@
      * @param constraints optional prioritized list of constraints
      * @param priority    priority to use for flows generated by this intent
      * @throws NullPointerException if the selector or treatment is null
+     * @deprecated 1.9.1
      */
+    @Deprecated
     protected ConnectivityIntent(ApplicationId appId,
                                  Key key,
                                  Collection<NetworkResource> resources,
@@ -79,6 +82,37 @@
     }
 
     /**
+     * Creates a connectivity intent that matches on the specified selector
+     * and applies the specified treatment.
+     * <p>
+     * Path will be optimized based on the first constraint if one is given.
+     * </p>
+     *
+     * @param appId       application identifier
+     * @param key         explicit key to use for intent
+     * @param resources   required network resources (optional)
+     * @param selector    traffic selector
+     * @param treatment   treatment
+     * @param constraints optional prioritized list of constraints
+     * @param priority    priority to use for flows generated by this intent
+     * @param resourceGroup resource group for this intent
+     * @throws NullPointerException if the selector or treatment is null
+     */
+    protected ConnectivityIntent(ApplicationId appId,
+                                 Key key,
+                                 Collection<NetworkResource> resources,
+                                 TrafficSelector selector,
+                                 TrafficTreatment treatment,
+                                 List<Constraint> constraints,
+                                 int priority,
+                                 ResourceGroup resourceGroup) {
+        super(appId, key, resources, priority, resourceGroup);
+        this.selector = checkNotNull(selector);
+        this.treatment = checkNotNull(treatment);
+        this.constraints = checkNotNull(constraints);
+    }
+
+    /**
      * Constructor for serializer.
      */
     protected ConnectivityIntent() {