Fix a bug inside FlowDatabaseOperation.extractFlowEntry()
Explicitly assign the FlowId to the extracted FlowEntry.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
index 2d5fe5c..9969cfc 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
@@ -622,6 +622,12 @@
* @return the extracted Flow Entry State.
*/
public static FlowEntry extractFlowEntry(IFlowEntry flowEntryObj) {
+ IFlowPath flowObj = flowEntryObj.getFlow();
+ if (flowObj == null)
+ return null;
+
+ String flowIdStr = flowObj.getFlowId();
+ //
String flowEntryIdStr = flowEntryObj.getFlowEntryId();
Integer idleTimeout = flowEntryObj.getIdleTimeout();
Integer hardTimeout = flowEntryObj.getHardTimeout();
@@ -629,7 +635,8 @@
String userState = flowEntryObj.getUserState();
String switchState = flowEntryObj.getSwitchState();
- if ((flowEntryIdStr == null) ||
+ if ((flowIdStr == null) ||
+ (flowEntryIdStr == null) ||
(idleTimeout == null) ||
(hardTimeout == null) ||
(switchDpidStr == null) ||
@@ -641,6 +648,7 @@
FlowEntry flowEntry = new FlowEntry();
flowEntry.setFlowEntryId(new FlowEntryId(flowEntryIdStr));
+ flowEntry.setFlowId(new FlowId(flowIdStr));
flowEntry.setDpid(new Dpid(switchDpidStr));
flowEntry.setIdleTimeout(idleTimeout);
flowEntry.setHardTimeout(hardTimeout);