Merge "Change PlanCalcRuntime class to receive IntentOperationList" into dev/ramcloud-new-datamodel
diff --git a/src/main/java/net/onrc/onos/intent/runtime/PlanCalcRuntime.java b/src/main/java/net/onrc/onos/intent/runtime/PlanCalcRuntime.java
index b01bfbc..4582021 100644
--- a/src/main/java/net/onrc/onos/intent/runtime/PlanCalcRuntime.java
+++ b/src/main/java/net/onrc/onos/intent/runtime/PlanCalcRuntime.java
@@ -12,6 +12,7 @@
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.intent.FlowEntry;
import net.onrc.onos.intent.Intent;
+import net.onrc.onos.intent.IntentOperationList;
import net.onrc.onos.intent.PathIntent;
import net.onrc.onos.intent.PathIntentMap;
import net.onrc.onos.intent.ShortestPathIntent;
@@ -36,10 +37,11 @@
this.graph = graph;
this.flowEntries = new HashSet<>();
this.plan = new ArrayList<>();
+ this.intents = new PathIntentMap(this.graph);
}
- public void addIntents(PathIntentMap intents) {
- this.intents = intents;
+ public void addIntents(IntentOperationList intentOpList) {
+ intents.executeOperations(intentOpList);
computeFlowEntries();
constructPlan();
}
diff --git a/src/test/java/net/onrc/onos/intent/runtime/UseCaseTest.java b/src/test/java/net/onrc/onos/intent/runtime/UseCaseTest.java
index c12a718..8040141 100644
--- a/src/test/java/net/onrc/onos/intent/runtime/UseCaseTest.java
+++ b/src/test/java/net/onrc/onos/intent/runtime/UseCaseTest.java
@@ -98,7 +98,7 @@
// compile low-level intents into flow entry installation plan
PlanCalcRuntime runtime2 = new PlanCalcRuntime(g);
- runtime2.addIntents((PathIntentMap) runtime1.getPathIntents()); // TODO use pathIntentOpList
+ runtime2.addIntents(pathIntentOpList);
// show results
showResult((PathIntentMap) runtime1.getPathIntents());
@@ -123,7 +123,7 @@
// compile low-level intents into flow entry installation plan
PlanCalcRuntime runtime2 = new PlanCalcRuntime(g);
- runtime2.addIntents((PathIntentMap) runtime1.getPathIntents()); // TODO use pathIntentOpList
+ runtime2.addIntents(pathIntentOpList);
// show results
showResult((PathIntentMap) runtime1.getPathIntents());
@@ -148,7 +148,7 @@
// compile low-level intents into flow entry installation plan
PlanCalcRuntime runtime2 = new PlanCalcRuntime(g);
- runtime2.addIntents((PathIntentMap) runtime1.getPathIntents()); // TODO use pathIntentOpList
+ runtime2.addIntents(pathIntentOpList);
// show results
showResult((PathIntentMap) runtime1.getPathIntents());