Added a generic API to return a list of configured switches that are not connected... 19/3419/7
authorPramila Singh <pramisin@cisco.com>
Tue, 3 Dec 2013 23:48:29 +0000 (15:48 -0800)
committerPramila Singh <pramisin@cisco.com>
Thu, 5 Dec 2013 00:07:53 +0000 (16:07 -0800)
Change-Id: Ide319117b4038f6f1d72fa8091d1015678be5a60
Signed-off-by: Pramila Singh <pramisin@cisco.com>
19 files changed:
opendaylight/clustering/integrationtest/pom.xml
opendaylight/commons/opendaylight/pom.xml
opendaylight/configuration/integrationtest/pom.xml
opendaylight/forwardingrulesmanager/integrationtest/pom.xml
opendaylight/hosttracker/integrationtest/pom.xml
opendaylight/northbound/integrationtest/pom.xml
opendaylight/protocol_plugins/openflow/pom.xml
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryService.java
opendaylight/sal/api/pom.xml
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/inventory/IInventoryService.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/inventory/IPluginInInventoryService.java
opendaylight/sal/implementation/pom.xml
opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/Inventory.java
opendaylight/statisticsmanager/integrationtest/pom.xml
opendaylight/switchmanager/api/pom.xml
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/ISwitchManager.java
opendaylight/switchmanager/implementation/pom.xml
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java
opendaylight/switchmanager/integrationtest/pom.xml

index ca1e37e..7e9b638 100644 (file)
@@ -26,7 +26,7 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
-      <version>0.5.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
index a652845..bd41e80 100644 (file)
@@ -84,9 +84,9 @@
     <netconf.version>0.2.3-SNAPSHOT</netconf.version>
     <mdsal.version>1.0-SNAPSHOT</mdsal.version>
     <containermanager.version>0.5.1-SNAPSHOT</containermanager.version>
-    <switchmanager.api.version>0.6.1-SNAPSHOT</switchmanager.api.version>
+    <switchmanager.api.version>0.7.0-SNAPSHOT</switchmanager.api.version>
     <connectionmanager.version>0.1.1-SNAPSHOT</connectionmanager.version>
-    <sal.version>0.6.0-SNAPSHOT</sal.version>
+    <sal.version>0.7.0-SNAPSHOT</sal.version>
     <sal.networkconfiguration.version>0.0.2-SNAPSHOT</sal.networkconfiguration.version>
     <sal.connection.version>0.1.1-SNAPSHOT</sal.connection.version>
     <networkconfig.bridgedomain.northbound.version>0.0.2-SNAPSHOT</networkconfig.bridgedomain.northbound.version>
index 894f94b..b9a9f8c 100644 (file)
@@ -25,7 +25,7 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
-      <version>0.5.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
      <dependency>
       <groupId>org.opendaylight.controller</groupId>
index 7904bd3..9172903 100644 (file)
@@ -71,7 +71,7 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>switchmanager</artifactId>
-      <version>0.6.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
@@ -81,7 +81,7 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
-      <version>0.5.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
index 8f4163d..d4f118c 100644 (file)
@@ -31,7 +31,7 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
-      <version>0.5.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
@@ -70,7 +70,7 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>switchmanager</artifactId>
-      <version>0.6.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
index b4e0b34..9fae7e2 100644 (file)
@@ -49,7 +49,7 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
-      <version>0.5.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>switchmanager</artifactId>
-      <version>0.6.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
index ca0ff45..ceeb29a 100644 (file)
@@ -70,7 +70,7 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
-      <version>0.6.0-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
index f983e12..39bbecf 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.controller.protocol_plugin.openflow.internal;
 
+import java.util.Collections;
 import java.util.Dictionary;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -138,6 +139,12 @@ public class InventoryService implements IInventoryShimInternalListener,
         return nodeProps;
     }
 
