Refactored intent framework to deal with batches.

There is still work to be done, but for now, submit, withdraw and reroute are working.

Change-Id: Ib94cf8c4be03786cc070f402d1f296f5dfa6588b
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/BatchOperation.java b/core/api/src/main/java/org/onlab/onos/net/flow/BatchOperation.java
index 16ce184..6fd16b9 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/BatchOperation.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/BatchOperation.java
@@ -15,13 +15,13 @@
  */
 package org.onlab.onos.net.flow;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-
 import java.util.Collection;
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+
 /**
  * A list of BatchOperationEntry.
  *
@@ -88,6 +88,16 @@
         return ops.add(entry) ? this : null;
     }
 
+    /**
+     * Add all operations from another batch to this batch.
+     *
+     * @param another another batch
+     * @return true if success
+     */
+    public boolean addAll(BatchOperation<T> another) {
+        return ops.addAll(another.getOperations());
+    }
+
     @Override
     public boolean equals(Object o) {
         if (this == o) {
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/CompletedBatchOperation.java b/core/api/src/main/java/org/onlab/onos/net/flow/CompletedBatchOperation.java
index 3758ea9..b988744 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/CompletedBatchOperation.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/CompletedBatchOperation.java
@@ -19,12 +19,20 @@
 
 import com.google.common.collect.ImmutableSet;
 
+/**
+ * Representation of a completed flow rule batch operation.
+ */
 public class CompletedBatchOperation implements BatchOperationResult<FlowRule> {
 
-
     private final boolean success;
     private final Set<FlowRule> failures;
 
+    /**
+     * Creates a new batch completion result.
+     *
+     * @param success  indicates whether the completion is successful.
+     * @param failures set of any failures encountered
+     */
     public CompletedBatchOperation(boolean success, Set<? extends FlowRule> failures) {
         this.success = success;
         this.failures = ImmutableSet.copyOf(failures);
@@ -40,5 +48,4 @@
         return failures;
     }
 
-
 }