ONOS-3763 Change flow state to PENDING_ADD when retrying

Will emit a RULE_UPDATE event if the state is changed.
Update unit test accordingly.

Change-Id: Ie84778c62f52f15b7636d41db246814145e73f77
diff --git a/core/api/src/main/java/org/onosproject/net/flow/FlowRuleStore.java b/core/api/src/main/java/org/onosproject/net/flow/FlowRuleStore.java
index d81c73c..ae20f2a 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/FlowRuleStore.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/FlowRuleStore.java
@@ -97,6 +97,16 @@
     FlowRuleEvent removeFlowRule(FlowEntry rule);
 
     /**
+     * Marks a flow rule as PENDING_ADD during retry.
+     *
+     * Emits flow_update event if the state is changed
+     *
+     * @param rule the flow rule that is retrying
+     * @return flow_updated event, or null if nothing updated
+     */
+    FlowRuleEvent pendingFlowRule(FlowEntry rule);
+
+    /**
      * Updates the flow table statistics of the specified device using
      * the given statistics.
      *