Initial implementation of CORRUPT state (ONOS-1060)

- Added CORRUPT state to state machine and event type
- Simplified phases using new request field
- Improved null-safety by using Optionals

Change-Id: I1d576b719765b5664aef73477ee04593e8acc4fd
diff --git a/core/api/src/main/java/org/onosproject/net/intent/IntentState.java b/core/api/src/main/java/org/onosproject/net/intent/IntentState.java
index 3b3d391..e36bf4c 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/IntentState.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/IntentState.java
@@ -89,10 +89,19 @@
     WITHDRAWN,
 
     /**
-     * Signifies that the intent has failed compiling, installing or
-     * recompiling states.
+     * Signifies that the intent has failed to be installed and cannot be
+     * satisfied given current network conditions. But, the framework will
+     * reattempt to install it when network conditions change until it is
+     * withdrawn by an application.
      */
-    FAILED, //TODO consider renaming to UNSAT.
+    FAILED, //TODO consider renaming to UNSATISFIABLE
+
+    /**
+     * Signifies that an intent has failed either installation or withdrawal,
+     * and still hold some or all of its resources.
+     * (e.g. link reservations, flow rules on the data plane, etc.)
+     */
+    CORRUPT, //TODO consider renaming to ERROR
 
     /**
      * Indicates that the intent should be purged from the database.