Change FlowBatchHandle to be interface class.
- Users can access to the shared flow batch operation map
using the FlowBatchHandle.
- FlowBatchHandle is an interface and the instance of it
can be obtained from APIs defined by FlowManagerService.
- The implementation of the map can be accessed only from
the implementation of the FlowBatchHandle.
- This task is a part of ONOS-1692 and ONOS-1842.
Change-Id: I651a2886d166765ca5aae6abcc2b844153ffb2bc
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/FlowBatchHandle.java b/src/main/java/net/onrc/onos/api/flowmanager/FlowBatchHandle.java
index 351d9e9..1f1836a 100644
--- a/src/main/java/net/onrc/onos/api/flowmanager/FlowBatchHandle.java
+++ b/src/main/java/net/onrc/onos/api/flowmanager/FlowBatchHandle.java
@@ -1,40 +1,25 @@
package net.onrc.onos.api.flowmanager;
-import net.onrc.onos.core.flowmanager.FlowOperationMap;
-
-
/**
- * Handle class to handle flow batch operation.
+ * An interface for handling flow batch operation.
*/
-public class FlowBatchHandle {
- private final FlowOperationMap flowOperationMap;
- private final FlowBatchId batchId;
+public interface FlowBatchHandle {
+ /**
+ * Gets the flow batch operation.
+ *
+ * @return the flow batch operation
+ */
+ public FlowBatchOperation getFlowBatchOperation();
/**
- * Creates a handle using batch operation ID.
- * <p>
- * The ID is automatically generated and assigned by FlowManager, and used
- * as an internal key for the flow batch operation map.
+ * Gets the state for the flow batch operation.
*
- * @param opMap the FlowOperationMap object which maintains the flow batch
- * operation
- * @param id the batch operation ID
+ * @return the state for the flow batch operation
*/
- public FlowBatchHandle(FlowOperationMap opMap, FlowBatchId id) {
- flowOperationMap = opMap;
- batchId = id;
- }
+ public FlowBatchState getState();
/**
- * Gets the flow batch operation ID.
- *
- * @return the flow batch operation ID
+ * Purge the flow batch operation from the map.
*/
- public FlowBatchId getBatchOperationId() {
- return batchId;
- }
-
- public FlowBatchState getState() {
- return flowOperationMap.getState(batchId);
- }
+ public void purge();
}