Return null instead of throw exception for invalid event states.

Change-Id: Ie40ca4dc1c241aa4f27652aa4e8b3f99eb924169
diff --git a/core/api/src/main/java/org/onosproject/net/intent/IntentEvent.java b/core/api/src/main/java/org/onosproject/net/intent/IntentEvent.java
index b1571ad..3b7c6c6 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/IntentEvent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/IntentEvent.java
@@ -72,10 +72,26 @@
         super(type, intent);
     }
 
+    /**
+     * Creates an IntentEvent based on the state contained in the given intent
+     * data. Some states are not sent as external events, and these states will
+     * return null events.
+     *
+     * @param data the intent data to create an event for
+     * @return new intent event if the state is valid, otherwise null.
+     */
     public static IntentEvent getEvent(IntentData data) {
         return getEvent(data.state(), data.intent());
     }
 
+    /**
+     * Creates an IntentEvent based on the given state and intent. Some states
+     * are not sent as external events, and these states will return null events.
+     *
+     * @param state new state of the intent
+     * @param intent intent to put in event
+     * @return new intent event if the state is valid, otherwise null.
+     */
     public static IntentEvent getEvent(IntentState state, Intent intent) {
         Type type;
         switch (state) {
@@ -95,14 +111,13 @@
                 type = Type.FAILED;
                 break;
 
-            //fallthrough to default from here
+            // fallthrough to default from here
             case COMPILING:
             case INSTALLING:
             case RECOMPILING:
             case WITHDRAWING:
             default:
-                throw new IllegalArgumentException(
-                        "Intent event cannot have transient state: " + state);
+                return null;
         }
         return new IntentEvent(type, intent);
     }