Cleanup in the FlowPusher and the FlowSynchronizer:
* Don't use FlowPath and IFlowPath when pushing flows through the
FlowPusher, because it is not needed anymore: now the FlowEntry object
is self-contained.
* Removed the alternative FlowPusher add(IFlowEntry) method that takes
IFlowEntry argument from Titan; instead, extract the IFlowEntry
into a FlowEntry object, and then use the remaining add(FlowEntry)
method.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java
index b3c8e84..c357e7c 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java
@@ -25,7 +25,9 @@
import net.onrc.onos.graph.GraphDBOperation;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
+import net.onrc.onos.ofcontroller.flowmanager.FlowDatabaseOperation;
import net.onrc.onos.ofcontroller.util.Dpid;
+import net.onrc.onos.ofcontroller.util.FlowEntry;
import net.onrc.onos.ofcontroller.util.FlowEntryId;
/**
@@ -236,7 +238,15 @@
return;
}
- pusher.add(sw, iFlowEntry.getFlow(), iFlowEntry);
+ FlowEntry flowEntry =
+ FlowDatabaseOperation.extractFlowEntry(iFlowEntry);
+ if (flowEntry == null) {
+ log.error("Cannot add flow entry {} to sw {} : flow entry cannot be extracted",
+ flowEntryId, sw.getId());
+ return;
+ }
+
+ pusher.add(sw, flowEntry);
}
/**