+    // nothing to return
+    @Override
+    public Set<Node> getConfiguredNotConnectedNodes() {
+        return Collections.emptySet();
+    }
+
     @Override
     public ConcurrentMap<NodeConnector, Map<String, Property>> getNodeConnectorProps(
             Boolean refresh) {
index 60e17e2..405f924 100644 (file)
@@ -16,7 +16,7 @@
   </scm>
 
   <artifactId>sal</artifactId>
-  <version>0.6.0-SNAPSHOT</version>
+  <version>0.7.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <build>
index 3c58ecb..fa3afd8 100644 (file)
@@ -10,6 +10,7 @@
 package org.opendaylight.controller.sal.inventory;
 
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.ConcurrentMap;
 
 import org.opendaylight.controller.sal.core.Node;
@@ -28,6 +29,13 @@ public interface IInventoryService {
      */
     public ConcurrentMap<Node, Map<String, Property>> getNodeProps();
 
+    /**
+     * The method retrieves all the configured nodes that are not connected to
+     * the controller
+     *
+     * @return Set of {@link org.opendaylight.controller.sal.core.Node}
+     */
+    public Set<Node> getConfiguredNotConnectedNodes();
     /**
      * The method retrieve all the existing nodeConnectors and their properties
      *
index 5822731..4007dc8 100644 (file)
@@ -10,6 +10,7 @@
 package org.opendaylight.controller.sal.inventory;
 
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.ConcurrentMap;
 
 import org.opendaylight.controller.sal.core.Node;
@@ -36,4 +37,12 @@ public interface IPluginInInventoryService {
      */
     public ConcurrentMap<NodeConnector, Map<String, Property>> getNodeConnectorProps(
             Boolean refresh);
+
+    /**
+     * The method retrieves all the configured nodes that are not connected to
+     * the controller
+     *
+     * @return Set of {@link org.opendaylight.controller.sal.core.Node}
+     */
+    public Set<Node> getConfiguredNotConnectedNodes();
 }
index f260f31..7c92a6b 100644 (file)
@@ -59,7 +59,7 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
-      <version>0.5.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>equinoxSDK381</groupId>
index 1cc57ba..fbb9fbc 100644 (file)
@@ -9,6 +9,7 @@
 
 package org.opendaylight.controller.sal.implementation.internal;
 
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -145,6 +146,18 @@ public class Inventory implements IPluginOutInventoryService, IInventoryService
         return nodeProps;
     }
 
+    @Override
+    public Set<Node> getConfiguredNotConnectedNodes() {
+        Set<Node> configuredNotConnected = new HashSet<Node>(), rv;
+        for (IPluginInInventoryService s : this.pluginService) {
+            rv = s.getConfiguredNotConnectedNodes();
+            if (rv != null) {
+                configuredNotConnected.addAll(rv);
+            }
+        }
+        return configuredNotConnected;
+    }
+
     @Override
     public ConcurrentMap<NodeConnector, Map<String, Property>> getNodeConnectorProps() {
         ConcurrentMap<NodeConnector, Map<String, Property>> ncProps =
index 743c678..8a7fed6 100644 (file)
@@ -25,7 +25,7 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
-      <version>0.5.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
      <dependency>
       <groupId>org.opendaylight.controller</groupId>
@@ -75,7 +75,7 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>switchmanager</artifactId>
-      <version>0.6.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
 
       <dependency>
index cf4c514..b9cac8f 100644 (file)
@@ -16,7 +16,7 @@
   </scm>
 
   <artifactId>switchmanager</artifactId>
-  <version>0.6.1-SNAPSHOT</version>
+  <version>0.7.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <properties>
index 8815e5e..072544c 100644 (file)
@@ -66,6 +66,13 @@ public interface ISwitchManager {
      */
     public List<Switch> getNetworkDevices();
 
+    /**
+     * Return a Set of all configured devices that are not connected to the controller
+     *
+     * @return Set of {@link org.opendaylight.controller.switchmanager.Switch}
+     */
+    public Set<Switch> getConfiguredNotConnectedSwitches();
+
     /**
      * Return a list of subnet that were previously configured
      *
index 1e78ec7..76bfd56 100644 (file)
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
-      <version>0.5.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>switchmanager</artifactId>
-      <version>0.6.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
index 4d2aea2..4950cae 100644 (file)
@@ -2155,4 +2155,25 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
         return (desc == null /* || desc.getValue().equalsIgnoreCase("none") */) ? ""
                 : desc.getValue();
     }
+
+    @Override
+    public Set<Switch> getConfiguredNotConnectedSwitches() {
+        Set<Switch> configuredNotConnectedSwitches = new HashSet<Switch>();
+        if (this.inventoryService == null) {
+            log.trace("inventory service not avaiable");
+            return configuredNotConnectedSwitches;
+        }
+
+        Set<Node> configuredNotConnectedNodes = this.inventoryService.getConfiguredNotConnectedNodes();
+        if (configuredNotConnectedNodes != null) {
+            for (Node node : configuredNotConnectedNodes) {
+                Switch sw = getSwitchByNode(node);
+                if (sw != null) {
+                    configuredNotConnectedSwitches.add(sw);
+                }
+            }
+        }
+        return configuredNotConnectedSwitches;
+    }
+
 }
index 5d8ce9b..297b52b 100644 (file)
@@ -21,7 +21,7 @@
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>switchmanager</artifactId>
-      <version>0.6.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
       <dependency>
       <groupId>org.opendaylight.controller</groupId>
@@ -31,7 +31,7 @@
      <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
-      <version>0.5.1-SNAPSHOT</version>
+      <version>0.7.0-SNAPSHOT</version>
     </dependency>
      <dependency>
       <groupId>org.opendaylight.controller</groupId>