Add keys to intents
- use Key class rather than String for intent keys
- add CLI option to specify a string key
- add key field to constructors for connectivity intents
- translate id into a key if no key is specified
Change-Id: I69ffbad93bc3daddf06a67cb0cffa2130e781b37
diff --git a/core/api/src/main/java/org/onosproject/net/intent/MultiPointToSinglePointIntent.java b/core/api/src/main/java/org/onosproject/net/intent/MultiPointToSinglePointIntent.java
index f519dd4..7de52a5 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/MultiPointToSinglePointIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/MultiPointToSinglePointIntent.java
@@ -75,12 +75,13 @@
* not more than 1
*/
public MultiPointToSinglePointIntent(ApplicationId appId,
+ Key key,
TrafficSelector selector,
TrafficTreatment treatment,
Set<ConnectPoint> ingressPoints,
ConnectPoint egressPoint,
List<Constraint> constraints) {
- super(appId, Collections.emptyList(), selector, treatment, constraints);
+ super(appId, key, Collections.emptyList(), selector, treatment, constraints);
checkNotNull(ingressPoints);
checkArgument(!ingressPoints.isEmpty(), "Ingress point set cannot be empty");
@@ -93,6 +94,30 @@
}
/**
+ * Creates a new multi-to-single point connectivity intent for the specified
+ * traffic selector and treatment.
+ *
+ * @param appId application identifier
+ * @param selector traffic selector
+ * @param treatment treatment
+ * @param ingressPoints set of ports from which ingress traffic originates
+ * @param egressPoint port to which traffic will egress
+ * @param constraints constraints to apply to the intent
+ * @throws NullPointerException if {@code ingressPoints} or
+ * {@code egressPoint} is null.
+ * @throws IllegalArgumentException if the size of {@code ingressPoints} is
+ * not more than 1
+ */
+ public MultiPointToSinglePointIntent(ApplicationId appId,
+ TrafficSelector selector,
+ TrafficTreatment treatment,
+ Set<ConnectPoint> ingressPoints,
+ ConnectPoint egressPoint,
+ List<Constraint> constraints) {
+ this(appId, null, selector, treatment, ingressPoints, egressPoint, constraints);
+ }
+
+ /**
* Constructor for serializer.
*/
protected MultiPointToSinglePointIntent() {