Optimize filtering flow rule counts by state

Change-Id: I1e1d80b8e618743ee449162a081cf42e71c99abf
diff --git a/core/api/src/main/java/org/onosproject/net/flow/FlowRuleService.java b/core/api/src/main/java/org/onosproject/net/flow/FlowRuleService.java
index af9e57f..78aef84 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/FlowRuleService.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/FlowRuleService.java
@@ -53,6 +53,17 @@
     }
 
     /**
+     * Returns the number of flow rules in the given state for the given device.
+     *
+     * @param deviceId the device identifier
+     * @param state the state for which to count flow rules
+     * @return number of flow rules in the given state for the given device
+     */
+    default int getFlowRuleCount(DeviceId deviceId, FlowEntry.FlowEntryState state) {
+        return 0;
+    }
+
+    /**
      * Returns the collection of flow entries applied on the specified device.
      * This will include flow rules which may not yet have been applied to
      * the device.
@@ -162,7 +173,9 @@
      *
      * @param deviceId device identifier
      * @return number of flow rules in ADDED state
+     * @deprecated since 2.1
      */
+    @Deprecated
     default long getActiveFlowRuleCount(DeviceId deviceId) {
         return 0;
     }