Added new field FlowPath.flowPathUserState
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
index 7892483..2683e86 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
@@ -13,6 +13,7 @@
private FlowId flowId; // The Flow ID
private CallerId installerId; // The Caller ID of the path installer
private FlowPathType flowPathType; // The Flow Path type
+ private FlowPathUserState flowPathUserState; // The Flow Path User state
private FlowPathFlags flowPathFlags; // The Flow Path flags
private DataPath dataPath; // The data path
private FlowEntryMatch flowEntryMatch; // Common Flow Entry Match for all
@@ -25,6 +26,7 @@
*/
public FlowPath() {
flowPathType = FlowPathType.FP_TYPE_UNKNOWN;
+ flowPathUserState = FlowPathUserState.FP_USER_UNKNOWN;
flowPathFlags = new FlowPathFlags();
dataPath = new DataPath();
flowEntryActions = new FlowEntryActions();
@@ -38,6 +40,7 @@
this.setFlowId(new FlowId(flowObj.getFlowId()));
this.setInstallerId(new CallerId(flowObj.getInstallerId()));
this.setFlowPathType(FlowPathType.valueOf(flowObj.getFlowPathType()));
+ this.setFlowPathUserState(FlowPathUserState.valueOf(flowObj.getFlowPathUserState()));
this.setFlowPathFlags(new FlowPathFlags(flowObj.getFlowPathFlags()));
this.dataPath().srcPort().setDpid(new Dpid(flowObj.getSrcSwitch()));
this.dataPath().srcPort().setPort(new Port(flowObj.getSrcPort()));
@@ -241,6 +244,24 @@
}
/**
+ * Get the flow path user state.
+ *
+ * @return the flow path user state.
+ */
+ @JsonProperty("flowPathUserState")
+ public FlowPathUserState flowPathUserState() { return flowPathUserState; }
+
+ /**
+ * Set the flow path user state.
+ *
+ * @param flowPathUserState the flow path user state to set.
+ */
+ @JsonProperty("flowPathUserState")
+ public void setFlowPathUserState(FlowPathUserState flowPathUserState) {
+ this.flowPathUserState = flowPathUserState;
+ }
+
+ /**
* Get the flow path flags.
*
* @return the flow path flags.
@@ -320,8 +341,9 @@
* Convert the flow path to a string.
*
* The string has the following form:
- * [flowId=XXX installerId=XXX flowPathType = XXX flowPathFlags=XXX
- * dataPath=XXX flowEntryMatch=XXX flowEntryActions=XXX]
+ * [flowId=XXX installerId=XXX flowPathType = XXX flowPathUserState = XXX
+ * flowPathFlags=XXX dataPath=XXX flowEntryMatch=XXX
+ * flowEntryActions=XXX]
*
* @return the flow path as a string.
*/
@@ -330,6 +352,7 @@
String ret = "[flowId=" + this.flowId.toString();
ret += " installerId=" + this.installerId.toString();
ret += " flowPathType=" + this.flowPathType;
+ ret += " flowPathUserState=" + this.flowPathUserState;
ret += " flowPathFlags=" + this.flowPathFlags.toString();
if (dataPath != null)
ret += " dataPath=" + this.dataPath.toString();
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPathUserState.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPathUserState.java
new file mode 100644
index 0000000..96b6345
--- /dev/null
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPathUserState.java
@@ -0,0 +1,11 @@
+package net.onrc.onos.ofcontroller.util;
+
+/**
+ * The Flow Path state as set by the user (via the ONOS API).
+ */
+public enum FlowPathUserState {
+ FP_USER_UNKNOWN, // Initialization value: state unknown
+ FP_USER_ADD, // Flow path that is added
+ FP_USER_MODIFY, // Flow path that is modified
+ FP_USER_DELETE // Flow path that is deleted
+}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/serializers/KryoFactory.java b/src/main/java/net/onrc/onos/ofcontroller/util/serializers/KryoFactory.java
index 45a43bf..eeb307f 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/serializers/KryoFactory.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/serializers/KryoFactory.java
@@ -114,6 +114,7 @@
kryo.register(FlowPath.class);
kryo.register(FlowPathFlags.class);
kryo.register(FlowPathType.class);
+ kryo.register(FlowPathUserState.class);
kryo.register(IPv4.class);
kryo.register(IPv4Net.class);
kryo.register(IPv6.class);