From: Alessandro Boch Date: Mon, 19 Aug 2013 16:12:53 +0000 (-0700) Subject: FRM to expose list of installed flow entries per group X-Git-Tag: releasepom-0.1.0~196 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=759571ec891a260413a377483b45abe2e17fe18b FRM to expose list of installed flow entries per group ISSUE: Given a group/policy name, ForwardingRulesManager only provides a function to return the list of Flow Entry it was requested to install. In presence of container flows, this list does not represent the actual entries which were installed on the network nodes for that group. CHANGE: Add getInstalledFlowEntriesForGroup(String policyName) to IForwardingRulesManager. Change-Id: Ie26d64c05d5eb49b3073d34d701ea1fa5b05adfa Signed-off-by: Alessandro Boch --- diff --git a/opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/IForwardingRulesManager.java b/opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/IForwardingRulesManager.java index 4b8257488e..9f0005e7fb 100644 --- a/opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/IForwardingRulesManager.java +++ b/opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/IForwardingRulesManager.java @@ -199,14 +199,29 @@ public interface IForwardingRulesManager { /** * Returns the list of Flow entries across network nodes which are part of - * the same flow group, policy + * the same flow group, policy. This list contains the flows as they were + * requested to be installed by the applications, before any merging with + * container flow is done. * * @param group * the group name - * @return the list of flow entries belonging to the specified group + * @return the original list of flow entries belonging to the specified group */ public List getFlowEntriesForGroup(String group); + /** + * Returns the list of Flow entries installed in network nodes which are part of + * the same flow group, policy. This list contains the effective flows installed + * on the nodes after the merging with any possible container flow was performed. + * If no container flow are specified, this method returns the same list returned + * by getFlowEntriesForGroup(String group). + * + * @param group + * the group name + * @return the list of container flow merged flow entries belonging to the specified group + */ + public List getInstalledFlowEntriesForGroup(String policyName); + /** * Add a list of output port to the flow with the specified name on the * specified network node diff --git a/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java b/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java index e7a8a8e22c..57f3e8eb36 100644 --- a/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java +++ b/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java @@ -1034,6 +1034,19 @@ public class ForwardingRulesManager implements IForwardingRulesManager, PortGrou return list; } + @Override + public List getInstalledFlowEntriesForGroup(String policyName) { + List list = new ArrayList(); + if (policyName != null && !policyName.trim().isEmpty()) { + for (Map.Entry entry : this.installedSwView.entrySet()) { + if (policyName.equals(entry.getKey().getGroupName())) { + list.add(entry.getKey().getInstall().clone()); + } + } + } + return list; + } + @Override public void addOutputPort(Node node, String flowName, List portList) {