Optimize filtering flow rule counts by state
Change-Id: I1e1d80b8e618743ee449162a081cf42e71c99abf
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 449a1fd..07493a8 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
@@ -45,6 +45,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 stored flow.
*
* @param rule the rule to look for
@@ -154,6 +165,8 @@
*
* @param deviceId the device ID
* @return number of flow rules in ADDED state
+ * @deprecated since 2.1
*/
+ @Deprecated
long getActiveFlowRuleCount(DeviceId deviceId);
}