[ONOS-4992] Modify the return signature for FlowRuleService for consistent return object
Change-Id: I06154d79ea9d875c503369dcb77d5fffcfbd4467
diff --git a/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java b/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
index 50d74fc..17df9c4 100644
--- a/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
+++ b/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
@@ -264,6 +264,7 @@
removeFlowRules(Iterables.toArray(getFlowRulesById(id), FlowRule.class));
}
+ @Deprecated
@Override
public Iterable<FlowRule> getFlowRulesById(ApplicationId id) {
checkPermission(FLOWRULE_READ);
@@ -280,6 +281,21 @@
}
@Override
+ public Iterable<FlowEntry> getFlowEntriesById(ApplicationId id) {
+ checkPermission(FLOWRULE_READ);
+
+ Set<FlowEntry> flowEntries = Sets.newHashSet();
+ for (Device d : deviceService.getDevices()) {
+ for (FlowEntry flowEntry : store.getFlowEntries(d.id())) {
+ if (flowEntry.appId() == id.id()) {
+ flowEntries.add(flowEntry);
+ }
+ }
+ }
+ return flowEntries;
+ }
+
+ @Override
public Iterable<FlowRule> getFlowRulesByGroupId(ApplicationId appId, short groupId) {
checkPermission(FLOWRULE_READ);