From: Pramila Singh Date: Tue, 3 Dec 2013 23:48:29 +0000 (-0800) Subject: Added a generic API to return a list of configured switches that are not connected... X-Git-Tag: jenkins-controller-bulk-release-prepare-only-2-1~257^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=594a785f45bd3cfa8046762fa6c2dad2615b7165 Added a generic API to return a list of configured switches that are not connected to the controller Change-Id: Ide319117b4038f6f1d72fa8091d1015678be5a60 Signed-off-by: Pramila Singh --- diff --git a/opendaylight/clustering/integrationtest/pom.xml b/opendaylight/clustering/integrationtest/pom.xml index ca1e37e3be..7e9b638473 100644 --- a/opendaylight/clustering/integrationtest/pom.xml +++ b/opendaylight/clustering/integrationtest/pom.xml @@ -26,7 +26,7 @@ org.opendaylight.controller sal - 0.5.1-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller diff --git a/opendaylight/commons/opendaylight/pom.xml b/opendaylight/commons/opendaylight/pom.xml index a652845770..bd41e80717 100644 --- a/opendaylight/commons/opendaylight/pom.xml +++ b/opendaylight/commons/opendaylight/pom.xml @@ -84,9 +84,9 @@ 0.2.3-SNAPSHOT 1.0-SNAPSHOT 0.5.1-SNAPSHOT - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT 0.1.1-SNAPSHOT - 0.6.0-SNAPSHOT + 0.7.0-SNAPSHOT 0.0.2-SNAPSHOT 0.1.1-SNAPSHOT 0.0.2-SNAPSHOT diff --git a/opendaylight/configuration/integrationtest/pom.xml b/opendaylight/configuration/integrationtest/pom.xml index 894f94bc46..b9a9f8c66b 100644 --- a/opendaylight/configuration/integrationtest/pom.xml +++ b/opendaylight/configuration/integrationtest/pom.xml @@ -25,7 +25,7 @@ org.opendaylight.controller sal - 0.5.1-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller diff --git a/opendaylight/forwardingrulesmanager/integrationtest/pom.xml b/opendaylight/forwardingrulesmanager/integrationtest/pom.xml index 7904bd3a8f..9172903e6d 100644 --- a/opendaylight/forwardingrulesmanager/integrationtest/pom.xml +++ b/opendaylight/forwardingrulesmanager/integrationtest/pom.xml @@ -71,7 +71,7 @@ org.opendaylight.controller switchmanager - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller @@ -81,7 +81,7 @@ org.opendaylight.controller sal - 0.5.1-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller diff --git a/opendaylight/hosttracker/integrationtest/pom.xml b/opendaylight/hosttracker/integrationtest/pom.xml index 8f4163d686..d4f118c364 100644 --- a/opendaylight/hosttracker/integrationtest/pom.xml +++ b/opendaylight/hosttracker/integrationtest/pom.xml @@ -31,7 +31,7 @@ org.opendaylight.controller sal - 0.5.1-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller @@ -70,7 +70,7 @@ org.opendaylight.controller switchmanager - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller diff --git a/opendaylight/northbound/integrationtest/pom.xml b/opendaylight/northbound/integrationtest/pom.xml index b4e0b34d09..9fae7e25fb 100644 --- a/opendaylight/northbound/integrationtest/pom.xml +++ b/opendaylight/northbound/integrationtest/pom.xml @@ -49,7 +49,7 @@ org.opendaylight.controller sal - 0.5.1-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller @@ -134,7 +134,7 @@ org.opendaylight.controller switchmanager - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller diff --git a/opendaylight/protocol_plugins/openflow/pom.xml b/opendaylight/protocol_plugins/openflow/pom.xml index ca0ff45d61..ceeb29a1fc 100644 --- a/opendaylight/protocol_plugins/openflow/pom.xml +++ b/opendaylight/protocol_plugins/openflow/pom.xml @@ -70,7 +70,7 @@ org.opendaylight.controller sal - 0.6.0-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryService.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryService.java index f983e1244d..39bbecf021 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryService.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryService.java @@ -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 getConfiguredNotConnectedNodes() { + return Collections.emptySet(); + } + @Override public ConcurrentMap> getNodeConnectorProps( Boolean refresh) { diff --git a/opendaylight/sal/api/pom.xml b/opendaylight/sal/api/pom.xml index 60e17e264e..405f924554 100644 --- a/opendaylight/sal/api/pom.xml +++ b/opendaylight/sal/api/pom.xml @@ -16,7 +16,7 @@ sal - 0.6.0-SNAPSHOT + 0.7.0-SNAPSHOT bundle diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/inventory/IInventoryService.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/inventory/IInventoryService.java index 3c58ecbfcd..fa3afd8173 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/inventory/IInventoryService.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/inventory/IInventoryService.java @@ -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> 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 getConfiguredNotConnectedNodes(); /** * The method retrieve all the existing nodeConnectors and their properties * diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/inventory/IPluginInInventoryService.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/inventory/IPluginInInventoryService.java index 5822731f26..4007dc86e7 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/inventory/IPluginInInventoryService.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/inventory/IPluginInInventoryService.java @@ -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> 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 getConfiguredNotConnectedNodes(); } diff --git a/opendaylight/sal/implementation/pom.xml b/opendaylight/sal/implementation/pom.xml index f260f315e0..7c92a6b52b 100644 --- a/opendaylight/sal/implementation/pom.xml +++ b/opendaylight/sal/implementation/pom.xml @@ -59,7 +59,7 @@ org.opendaylight.controller sal - 0.5.1-SNAPSHOT + 0.7.0-SNAPSHOT equinoxSDK381 diff --git a/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/Inventory.java b/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/Inventory.java index 1cc57bac66..fbb9fbc518 100644 --- a/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/Inventory.java +++ b/opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/Inventory.java @@ -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 getConfiguredNotConnectedNodes() { + Set configuredNotConnected = new HashSet(), rv; + for (IPluginInInventoryService s : this.pluginService) { + rv = s.getConfiguredNotConnectedNodes(); + if (rv != null) { + configuredNotConnected.addAll(rv); + } + } + return configuredNotConnected; + } + @Override public ConcurrentMap> getNodeConnectorProps() { ConcurrentMap> ncProps = diff --git a/opendaylight/statisticsmanager/integrationtest/pom.xml b/opendaylight/statisticsmanager/integrationtest/pom.xml index 743c6784a5..8a7fed6e06 100644 --- a/opendaylight/statisticsmanager/integrationtest/pom.xml +++ b/opendaylight/statisticsmanager/integrationtest/pom.xml @@ -25,7 +25,7 @@ org.opendaylight.controller sal - 0.5.1-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller @@ -75,7 +75,7 @@ org.opendaylight.controller switchmanager - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT diff --git a/opendaylight/switchmanager/api/pom.xml b/opendaylight/switchmanager/api/pom.xml index cf4c514965..b9cac8f2f8 100644 --- a/opendaylight/switchmanager/api/pom.xml +++ b/opendaylight/switchmanager/api/pom.xml @@ -16,7 +16,7 @@ switchmanager - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT bundle diff --git a/opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/ISwitchManager.java b/opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/ISwitchManager.java index 8815e5e8c0..072544c214 100644 --- a/opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/ISwitchManager.java +++ b/opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/ISwitchManager.java @@ -66,6 +66,13 @@ public interface ISwitchManager { */ public List 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 getConfiguredNotConnectedSwitches(); + /** * Return a list of subnet that were previously configured * diff --git a/opendaylight/switchmanager/implementation/pom.xml b/opendaylight/switchmanager/implementation/pom.xml index 1e78ec7a3d..76bfd56c29 100644 --- a/opendaylight/switchmanager/implementation/pom.xml +++ b/opendaylight/switchmanager/implementation/pom.xml @@ -107,12 +107,12 @@ org.opendaylight.controller sal - 0.5.1-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller switchmanager - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller diff --git a/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java b/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java index 4d2aea2036..4950cae33a 100644 --- a/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java +++ b/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java @@ -2155,4 +2155,25 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa return (desc == null /* || desc.getValue().equalsIgnoreCase("none") */) ? "" : desc.getValue(); } + + @Override + public Set getConfiguredNotConnectedSwitches() { + Set configuredNotConnectedSwitches = new HashSet(); + if (this.inventoryService == null) { + log.trace("inventory service not avaiable"); + return configuredNotConnectedSwitches; + } + + Set configuredNotConnectedNodes = this.inventoryService.getConfiguredNotConnectedNodes(); + if (configuredNotConnectedNodes != null) { + for (Node node : configuredNotConnectedNodes) { + Switch sw = getSwitchByNode(node); + if (sw != null) { + configuredNotConnectedSwitches.add(sw); + } + } + } + return configuredNotConnectedSwitches; + } + } diff --git a/opendaylight/switchmanager/integrationtest/pom.xml b/opendaylight/switchmanager/integrationtest/pom.xml index 5d8ce9b303..297b52bd2f 100644 --- a/opendaylight/switchmanager/integrationtest/pom.xml +++ b/opendaylight/switchmanager/integrationtest/pom.xml @@ -21,7 +21,7 @@ org.opendaylight.controller switchmanager - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller @@ -31,7 +31,7 @@ org.opendaylight.controller sal - 0.5.1-SNAPSHOT + 0.7.0-SNAPSHOT org.opendaylight.controller