Update BatchOperation class to be more generic and extensible.
- addAddOperation() and addRemoveOperation() methods are removed
from BatchOperation class, and now the class has just addOperation() method.
- Removed AddOperation and RemoveOperation classes,
and defined IntentBatchOperation, FlowBatchOperation and MatchActionPhase classes
as sub-classes of BatchOperation class, for Intent, IFlow and MatchAction objects
respectively.
- These classes include definitions of add/remove operators and helper methods
specific to Intent, IFlow and MatchAction objects.
- Removed BatchOperationTargetId class.
- Updated unit tests.
- This task is a part of ONOS-1692.
Change-Id: Iba2f737af1fef6a6555e0e0166836865ed070fa3
diff --git a/src/main/java/net/onrc/onos/core/flowmanager/FlowManagerModule.java b/src/main/java/net/onrc/onos/core/flowmanager/FlowManagerModule.java
index 8775737..550fa44 100644
--- a/src/main/java/net/onrc/onos/core/flowmanager/FlowManagerModule.java
+++ b/src/main/java/net/onrc/onos/core/flowmanager/FlowManagerModule.java
@@ -3,8 +3,8 @@
import java.util.Collection;
import java.util.EventListener;
-import net.onrc.onos.api.batchoperation.BatchOperation;
import net.onrc.onos.api.flowmanager.ConflictDetectionPolicy;
+import net.onrc.onos.api.flowmanager.FlowBatchOperation;
import net.onrc.onos.api.flowmanager.FlowId;
import net.onrc.onos.api.flowmanager.IFlow;
import net.onrc.onos.api.flowmanager.IFlowManagerService;
@@ -27,15 +27,15 @@
@Override
public boolean addFlow(IFlow flow) {
- BatchOperation<IFlow> ops = new BatchOperation<IFlow>();
- ops.addAddOperation(flow);
+ FlowBatchOperation ops = new FlowBatchOperation();
+ ops.addAddFlowOperation(flow);
return executeBatch(ops);
}
@Override
public boolean removeFlow(FlowId id) {
- BatchOperation<IFlow> ops = new BatchOperation<IFlow>();
- ops.addRemoveOperation(id);
+ FlowBatchOperation ops = new FlowBatchOperation();
+ ops.addRemoveFlowOperation(id);
return executeBatch(ops);
}
@@ -52,7 +52,7 @@
}
@Override
- public boolean executeBatch(BatchOperation<IFlow> ops) {
+ public boolean executeBatch(FlowBatchOperation ops) {
// TODO Auto-generated method stub
return false;
}