aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java
diff options
context:
space:
mode:
authorAshlee Young <ashlee@wildernessvoice.com>2015-11-03 14:08:10 -0800
committerAshlee Young <ashlee@wildernessvoice.com>2015-11-03 14:08:10 -0800
commit643ee33289bd2cb9e6afbfb09b4ed72d467ba1c2 (patch)
treec2c376a44a359544fe3d4c45eb0cc0e2ec4a7080 /framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java
parent46eeb79b54345bdafb6055b8ee4bad4ce8b01274 (diff)
This updates ONOS src tree to commit id
03fa5e571cabbd001ddb1598847e1150b11c7333 Change-Id: I13b554026d6f902933e35887d29bd5fdb669c0bd Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java')
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java
index bd4219ad..c1467241 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/HostToHostIntent.java
@@ -17,11 +17,15 @@ package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
+
import org.onosproject.core.ApplicationId;
import org.onosproject.net.HostId;
+import org.onosproject.net.Link;
import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.TrafficTreatment;
+import org.onosproject.net.intent.constraint.LinkTypeConstraint;
import java.util.List;
@@ -33,6 +37,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
@Beta
public final class HostToHostIntent extends ConnectivityIntent {
+ static final LinkTypeConstraint NOT_OPTICAL = new LinkTypeConstraint(false, Link.Type.OPTICAL);
+
private final HostId one;
private final HostId two;
@@ -115,6 +121,15 @@ public final class HostToHostIntent extends ConnectivityIntent {
*/
public HostToHostIntent build() {
+ List<Constraint> theConstraints = constraints;
+ // If not-OPTICAL constraint hasn't been specified, add them
+ if (!constraints.contains(NOT_OPTICAL)) {
+ theConstraints = ImmutableList.<Constraint>builder()
+ .add(NOT_OPTICAL)
+ .addAll(constraints)
+ .build();
+ }
+
return new HostToHostIntent(
appId,
key,
@@ -122,7 +137,7 @@ public final class HostToHostIntent extends ConnectivityIntent {
two,
selector,
treatment,
- constraints,
+ theConstraints,
priority
);
}