Implementation of new Flow Subsystem:

The subsystem no longer returns futures for tracking completion of work.
Notifications are explicitely returned via a call back mechanism. Also, the
subsystem is now asynchronous.

Change-Id: I1a4cef931c24820f9ae9ed9a5398f163f05dfbc9

more flowservice improvements

Change-Id: I5c9c1b6be4b2ebfa523b64f6f52e7634b7d3e05f

more flowservice impl

Change-Id: I05f6774460effb53ced8c36844bcda2f8f6c096f

Manager to store functional (at least i believe it)

Change-Id: I09b04989bd1004c98fe0bafed4c76714b9155d53

flow subsystem functional: need to fix unit tests

Change-Id: I1667f25b91320f625a03e5e1d5e92823184d9de0

flow subsystem functional

Change-Id: I429b3335c16d4fc16f5d55f233dd37c4d1d6111d

finished refactor of flow subsystem

Change-Id: I1899abc6ff6a974a2018d936cc555049c70a6804

fix for null flow provider to use new api

Change-Id: If2fd9bd5baf74d9c61c5c8085cef8bc2d204cbdc
diff --git a/core/api/src/test/java/org/onosproject/net/flow/FlowRuleBatchOperationTest.java b/core/api/src/test/java/org/onosproject/net/flow/FlowRuleBatchOperationTest.java
index 07b60fa..70fe077 100644
--- a/core/api/src/test/java/org/onosproject/net/flow/FlowRuleBatchOperationTest.java
+++ b/core/api/src/test/java/org/onosproject/net/flow/FlowRuleBatchOperationTest.java
@@ -46,10 +46,10 @@
         final LinkedList<FlowRuleBatchEntry> ops3 = new LinkedList<>();
         ops3.add(entry3);
 
-        final FlowRuleBatchOperation operation1 = new FlowRuleBatchOperation(ops1);
-        final FlowRuleBatchOperation sameAsOperation1 = new FlowRuleBatchOperation(ops1);
-        final FlowRuleBatchOperation operation2 = new FlowRuleBatchOperation(ops2);
-        final FlowRuleBatchOperation operation3 = new FlowRuleBatchOperation(ops3);
+        final FlowRuleBatchOperation operation1 = new FlowRuleBatchOperation(ops1, null, 0);
+        final FlowRuleBatchOperation sameAsOperation1 = new FlowRuleBatchOperation(ops1, null, 0);
+        final FlowRuleBatchOperation operation2 = new FlowRuleBatchOperation(ops2, null, 0);
+        final FlowRuleBatchOperation operation3 = new FlowRuleBatchOperation(ops3, null, 0);
 
         new EqualsTester()
                 .addEqualityGroup(operation1, sameAsOperation1)
diff --git a/core/api/src/test/java/org/onosproject/net/flow/FlowRuleBatchRequestTest.java b/core/api/src/test/java/org/onosproject/net/flow/FlowRuleBatchRequestTest.java
index d7ad903..e6864e1 100644
--- a/core/api/src/test/java/org/onosproject/net/flow/FlowRuleBatchRequestTest.java
+++ b/core/api/src/test/java/org/onosproject/net/flow/FlowRuleBatchRequestTest.java
@@ -15,17 +15,18 @@
  */
 package org.onosproject.net.flow;
 
-import java.util.LinkedList;
-import java.util.List;
-
 import org.junit.Test;
 import org.onosproject.net.intent.IntentTestsMocks;
 
-import static org.onosproject.net.flow.FlowRuleBatchEntry.FlowRuleOperation.*;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.hasSize;
 import static org.hamcrest.Matchers.is;
+import static org.onosproject.net.flow.FlowRuleBatchEntry.FlowRuleOperation.ADD;
+import static org.onosproject.net.flow.FlowRuleBatchEntry.FlowRuleOperation.REMOVE;
 
 /**
  * Unit tests for the FlowRuleBatchRequest class.
@@ -40,22 +41,19 @@
     public void testConstruction() {
         final FlowRule rule1 = new IntentTestsMocks.MockFlowRule(1);
         final FlowRule rule2 = new IntentTestsMocks.MockFlowRule(2);
-        final List<FlowRuleBatchEntry> toAdd = new LinkedList<>();
-        toAdd.add(new FlowRuleBatchEntry(ADD, rule1));
-        final List<FlowRuleBatchEntry> toRemove = new LinkedList<>();
-        toRemove.add(new FlowRuleBatchEntry(REMOVE, rule2));
+        final Set<FlowRuleBatchEntry> batch = new HashSet<>();
+        batch.add(new FlowRuleBatchEntry(ADD, rule1));
+
+        batch.add(new FlowRuleBatchEntry(REMOVE, rule2));
 
 
         final FlowRuleBatchRequest request =
-                new FlowRuleBatchRequest(1, toAdd, toRemove);
+                new FlowRuleBatchRequest(1, batch);
 
-        assertThat(request.toAdd(), hasSize(1));
-        assertThat(request.toAdd().get(0), is(rule1));
-        assertThat(request.toRemove(), hasSize(1));
-        assertThat(request.toRemove().get(0), is(rule2));
-        assertThat(request.batchId(), is(1));
+        assertThat(request.ops(), hasSize(2));
+        assertThat(request.batchId(), is(1L));
 
-        final FlowRuleBatchOperation op = request.asBatchOperation();
+        final FlowRuleBatchOperation op = request.asBatchOperation(rule1.deviceId());
         assertThat(op.size(), is(2));
 
         final List<FlowRuleBatchEntry> ops = op.getOperations();
diff --git a/core/api/src/test/java/org/onosproject/net/flow/FlowRuleServiceAdapter.java b/core/api/src/test/java/org/onosproject/net/flow/FlowRuleServiceAdapter.java
index 8f54e85..393f3cf 100644
--- a/core/api/src/test/java/org/onosproject/net/flow/FlowRuleServiceAdapter.java
+++ b/core/api/src/test/java/org/onosproject/net/flow/FlowRuleServiceAdapter.java
@@ -66,6 +66,11 @@
     }
 
     @Override
+    public void apply(FlowRuleOperations ops) {
+
+    }
+
+    @Override
     public void addListener(FlowRuleListener listener) {
 
     }