Added per node flow query 19/2119/1
authorAsad Ahmed <asaahmed@cisco.com>
Wed, 23 Oct 2013 20:59:54 +0000 (13:59 -0700)
committerAsad Ahmed <asaahmed@cisco.com>
Wed, 23 Oct 2013 21:08:19 +0000 (14:08 -0700)
Change-Id: Iab10ad1a38b69786ff2f3b36b070bcca40cc8ee5
Signed-off-by: Asad Ahmed <asaahmed@cisco.com>
opendaylight/commons/opendaylight/pom.xml
opendaylight/distribution/opendaylight/pom.xml
opendaylight/forwardingrulesmanager/api/pom.xml
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/IForwardingRulesManager.java
opendaylight/forwardingrulesmanager/implementation/pom.xml
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java
opendaylight/forwardingrulesmanager/integrationtest/pom.xml
opendaylight/northbound/integrationtest/pom.xml

index 10b4cea..11373d9 100644 (file)
@@ -94,6 +94,7 @@
     <!-- Sonar properties using jacoco to retrieve integration test results -->
     <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
     <sonar.language>java</sonar.language>
+    <forwardingrulesmanager.version>0.5.0-SNAPSHOT</forwardingrulesmanager.version>
   </properties>
 
   <dependencyManagement>
index a3a323f..e7a612d 100644 (file)
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>forwardingrulesmanager</artifactId>
-      <version>${controller.version}</version>
+      <version>${forwardingrulesmanager.version}</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
index d63d2c7..2de9287 100644 (file)
@@ -15,7 +15,7 @@
   </scm>
 
   <artifactId>forwardingrulesmanager</artifactId>
-  <version>0.4.1-SNAPSHOT</version>
+  <version>0.5.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <build>
index 9f0005e..9d68f84 100644 (file)
@@ -433,4 +433,27 @@ public interface IForwardingRulesManager {
 
     public PortGroupProvider getPortGroupProvider();
 
+    /**
+     * Returns the list of Flow entries for a network node.
+     * This list contains the flows as they were
+     * requested to be installed by the applications, before any merging with
+     * container flow is done.
+     *
+     * @param node
+     * @return the original list of flow entries belonging to the specified node
+     */
+    public List<FlowEntry> getFlowEntriesForNode(Node node);
+
+    /**
+     * Returns the list of Flow entries installed in a network node.
+     * 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 as returned
+     * by getFlowEntriesForNode(Node node).
+     *
+     * @param node
+     * @return the list of container flow merged flow entries belonging to the specified node
+     */
+    public List<FlowEntry> getInstalledFlowEntriesForNode(Node node);
+
 }
index 7104250..828d12b 100644 (file)
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>forwardingrulesmanager</artifactId>
-      <version>0.4.1-SNAPSHOT</version>
+      <version>0.5.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
index bbc6048..c811273 100644 (file)
@@ -3316,4 +3316,37 @@ public class ForwardingRulesManager implements
          * Do nothing
          */
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<FlowEntry> getFlowEntriesForNode(Node node) {
+        List<FlowEntry> list = new ArrayList<FlowEntry>();
+        if (node != null) {
+            for (Map.Entry<FlowEntry, FlowEntry> entry : this.originalSwView.entrySet()) {
+                if (node.equals(entry.getKey().getNode())) {
+                    list.add(entry.getKey().clone());
+                }
+            }
+        }
+        return list;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<FlowEntry> getInstalledFlowEntriesForNode(Node node) {
+        List<FlowEntry> list = new ArrayList<FlowEntry>();
+        if (node != null) {
+            List<FlowEntryInstall> flowEntryInstallList = this.nodeFlows.get(node);
+            if(flowEntryInstallList != null) {
+                for(FlowEntryInstall fi: flowEntryInstallList) {
+                    list.add(fi.getInstall().clone());
+                }
+            }
+        }
+        return list;
+    }
 }
index b84a01b..fa6f0ab 100644 (file)
@@ -90,7 +90,7 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>forwardingrulesmanager</artifactId>
-      <version>0.4.1-SNAPSHOT</version>
+      <version>0.5.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
index db1e042..04c152a 100644 (file)
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>forwardingrulesmanager</artifactId>
-      <version>0.4.1-SNAPSHOT</version>
+      <version>0.5.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>