Added new field FlowPath.flowPathUserState
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 5336520..5bc35d2 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowDatabaseOperation.java
@@ -78,6 +78,7 @@
// Set the Flow attributes:
// - flowPath.installerId()
// - flowPath.flowPathType()
+ // - flowPath.flowPathUserState()
// - flowPath.flowPathFlags()
// - flowPath.dataPath().srcPort()
// - flowPath.dataPath().dstPort()
@@ -96,6 +97,7 @@
//
flowObj.setInstallerId(flowPath.installerId().toString());
flowObj.setFlowPathType(flowPath.flowPathType().toString());
+ flowObj.setFlowPathUserState(flowPath.flowPathUserState().toString());
flowObj.setFlowPathFlags(flowPath.flowPathFlags().flags());
flowObj.setSrcSwitch(flowPath.dataPath().srcPort().dpid().toString());
flowObj.setSrcPort(flowPath.dataPath().srcPort().port().value());
@@ -140,9 +142,9 @@
flowObj.setDataPathSummary(flowPath.dataPath().dataPathSummary());
if (found)
- flowObj.setUserState("FE_USER_MODIFY");
+ flowObj.setFlowPathUserState("FP_USER_MODIFY");
else
- flowObj.setUserState("FE_USER_ADD");
+ flowObj.setFlowPathUserState("FP_USER_ADD");
// Flow edges:
// HeadFE
@@ -421,7 +423,7 @@
// Find and mark for deletion all Flow Entries,
// and the Flow itself.
//
- flowObj.setUserState("FE_USER_DELETE");
+ flowObj.setFlowPathUserState("FP_USER_DELETE");
Iterable<IFlowEntry> flowEntries = flowObj.getFlowEntries();
boolean empty = true; // TODO: an ugly hack
for (IFlowEntry flowEntryObj : flowEntries) {
@@ -746,6 +748,7 @@
String flowIdStr = flowObj.getFlowId();
String installerIdStr = flowObj.getInstallerId();
String flowPathType = flowObj.getFlowPathType();
+ String flowPathUserState = flowObj.getFlowPathUserState();
Long flowPathFlags = flowObj.getFlowPathFlags();
String srcSwitchStr = flowObj.getSrcSwitch();
Short srcPortShort = flowObj.getSrcPort();
@@ -755,6 +758,7 @@
if ((flowIdStr == null) ||
(installerIdStr == null) ||
(flowPathType == null) ||
+ (flowPathUserState == null) ||
(flowPathFlags == null) ||
(srcSwitchStr == null) ||
(srcPortShort == null) ||
@@ -768,6 +772,7 @@
flowPath.setFlowId(new FlowId(flowIdStr));
flowPath.setInstallerId(new CallerId(installerIdStr));
flowPath.setFlowPathType(FlowPathType.valueOf(flowPathType));
+ flowPath.setFlowPathUserState(FlowPathUserState.valueOf(flowPathUserState));
flowPath.setFlowPathFlags(new FlowPathFlags(flowPathFlags));
flowPath.dataPath().srcPort().setDpid(new Dpid(srcSwitchStr));
flowPath.dataPath().srcPort().setPort(new Port(srcPortShort));
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 31a6bf4..fba680d 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -273,9 +273,9 @@
// Test whether we need to complete the Flow cleanup,
// if the Flow has been deleted by the user.
//
- String flowUserState = flowPathObj.getUserState();
- if ((flowUserState != null)
- && flowUserState.equals("FE_USER_DELETE")) {
+ String flowPathUserStateStr = flowPathObj.getFlowPathUserState();
+ if ((flowPathUserStateStr != null)
+ && flowPathUserStateStr.equals("FP_USER_DELETE")) {
Iterable<IFlowEntry> flowEntries = flowPathObj.getFlowEntries();
final boolean empty = !flowEntries.iterator().hasNext();
if (empty)
@@ -302,6 +302,7 @@
SwitchPort srcSwitchPort = new SwitchPort(srcDpid, srcPort);
SwitchPort dstSwitchPort = new SwitchPort(dstDpid, dstPort);
FlowPathType flowPathType = FlowPathType.valueOf(flowPathTypeStr);
+ FlowPathUserState flowPathUserState = FlowPathUserState.valueOf(flowPathUserStateStr);
FlowPathFlags flowPathFlags = new FlowPathFlags(flowPathFlagsLong);
counterMyFlowPaths++;