* Added a class for encapsulating events with event-related data entry.
* Use the above class within the FlowManager to store the initial set
of Flow-related events during startup.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
index 5a4edc3..012f333 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -7,7 +7,9 @@
import java.util.LinkedList;
import java.util.Map;
import java.util.Random;
+import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@@ -70,6 +72,10 @@
private ScheduledExecutorService mapReaderScheduler;
private ScheduledExecutorService shortestPathReconcileScheduler;
+ // The queue with Flow Path updates
+ protected BlockingQueue<EventEntry<FlowPath>> flowPathEvents =
+ new LinkedBlockingQueue<EventEntry<FlowPath>>();
+
/**
* Periodic task for reading the Flow Entries and pushing changes
* into the switches.
@@ -488,10 +494,16 @@
// Initialize the Flow Entry ID generator
nextFlowEntryIdPrefix = randomGenerator.nextInt();
+ // Register with the Datagrid Service and obtain the initial state
datagridService.registerFlowService(this);
- // TODO: Flow Paths not used yet
Collection<FlowPath> flowPaths = datagridService.getAllFlows();
+ for (FlowPath flowPath : flowPaths) {
+ EventEntry<FlowPath> eventEntry =
+ new EventEntry<FlowPath>(EventEntry.Type.ENTRY_ADD, flowPath);
+ flowPathEvents.add(eventEntry);
+ }
+ // Schedule the periodic tasks
mapReaderScheduler.scheduleAtFixedRate(
mapReader, 3, 3, TimeUnit.SECONDS);
shortestPathReconcileScheduler.scheduleAtFixedRate(