Update FlowManagerModule's implementation.
- Updated FlowManagerModule to use FlowMap and FlowBatchMap
for its storage to store flows and batch operations.
- Implemented getFlow() and getFlows() methods.
- Removed FlowOperationMap class. This class has been replaced by FlowBatchMap.
- This task is a part of ONOS-1690, ONOS-1692 and ONOS-1736.
Change-Id: Id148b6191471eb209ff28b801a3e7ca075d7da6b
diff --git a/src/main/java/net/onrc/onos/core/flowmanager/FlowBatchHandleImpl.java b/src/main/java/net/onrc/onos/core/flowmanager/FlowBatchHandleImpl.java
index 61a450f..0f8c9a0 100644
--- a/src/main/java/net/onrc/onos/core/flowmanager/FlowBatchHandleImpl.java
+++ b/src/main/java/net/onrc/onos/core/flowmanager/FlowBatchHandleImpl.java
@@ -9,7 +9,7 @@
import net.onrc.onos.api.flowmanager.FlowBatchState;
public class FlowBatchHandleImpl implements FlowBatchHandle {
- private final FlowOperationMap flowOperationMap;
+ private final FlowBatchMap flowBatchMap;
private final FlowBatchId batchId;
/**
@@ -18,18 +18,18 @@
* The ID is automatically generated and assigned by FlowManager, and used
* as an internal key for the flow batch operation map.
*
- * @param opMap the FlowOperationMap object which maintains the flow batch
+ * @param map the {@link FlowBatchMap} object which maintains the flow batch
* operation
- * @param id the batch operation ID
+ * @param id the Id for this batch operation
*/
- public FlowBatchHandleImpl(FlowOperationMap opMap, FlowBatchId id) {
- flowOperationMap = opMap;
+ public FlowBatchHandleImpl(FlowBatchMap map, FlowBatchId id) {
+ flowBatchMap = map;
batchId = id;
}
@Override
public FlowBatchOperation getFlowBatchOperation() {
- FlowBatchOperation op = checkNotNull(flowOperationMap.getBatchOperation(batchId),
+ FlowBatchOperation op = checkNotNull(flowBatchMap.get(batchId),
"The requested flow batch operation does not exist in the map.");
// TODO: should be an instance of immutable batch operation class.
@@ -38,14 +38,14 @@
@Override
public FlowBatchState getState() {
- return flowOperationMap.getState(batchId);
+ return flowBatchMap.getState(batchId);
}
@Override
public void purge() {
FlowBatchState state = getState();
if (state == FlowBatchState.COMPLETED || state == FlowBatchState.FAILED) {
- flowOperationMap.removeBatchOperation(batchId);
+ flowBatchMap.remove(batchId);
}
}
}