Add priority to Intents
Change-Id: Ibe63356f5b15a6aa6ca7731dba3382c3317a95ec
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 305d103..23e6c02 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
@@ -61,7 +61,8 @@
Collection<NetworkResource> resources,
TrafficSelector selector,
TrafficTreatment treatment) {
- this(appId, null, resources, selector, treatment, Collections.emptyList());
+ this(appId, null, resources, selector, treatment, Collections.emptyList(),
+ DEFAULT_INTENT_PRIORITY);
}
/**
@@ -83,7 +84,8 @@
Collection<NetworkResource> resources,
TrafficSelector selector,
TrafficTreatment treatment) {
- this(appId, key, resources, selector, treatment, Collections.emptyList());
+ this(appId, key, resources, selector, treatment, Collections.emptyList(),
+ DEFAULT_INTENT_PRIORITY);
}
/**
@@ -99,6 +101,7 @@
* @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
* @throws NullPointerException if the selector or treatment is null
*/
@@ -107,8 +110,9 @@
Collection<NetworkResource> resources,
TrafficSelector selector,
TrafficTreatment treatment,
- List<Constraint> constraints) {
- super(appId, key, resources);
+ List<Constraint> constraints,
+ int priority) {
+ super(appId, key, resources, priority);
this.selector = checkNotNull(selector);
this.treatment = checkNotNull(treatment);
this.constraints = checkNotNull(constraints);
@@ -126,6 +130,7 @@
* @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
* @throws NullPointerException if the selector or treatment is null
*/
@@ -133,8 +138,9 @@
Collection<NetworkResource> resources,
TrafficSelector selector,
TrafficTreatment treatment,
- List<Constraint> constraints) {
- super(appId, null, resources);
+ List<Constraint> constraints,
+ int priority) {
+ super(appId, null, resources, priority);
this.selector = checkNotNull(selector);
this.treatment = checkNotNull(treatment);
this.constraints = checkNotNull(constraints);