Added WITHDRAW_REQ Intent State for ONOS-146
Fixed flow removed from other instance
Change-Id: I22c88a447e26770fea8b7e23f4a78b1389077ad1
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/DefaultFlowRule.java b/core/api/src/main/java/org/onlab/onos/net/flow/DefaultFlowRule.java
index b175535..168f044 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/DefaultFlowRule.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/DefaultFlowRule.java
@@ -176,7 +176,6 @@
if (obj instanceof DefaultFlowRule) {
DefaultFlowRule that = (DefaultFlowRule) obj;
return Objects.equals(deviceId, that.deviceId) &&
- Objects.equals(id, that.id) &&
Objects.equals(priority, that.priority) &&
Objects.equals(selector, that.selector);
diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/IntentEvent.java b/core/api/src/main/java/org/onlab/onos/net/intent/IntentEvent.java
index 495f3ea..37261e9 100644
--- a/core/api/src/main/java/org/onlab/onos/net/intent/IntentEvent.java
+++ b/core/api/src/main/java/org/onlab/onos/net/intent/IntentEvent.java
@@ -24,9 +24,9 @@
public enum Type {
/**
- * Signifies that a new intent has been submitted to the system.
+ * Signifies that an intent is to be installed or reinstalled.
*/
- SUBMITTED,
+ INSTALL_REQ,
/**
* Signifies that an intent has been successfully installed.
@@ -39,6 +39,11 @@
FAILED,
/**
+ * Signifies that an intent will be withdrawn.
+ */
+ WITHDRAW_REQ,
+
+ /**
* Signifies that an intent has been withdrawn from the system.
*/
WITHDRAWN
@@ -70,12 +75,15 @@
public static IntentEvent getEvent(IntentState state, Intent intent) {
Type type;
switch (state) {
- case SUBMITTED:
- type = Type.SUBMITTED;
+ case INSTALL_REQ:
+ type = Type.INSTALL_REQ;
break;
case INSTALLED:
type = Type.INSTALLED;
break;
+ case WITHDRAW_REQ:
+ type = Type.WITHDRAW_REQ;
+ break;
case WITHDRAWN:
type = Type.WITHDRAWN;
break;
diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/IntentState.java b/core/api/src/main/java/org/onlab/onos/net/intent/IntentState.java
index 0e9211d..4a534c1 100644
--- a/core/api/src/main/java/org/onlab/onos/net/intent/IntentState.java
+++ b/core/api/src/main/java/org/onlab/onos/net/intent/IntentState.java
@@ -26,9 +26,11 @@
* local controller instance.
* <p>
* All intent in the runtime take this state first.
+ * </p><p>
+ * Intents will also pass through this state when they are updated.
* </p>
*/
- SUBMITTED,
+ INSTALL_REQ,
/**
* Signifies that the intent is being compiled into installable intents.
@@ -67,16 +69,11 @@
RECOMPILING,
/**
- * TODO: Indicated that an intent will soon be recompiled.
- */
- //UPDATE,
-
- /**
- * TODO.
* Indicates that an application has requested that an intent be withdrawn.
- * It will start withdrawing short, but not necessarily on this instance.
+ * It will start withdrawing shortly, but not necessarily on this instance.
+ * Intents can also be parked here if it is impossible to withdraw them.
*/
- //WITHDRAW_REQ,
+ WITHDRAW_REQ,
/**
* Indicates that the intent is being withdrawn. This is a transitional