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/batchoperation/BatchOperation.java b/src/main/java/net/onrc/onos/api/batchoperation/BatchOperation.java
index 6232a86..65836c4 100644
--- a/src/main/java/net/onrc/onos/api/batchoperation/BatchOperation.java
+++ b/src/main/java/net/onrc/onos/api/batchoperation/BatchOperation.java
@@ -1,5 +1,7 @@
package net.onrc.onos.api.batchoperation;
+import static com.google.common.base.Preconditions.checkNotNull;
+
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -15,13 +17,23 @@
private List<T> ops;
/**
- * Constructor.
+ * Creates new {@link BatchOperation} object.
*/
public BatchOperation() {
ops = new LinkedList<>();
}
/**
+ * Creates {@link BatchOperation} object from a list of batch operation
+ * entries.
+ *
+ * @param batchOperations the list of batch operation entries.
+ */
+ public BatchOperation(List<T> batchOperations) {
+ ops = new LinkedList<>(checkNotNull(batchOperations));
+ }
+
+ /**
* Removes all operations maintained in this object.
*/
public void clear() {