Resource group to share resources between intents
Change-Id: I5bf7d4261197449924d07dabac841cf8ccbe9389
diff --git a/core/api/src/main/java/org/onosproject/net/intent/TwoWayP2PIntent.java b/core/api/src/main/java/org/onosproject/net/intent/TwoWayP2PIntent.java
index 2a47891..cc023a4 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/TwoWayP2PIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/TwoWayP2PIntent.java
@@ -21,6 +21,7 @@
import com.google.common.annotations.Beta;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.ResourceGroup;
import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.TrafficTreatment;
@@ -49,16 +50,18 @@
* @param treatment ingress port
* @param constraints optional prioritized list of path selection constraints
* @param priority priority to use for flows generated by this intent
+ * @param resourceGroup resource group for this intent
* @throws NullPointerException if {@code one} or {@code two} is null.
*/
private TwoWayP2PIntent(ApplicationId appId, Key key,
- ConnectPoint one, ConnectPoint two,
- TrafficSelector selector,
- TrafficTreatment treatment,
- List<Constraint> constraints,
- int priority) {
+ ConnectPoint one, ConnectPoint two,
+ TrafficSelector selector,
+ TrafficTreatment treatment,
+ List<Constraint> constraints,
+ int priority,
+ ResourceGroup resourceGroup) {
super(appId, key, Collections.emptyList(), selector, treatment, constraints,
- priority);
+ priority, resourceGroup);
// TODO: consider whether the case one and two are same is allowed
this.one = checkNotNull(one);
@@ -116,6 +119,11 @@
return (Builder) super.priority(priority);
}
+ @Override
+ public Builder resourceGroup(ResourceGroup resourceGroup) {
+ return (Builder) super.resourceGroup(resourceGroup);
+ }
+
/**
* Sets the first connection point of the two way intent that will be built.
*
@@ -153,7 +161,8 @@
selector,
treatment,
constraints,
- priority
+ priority,
+ resourceGroup
);
}
}
@@ -187,6 +196,7 @@
.add("selector", selector())
.add("treatment", treatment())
.add("constraints", constraints())
+ .add("resourceGroup", resourceGroup())
.add("one", one)
.add("two", two)
.toString();