Update compile() method of Flow object.
- Changed compile() to use FlowBatchOperation.Operator as a parameter
and return the list of MatchActionOperations object.
- This task is a preparation for ONOS-1690.
Change-Id: Ic1334c0385f244f1614e8a6b7cd6653252893dfd
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/Flow.java b/src/main/java/net/onrc/onos/api/flowmanager/Flow.java
index 6ea85a1..ae3cb7e 100644
--- a/src/main/java/net/onrc/onos/api/flowmanager/Flow.java
+++ b/src/main/java/net/onrc/onos/api/flowmanager/Flow.java
@@ -1,6 +1,9 @@
package net.onrc.onos.api.flowmanager;
import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.List;
+
import net.onrc.onos.api.batchoperation.BatchOperationTarget;
import net.onrc.onos.core.matchaction.MatchActionOperations;
import net.onrc.onos.core.matchaction.match.Match;
@@ -40,11 +43,13 @@
/**
* Compiles this object to MatchAction operations.
* <p>
- * This method is called by FlowManagerModule to create MatchAction operations.
+ * This method is called by FlowManagerModule to create MatchAction
+ * operations.
*
- * @return a MatchActionOperations of this flow object
+ * @param op FlowBatchOperation.Operator to be used for compiling this object
+ * @return a list of MatchActionOperations objects to realize this flow
*/
- public abstract MatchActionOperations compile();
+ public abstract List<MatchActionOperations> compile(FlowBatchOperation.Operator op);
/**
* Generates a hash code using the FlowId.
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/OpticalPathFlow.java b/src/main/java/net/onrc/onos/api/flowmanager/OpticalPathFlow.java
index 4018a7c..6b94472 100644
--- a/src/main/java/net/onrc/onos/api/flowmanager/OpticalPathFlow.java
+++ b/src/main/java/net/onrc/onos/api/flowmanager/OpticalPathFlow.java
@@ -35,6 +35,15 @@
}
/**
+ * Gets lambda which is used throughout the path.
+ *
+ * @return lambda which is used throughout the path
+ */
+ public int getLambda() {
+ return lambda;
+ }
+
+ /**
* Gets traffic filter for this flow.
* <p>
* This method only returns wildcard match, because the ingress transponder
@@ -45,17 +54,8 @@
return (new PacketMatchBuilder()).build();
}
- /**
- * Gets lambda which is used throughout the path.
- *
- * @return lambda which is used throughout the path
- */
- public int getLambda() {
- return lambda;
- }
-
@Override
- public MatchActionOperations compile() {
+ public List<MatchActionOperations> compile(FlowBatchOperation.Operator op) {
// TODO Auto-generated method stub
return null;
}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/PacketPathFlow.java b/src/main/java/net/onrc/onos/api/flowmanager/PacketPathFlow.java
index 8a15f3f..b4364c6 100644
--- a/src/main/java/net/onrc/onos/api/flowmanager/PacketPathFlow.java
+++ b/src/main/java/net/onrc/onos/api/flowmanager/PacketPathFlow.java
@@ -40,11 +40,6 @@
this.idleTimeout = idleTimeout;
}
- @Override
- public PacketMatch getMatch() {
- return match;
- }
-
/**
* Gets idle-timeout value.
*
@@ -64,7 +59,12 @@
}
@Override
- public MatchActionOperations compile() {
+ public PacketMatch getMatch() {
+ return match;
+ }
+
+ @Override
+ public List<MatchActionOperations> compile(FlowBatchOperation.Operator op) {
// TODO Auto-generated method stub
return null;
}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/SingleDstTreeFlow.java b/src/main/java/net/onrc/onos/api/flowmanager/SingleDstTreeFlow.java
index 92533cb..8ed1fb1 100644
--- a/src/main/java/net/onrc/onos/api/flowmanager/SingleDstTreeFlow.java
+++ b/src/main/java/net/onrc/onos/api/flowmanager/SingleDstTreeFlow.java
@@ -53,17 +53,6 @@
// TODO: check consistency among ingressPorts, tree, and actions.
}
- @Override
- public PacketMatch getMatch() {
- return match;
- }
-
- @Override
- public MatchActionOperations compile() {
- // TODO Auto-generated method stub
- return null;
- }
-
/**
* Gets the ingress ports of the tree.
*
@@ -90,4 +79,15 @@
public List<Action> getEgressActions() {
return actions;
}
+
+ @Override
+ public PacketMatch getMatch() {
+ return match;
+ }
+
+ @Override
+ public List<MatchActionOperations> compile(FlowBatchOperation.Operator op) {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/SingleSrcTreeFlow.java b/src/main/java/net/onrc/onos/api/flowmanager/SingleSrcTreeFlow.java
index bb896c8..e7bbe05 100644
--- a/src/main/java/net/onrc/onos/api/flowmanager/SingleSrcTreeFlow.java
+++ b/src/main/java/net/onrc/onos/api/flowmanager/SingleSrcTreeFlow.java
@@ -2,6 +2,7 @@
import static com.google.common.base.Preconditions.checkNotNull;
+import java.util.List;
import java.util.Set;
import net.onrc.onos.core.matchaction.MatchActionOperations;
@@ -45,17 +46,6 @@
// TODO: check consistency among rootPort, tree, and actions.
}
- @Override
- public PacketMatch getMatch() {
- return match;
- }
-
- @Override
- public MatchActionOperations compile() {
- // TODO Auto-generated method stub
- return null;
- }
-
/**
* Gets the ingress port (the root) of the tree.
*
@@ -82,4 +72,15 @@
public Set<Pair<Dpid, OutputAction>> getOutputActions() {
return outputActions;
}
+
+ @Override
+ public PacketMatch getMatch() {
+ return match;
+ }
+
+ @Override
+ public List<MatchActionOperations> compile(FlowBatchOperation.Operator op) {
+ // TODO Auto-generated method stub
+ return null;
+ }
}