diff options
author | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-22 10:02:05 -0800 |
---|---|---|
committer | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-22 10:02:05 -0800 |
commit | 77ce3be7567bd01c66d8ee88a93b485666723501 (patch) | |
tree | 283e7f39a501750bbd705fbb91645b20198900f1 /framework/src/onos/apps/sdnip | |
parent | 00e6500d0813dcbccaaa741ef38cc1eae6d11e07 (diff) |
Removed patch path since changes have been merged upstream to a different path. Updated README with directions.
Change-Id: Ie419abd2d3d3ef7315de9f607dcd757a78190995
Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/apps/sdnip')
-rw-r--r-- | framework/src/onos/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentSynchronizer.java | 2 | ||||
-rw-r--r-- | framework/src/onos/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentUtils.java | 18 |
2 files changed, 14 insertions, 6 deletions
diff --git a/framework/src/onos/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentSynchronizer.java b/framework/src/onos/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentSynchronizer.java index a3cd6875..2eb5d0f3 100644 --- a/framework/src/onos/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentSynchronizer.java +++ b/framework/src/onos/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentSynchronizer.java @@ -74,7 +74,7 @@ public class IntentSynchronizer implements IntentSynchronizationService { * @param intentService the intent service * @param executorService executor service for synchronization thread */ - IntentSynchronizer(ApplicationId appId, IntentService intentService, + public IntentSynchronizer(ApplicationId appId, IntentService intentService, ExecutorService executorService) { this.appId = appId; this.intentService = intentService; diff --git a/framework/src/onos/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentUtils.java b/framework/src/onos/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentUtils.java index 8e2a3df3..863de12a 100644 --- a/framework/src/onos/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentUtils.java +++ b/framework/src/onos/apps/sdnip/src/main/java/org/onosproject/sdnip/IntentUtils.java @@ -19,13 +19,12 @@ package org.onosproject.sdnip; import org.onosproject.net.intent.Intent; import org.onosproject.net.intent.MultiPointToSinglePointIntent; import org.onosproject.net.intent.PointToPointIntent; +import org.onosproject.net.intent.SinglePointToMultiPointIntent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Objects; -import static com.google.common.base.Preconditions.checkArgument; - /** * Utilities for dealing with intents. */ @@ -49,15 +48,24 @@ public final class IntentUtils { * @return true if the two intents represent the same value, otherwise false */ public static boolean equals(Intent one, Intent two) { - checkArgument(one.getClass() == two.getClass(), - "Intents are not the same type"); + if (one.getClass() != two.getClass()) { + return false; + } if (!(Objects.equals(one.appId(), two.appId()) && Objects.equals(one.key(), two.key()))) { return false; } - if (one instanceof MultiPointToSinglePointIntent) { + if (one instanceof SinglePointToMultiPointIntent) { + SinglePointToMultiPointIntent intent1 = (SinglePointToMultiPointIntent) one; + SinglePointToMultiPointIntent intent2 = (SinglePointToMultiPointIntent) two; + + return Objects.equals(intent1.selector(), intent2.selector()) && + Objects.equals(intent1.treatment(), intent2.treatment()) && + Objects.equals(intent1.ingressPoint(), intent2.ingressPoint()) && + Objects.equals(intent1.egressPoints(), intent2.egressPoints()); + } else if (one instanceof MultiPointToSinglePointIntent) { MultiPointToSinglePointIntent intent1 = (MultiPointToSinglePointIntent) one; MultiPointToSinglePointIntent intent2 = (MultiPointToSinglePointIntent) two; |