Resource group to share resources between intents
Change-Id: I5bf7d4261197449924d07dabac841cf8ccbe9389
diff --git a/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java b/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java
index 92dd83b..a7505ae 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java
@@ -23,6 +23,7 @@
import org.onosproject.core.ApplicationId;
import org.onosproject.net.HostId;
import org.onosproject.net.Link;
+import org.onosproject.net.ResourceGroup;
import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.intent.constraint.LinkTypeConstraint;
@@ -92,6 +93,11 @@
return (Builder) super.priority(priority);
}
+ @Override
+ public Builder resourceGroup(ResourceGroup resourceGroup) {
+ return (Builder) super.resourceGroup(resourceGroup);
+ }
+
/**
* Sets the first host of the intent that will be built.
*
@@ -114,8 +120,6 @@
return this;
}
-
-
/**
* Builds a host to host intent from the accumulated parameters.
*
@@ -140,12 +144,12 @@
selector,
treatment,
theConstraints,
- priority
+ priority,
+ resourceGroup
);
}
}
-
/**
* Creates a new host-to-host intent with the supplied host pair.
*
@@ -157,21 +161,22 @@
* @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 HostToHostIntent(ApplicationId appId, Key key,
- HostId one, HostId two,
- TrafficSelector selector,
- TrafficTreatment treatment,
- List<Constraint> constraints,
- int priority) {
+ HostId one, HostId two,
+ TrafficSelector selector,
+ TrafficTreatment treatment,
+ List<Constraint> constraints,
+ int priority,
+ ResourceGroup resourceGroup) {
super(appId, key, ImmutableSet.of(one, two), selector, treatment,
- constraints, priority);
+ constraints, priority, resourceGroup);
// TODO: consider whether the case one and two are same is allowed
this.one = checkNotNull(one);
this.two = checkNotNull(two);
-
}
/**
@@ -203,6 +208,7 @@
.add("selector", selector())
.add("treatment", treatment())
.add("constraints", constraints())
+ .add("resourceGroup", resourceGroup())
.add("one", one)
.add("two", two)
.toString();