Merge changes I8c23739a,Ia0e70828
authorEd Warnicke <eaw@cisco.com>
Mon, 27 Jan 2014 14:11:06 +0000 (14:11 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 27 Jan 2014 14:11:06 +0000 (14:11 +0000)
* changes:
  Bulk-add copyright headers to java files
  Bulk-add copyright headers to .xtend files

73 files changed:
opendaylight/appauth/pom.xml
opendaylight/arphandler/pom.xml
opendaylight/commons/opendaylight/pom.xml
opendaylight/configuration/api/pom.xml
opendaylight/configuration/api/src/main/java/org/opendaylight/controller/configuration/IConfigurationServiceCommon.java
opendaylight/configuration/implementation/src/main/java/org/opendaylight/controller/configuration/internal/Activator.java
opendaylight/configuration/implementation/src/main/java/org/opendaylight/controller/configuration/internal/ConfigurationService.java
opendaylight/configuration/implementation/src/main/java/org/opendaylight/controller/configuration/internal/ContainerConfigurationService.java
opendaylight/containermanager/api/pom.xml
opendaylight/containermanager/implementation/pom.xml
opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/Activator.java
opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerManager.java
opendaylight/distribution/opendaylight/pom.xml
opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini
opendaylight/forwarding/staticrouting/pom.xml
opendaylight/forwarding/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/internal/Activator.java
opendaylight/forwarding/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/internal/StaticRoutingImplementation.java
opendaylight/forwardingrulesmanager/api/pom.xml
opendaylight/forwardingrulesmanager/api/src/main/java/org/opendaylight/controller/forwardingrulesmanager/PortGroupConfig.java
opendaylight/forwardingrulesmanager/implementation/pom.xml
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/Activator.java
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java
opendaylight/hosttracker/api/pom.xml
opendaylight/hosttracker/implementation/pom.xml
opendaylight/hosttracker/integrationtest/pom.xml
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationBrokerImpl.xtend
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/BindingIndependentConnector.java
opendaylight/md-sal/sal-binding-it/src/main/java/org/opendaylight/controller/test/sal/binding/it/TestHelper.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/routing/AbstractDataReadRouter.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/service/AbstractDataBroker.xtend
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerConfigActivator.xtend
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/NotificationRouterImpl.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareRpcBroker.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.xtend
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/RpcProvisionRegistryProxy.java [new file with mode: 0644]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsProvider.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsUpdateCommiter.java
opendaylight/md-sal/test/sal-rest-connector-it/src/test/java/org/opendaylight/controller/test/restconf/it/ServiceProviderController.java
opendaylight/netconf/pom.xml
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/Activator.java
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFloatingIPInterface.java
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronNetworkInterface.java
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronPortInterface.java
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronRouterInterface.java
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSubnetInterface.java
opendaylight/networkconfiguration/neutron/pom.xml
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFloatingIP.java
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronNetwork.java
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronPort.java
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronRouter.java
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet.java
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/Neutron_IPs.java
opendaylight/northbound/commons/pom.xml
opendaylight/routing/dijkstra_implementation/pom.xml
opendaylight/statisticsmanager/api/pom.xml
opendaylight/statisticsmanager/implementation/pom.xml
opendaylight/switchmanager/api/pom.xml
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/SpanConfig.java
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/SwitchConfig.java
opendaylight/switchmanager/implementation/pom.xml
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/Activator.java
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java
opendaylight/switchmanager/integrationtest/pom.xml
opendaylight/topologymanager/implementation/src/main/java/org/opendaylight/controller/topologymanager/TopologyUserLinkConfig.java
opendaylight/topologymanager/implementation/src/main/java/org/opendaylight/controller/topologymanager/internal/Activator.java
opendaylight/topologymanager/implementation/src/main/java/org/opendaylight/controller/topologymanager/internal/TopologyManagerImpl.java
opendaylight/usermanager/api/pom.xml
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/ServerConfig.java
opendaylight/usermanager/api/src/main/java/org/opendaylight/controller/usermanager/UserConfig.java
opendaylight/usermanager/implementation/pom.xml
opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/Activator.java
opendaylight/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/UserManager.java
pom.xml

index 157a341094b0b2919b0e8e01cec75bf799b940dc..dab75f2c8d5e14234b4d7916c3f6b629e4c63f00 100644 (file)
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>usermanager</artifactId>
       </dependency>
-      <dependency>
-        <groupId>junit</groupId>
-          <artifactId>junit</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>equinoxSDK381</groupId>
-          <artifactId>javax.servlet</artifactId>
-        </dependency>
-        <!-- Spring security -->
-        <dependency>
-          <groupId>org.springframework.security</groupId>
-          <artifactId>spring-security-config</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.springframework.security</groupId>
-          <artifactId>spring-security-core</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.springframework.security</groupId>
-          <artifactId>spring-security-web</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.springframework.security</groupId>
-          <artifactId>spring-security-taglibs</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.springframework</groupId>
-          <artifactId>org.springframework.transaction</artifactId>
-        </dependency>
     </dependencies>
 </project>
index c04bccd00d673617edf966dfeaa7158e1b88f638..deb2172b95fb87ff7ef9f469431a56adacd9991b 100644 (file)
     </plugins>
   </build>
   <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>clustering.services</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal.connection</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>switchmanager</artifactId>
index 0f4577bbf6ea5a7142f84e335829170190f6a31b..00e4d4c6fb2c268504ee4d34fbe23349a0a44e2d 100644 (file)
     <opendaylight-l2-types.version>2013.08.27.2-SNAPSHOT</opendaylight-l2-types.version>
     <yang-ext.version>2013.09.07.2-SNAPSHOT</yang-ext.version>
     <javassist.version>3.17.1-GA</javassist.version>
-    <sample-toaster.version>1.0-SNAPSHOT</sample-toaster.version>
     <releaseplugin.version>2.3.2</releaseplugin.version>
     <commons.lang.version>3.1</commons.lang.version>
     <jacoco.version>0.5.3.201107060350</jacoco.version>
     <enforcer.version>1.3.1</enforcer.version>
     <bundle.plugin.version>2.3.7</bundle.plugin.version>
     <junit.version>4.8.1</junit.version>
-    <bgpcep.version>0.3.0-SNAPSHOT</bgpcep.version>
     <yangtools.version>0.6.0-SNAPSHOT</yangtools.version>
     <!--versions for bits of the controller -->
     <controller.version>0.4.1-SNAPSHOT</controller.version>
     <!-- Third party version -->
     <jersey-servlet.version>1.17</jersey-servlet.version>
     <corsfilter.version>7.0.42</corsfilter.version>
-    <!-- Northbound API version -->
-    <commons.northbound.version>0.4.1-SNAPSHOT</commons.northbound.version>
     <!-- Sonar properties using jacoco to retrieve integration test results -->
     <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
     <sonar.language>java</sonar.language>
         <artifactId>enunciate-core-annotations</artifactId>
         <version>${enunciate.version}</version>
       </dependency>
+
+        <!-- md-sal -->
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-common</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-common-util</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-netconf-connector</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-core-api</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-broker-impl</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-core-spi</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-common-api</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-common-impl</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-binding-api</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-binding-config</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-binding-broker-impl</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-compatibility</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-connector-api</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sal-rest-connector</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller.model</groupId>
+          <artifactId>model-inventory</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller.model</groupId>
+          <artifactId>model-flow-base</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller.model</groupId>
+          <artifactId>model-flow-service</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller.model</groupId>
+          <artifactId>model-flow-statistics</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller.model</groupId>
+          <artifactId>model-flow-management</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller.md</groupId>
+          <artifactId>inventory-manager</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller.md</groupId>
+          <artifactId>forwardingrules-manager</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller.md</groupId>
+          <artifactId>topology-lldp-discovery</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller.md</groupId>
+          <artifactId>topology-manager</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller.md</groupId>
+          <artifactId>statistics-manager</artifactId>
+          <version>${mdsal.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>concepts</artifactId>
+          <version>${concepts.version}</version>
+        </dependency>
+
+
+        <!-- config-->
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>config-api</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>config-manager</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>yang-jmx-generator</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>yang-store-api</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>yang-store-impl</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>logback-config</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>config-persister-api</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>config-persister-file-adapter</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>config-persister-file-xml-adapter</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>config-persister-directory-adapter</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>config-persister-directory-xml-adapter</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>config-persister-directory-autodetect-adapter</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>shutdown-api</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>shutdown-impl</artifactId>
+          <version>${config.version}</version>
+        </dependency>
+
+       <!-- Netconf -->
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>netconf-api</artifactId>
+          <version>${netconf.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>netconf-impl</artifactId>
+          <version>${netconf.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>netconf-util</artifactId>
+          <version>${netconf.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>netconf-client</artifactId>
+          <version>${netconf.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>netconf-mapping-api</artifactId>
+          <version>${netconf.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>netconf-ssh</artifactId>
+          <version>${netconf.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>config-netconf-connector</artifactId>
+          <version>${netconf.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>netconf-monitoring</artifactId>
+          <version>${netconf.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>${project.groupId}</groupId>
+          <artifactId>ietf-netconf-monitoring</artifactId>
+          <version>${netconf.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>${project.groupId}</groupId>
+          <artifactId>ietf-netconf-monitoring-extension</artifactId>
+          <version>${netconf.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>config-persister-impl</artifactId>
+          <version>${netconf.version}</version>
+        </dependency>
+
+         <!-- threadpool -->
+          <dependency>
+              <groupId>org.opendaylight.controller</groupId>
+              <artifactId>threadpool-config-api</artifactId>
+              <version>${config.version}</version>
+          </dependency>
+          <dependency>
+              <groupId>org.opendaylight.controller</groupId>
+              <artifactId>netty-config-api</artifactId>
+              <version>${config.version}</version>
+          </dependency>
+          <dependency>
+              <groupId>org.opendaylight.controller</groupId>
+              <artifactId>threadpool-config-impl</artifactId>
+              <version>${config.version}</version>
+          </dependency>
+          <dependency>
+              <groupId>org.opendaylight.controller</groupId>
+              <artifactId>netty-threadgroup-config</artifactId>
+              <version>${config.version}</version>
+          </dependency>
+          <dependency>
+              <groupId>org.opendaylight.controller</groupId>
+              <artifactId>netty-event-executor-config</artifactId>
+              <version>${config.version}</version>
+          </dependency>
+          <dependency>
+              <groupId>org.opendaylight.controller</groupId>
+              <artifactId>netty-timer-config</artifactId>
+              <version>${config.version}</version>
+          </dependency>
+
+          <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>configuration</artifactId>
+            <version>${configuration.version}</version>
+          </dependency>
+
     </dependencies>
   </dependencyManagement>
 
index 2e9104a4b05497c0178c16e2a2dc343d9f8a23bd..08dbd7c200691a0df3f9d0f605a43f59c92f520c 100644 (file)
@@ -28,8 +28,7 @@
         <configuration>
           <instructions>
             <Import-Package>
-              org.opendaylight.controller.sal.utils,
-              org.apache.commons.lang3.builder
+              org.opendaylight.controller.sal.utils
             </Import-Package>
             <Export-Package>
               org.opendaylight.controller.configuration
index 05eed6f23f78bc807becfac9bf98f7abc43bb719..bbc9ee1ee815f1e57660f7edc080987c116fa46d 100644 (file)
@@ -9,6 +9,9 @@
 
 package org.opendaylight.controller.configuration;
 
+import java.util.List;
+
+import org.opendaylight.controller.sal.utils.IObjectReader;
 import org.opendaylight.controller.sal.utils.Status;
 
 /**
@@ -27,4 +30,32 @@ public interface IConfigurationServiceCommon {
      * @return the Status object representing the result of the saving request
      */
     Status saveConfigurations();
+
+    /**
+     * Bundle will call this function to ask Configuration Manager to persist
+     * their configurations. It is up to the Configuration Manager to decide
+     * how the configuration will be persisted
+     *
+     * @param config
+     *            The bundle configuration as a collection of
+     *            ConfigurationObject
+     * @param storeName
+     *            The identifier for this configuration
+     * @return The Status of the operation
+     */
+    Status persistConfiguration(List<ConfigurationObject> config, String storeName);
+
+    /**
+     * Bundle will call this function to ask Configuration Manager to retrieve
+     * the configuration identified by the passed store name
+     *
+     * @param reader
+     *            The reader object for parsing the configuration provided by
+     *            the caller
+     * @param storeName
+     *            The identifier for the configuration
+     * @return The retrieved configuration as a collection of
+     *         ConfigurationObject
+     */
+    List<ConfigurationObject> retrieveConfiguration(IObjectReader reader, String storeName);
 }
index ae0519903fa6d48231f1aca0178292ddd89ac4d6..c798eeb05de0883e46aab84bb6d933bd934439fb 100644 (file)
@@ -128,8 +128,7 @@ public class Activator extends ComponentActivatorAbstractBase {
             // export the service
             c.setInterface(
                     new String[] { IConfigurationService.class.getName(),
-                            ICacheUpdateAware.class.getName()},
-                            props);
+                            ICacheUpdateAware.class.getName() }, props);
 
             c.add(createServiceDependency().setService(
                     IClusterGlobalServices.class).setCallbacks(
index e6bbcf8eb6cdacfe81232e52201f2588bd91e7d9..03acfa88eb04e1737650af810c11b1afe809ad88 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.controller.configuration.internal;
 import java.util.Collections;
 import java.util.EnumSet;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 import java.util.concurrent.ConcurrentMap;
 
@@ -21,10 +22,15 @@ import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
 import org.opendaylight.controller.clustering.services.IClusterServices;
 import org.opendaylight.controller.configuration.ConfigurationEvent;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.configuration.IConfigurationAware;
 import org.opendaylight.controller.configuration.IConfigurationService;
-import org.opendaylight.controller.sal.utils.StatusCode;
+import org.opendaylight.controller.sal.utils.GlobalConstants;
+import org.opendaylight.controller.sal.utils.IObjectReader;
+import org.opendaylight.controller.sal.utils.ObjectReader;
+import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
+import org.opendaylight.controller.sal.utils.StatusCode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -39,10 +45,13 @@ public class ConfigurationService implements IConfigurationService, ICacheUpdate
     private static final Logger logger = LoggerFactory
             .getLogger(ConfigurationService.class);
     public static final String SAVE_EVENT_CACHE = "config.event.save";
+    private static final Object ROOT = GlobalConstants.STARTUPHOME.toString();
     private IClusterGlobalServices clusterServices;
     private ConcurrentMap <ConfigurationEvent, String> configEvent;
     private Set<IConfigurationAware> configurationAwareList = Collections
             .synchronizedSet(new HashSet<IConfigurationAware>());
+    private ObjectReader objReader;
+    private ObjectWriter objWriter;
 
 
     public int getConfigurationAwareListSize() {
@@ -78,6 +87,8 @@ public class ConfigurationService implements IConfigurationService, ICacheUpdate
     public void start() {
         allocateCache();
         retrieveCache();
+        objReader = new ObjectReader();
+        objWriter = new ObjectWriter();
     }
 
     public void destroy() {
@@ -164,4 +175,21 @@ public class ConfigurationService implements IConfigurationService, ICacheUpdate
             logger.error("Failed to retrieve configuration Cache");
         }
     }
+
+    @Override
+    public Status persistConfiguration(List<ConfigurationObject> config, String fileName) {
+        String destination = String.format("%s%s", ROOT, fileName);
+        return objWriter.write(config, destination);
+    }
+
+    @Override
+    public List<ConfigurationObject> retrieveConfiguration(IObjectReader reader, String fileName) {
+        if (!clusterServices.amICoordinator()) {
+            return Collections.emptyList();
+        }
+        String source = String.format("%s%s", ROOT, fileName);
+        Object obj = objReader.read(reader, source);
+        return (obj == null || !(obj instanceof List)) ? Collections.<ConfigurationObject> emptyList()
+                : (List<ConfigurationObject>) obj;
+    }
 }
index 5f1db6b597d707c649b5d094ae15a1a19e62b5d7..c33fdefd7b4a87b9da85548054e7936cbfdccb9f 100644 (file)
@@ -9,21 +9,30 @@
 
 package org.opendaylight.controller.configuration.internal;
 
+import java.io.File;
 import java.util.Collections;
+import java.util.Dictionary;
 import java.util.EnumSet;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 import java.util.concurrent.ConcurrentMap;
 
+import org.apache.felix.dm.Component;
 import org.opendaylight.controller.clustering.services.CacheConfigException;
 import org.opendaylight.controller.clustering.services.CacheExistException;
 import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.clustering.services.IClusterServices;
 import org.opendaylight.controller.configuration.ConfigurationEvent;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.configuration.IConfigurationAware;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
 import org.opendaylight.controller.configuration.IConfigurationContainerService;
+import org.opendaylight.controller.sal.utils.GlobalConstants;
+import org.opendaylight.controller.sal.utils.IObjectReader;
+import org.opendaylight.controller.sal.utils.ObjectReader;
+import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
 import org.slf4j.Logger;
@@ -34,11 +43,10 @@ import org.slf4j.LoggerFactory;
  *
  * @brief  Backend functionality for all ConfigurationService related tasks.
  *
- *
  */
 
-public class ContainerConfigurationService implements IConfigurationContainerService, IConfigurationAware,
-        ICacheUpdateAware<ConfigurationEvent, String> {
+public class ContainerConfigurationService implements IConfigurationContainerService,
+        IConfigurationAware, ICacheUpdateAware<ConfigurationEvent, String> {
     public static final String CONTAINER_SAVE_EVENT_CACHE = "config.container.event.save";
     private static final Logger logger = LoggerFactory.getLogger(ContainerConfigurationService.class);
     private IClusterContainerServices clusterServices;
@@ -50,6 +58,9 @@ public class ContainerConfigurationService implements IConfigurationContainerSer
      */
     private Set<IConfigurationContainerAware> configurationAwareList = Collections
             .synchronizedSet(new HashSet<IConfigurationContainerAware>());
+    private String root;
+    private ObjectReader objReader;
+    private ObjectWriter objWriter;
 
     public void addConfigurationContainerAware(
             IConfigurationContainerAware configurationAware) {
@@ -79,12 +90,23 @@ public class ContainerConfigurationService implements IConfigurationContainerSer
         }
     }
 
-    public void init() {
+    void init(Component c) {
+        Dictionary<?, ?> props = c.getServiceProperties();
+        String containerName = (props != null) ? (String) props.get("containerName") : GlobalConstants.DEFAULT.toString();
+        root = String.format("%s%s/", GlobalConstants.STARTUPHOME.toString(), containerName);
+        if (!new File(root).exists()) {
+            boolean created = new File(root).mkdir();
+            if (!created) {
+                logger.error("Failed to create startup config directory for container {}", containerName);
+            }
+        }
     }
 
     public void start() {
         allocateCache();
         retrieveCache();
+        objReader = new ObjectReader();
+        objWriter = new ObjectWriter();
     }
 
     public void destroy() {
@@ -92,6 +114,18 @@ public class ContainerConfigurationService implements IConfigurationContainerSer
         this.configurationAwareList.clear();
     }
 
+    /**
+     * Function called by the dependency manager before Container is Stopped and Destroyed.
+     */
+    public void containerStop() {
+        // Remove container directory along with its startup files
+        File[] files = new File(root).listFiles();
+        for (File file : files) {
+            file.delete();
+        }
+        new File(root).delete();
+    }
+
     @Override
     public Status saveConfiguration() {
         boolean success = true;
@@ -171,4 +205,21 @@ public class ContainerConfigurationService implements IConfigurationContainerSer
             logger.error("Failed to retrieve configuration Cache");
         }
     }
+
+    @Override
+    public Status persistConfiguration(List<ConfigurationObject> config, String fileName) {
+        String destination = String.format("%s%s", root, fileName);
+        return objWriter.write(config, destination);
+    }
+
+    @Override
+    public List<ConfigurationObject> retrieveConfiguration(IObjectReader reader, String fileName) {
+        if (!clusterServices.amICoordinator()) {
+            return Collections.emptyList();
+        }
+        String source = String.format("%s%s", root, fileName);
+        Object obj = objReader.read(reader, source);
+        return (obj == null || !(obj instanceof List)) ? Collections.<ConfigurationObject> emptyList()
+                : (List<ConfigurationObject>) obj;
+    }
 }
index b6c4d4c2a3662cd72f91caf187e739d264d3b493..3c053f441a0ee82a88bb44b52baecd6ff6e2d9cd 100644 (file)
               org.opendaylight.controller.sal.utils,
               org.opendaylight.controller.sal.core,
               org.opendaylight.controller.sal.action,
-              org.opendaylight.controller.sal.flowprogrammer,
               org.opendaylight.controller.sal.match,
               org.opendaylight.controller.sal.packet,
               org.opendaylight.controller.sal.reader,
-              org.apache.commons.lang3.builder,
               org.slf4j,
               javax.xml.bind.annotation,
               javax.xml.bind
index 9c160dcf3e8f100f501f5a194dd118aab8a684e1..13e847b5751e71786a5fc5d1127ba5cd7605b5a0 100644 (file)
@@ -30,7 +30,6 @@
             <Import-Package>
               org.opendaylight.controller.containermanager,
               org.opendaylight.controller.appauth.authorization,
-              org.opendaylight.controller.usermanager,
               org.opendaylight.controller.configuration,
               org.opendaylight.controller.clustering.services,
               org.opendaylight.controller.sal.authorization,
@@ -83,9 +82,5 @@
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>usermanager</artifactId>
-    </dependency>
   </dependencies>
 </project>
index 162cbf041a8757a9d6ed269783fc9932a15442d2..616a0f24f33c5f856885981284b98ea1f9c4ec83 100644 (file)
@@ -19,6 +19,7 @@ import org.apache.felix.dm.Component;
 import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
 import org.opendaylight.controller.configuration.IConfigurationAware;
+import org.opendaylight.controller.configuration.IConfigurationService;
 import org.opendaylight.controller.containermanager.IContainerAuthorization;
 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
 import org.opendaylight.controller.sal.core.IContainer;
@@ -130,6 +131,11 @@ public class Activator extends ComponentActivatorAbstractBase {
                     .setCallbacks("setClusterServices", "unsetClusterServices")
                     .setRequired(true));
 
+            c.add(createServiceDependency().setService(
+                    IConfigurationService.class).setCallbacks(
+                    "setConfigurationService",
+                    "unsetConfigurationService").setRequired(true));
+
             // Key kick-starter for container creation in each component
             c.add(createServiceDependency().setService(IContainerAware.class)
                     .setCallbacks("setIContainerAware", "unsetIContainerAware")
index e096c737805fbfccae39f7da3cc17ae49b3ea4a5..ad897fd6899b01a2645aee018198fd0b8742129a 100644 (file)
@@ -24,7 +24,6 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.CopyOnWriteArrayList;
 
@@ -36,6 +35,7 @@ import org.opendaylight.controller.clustering.services.CacheExistException;
 import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
 import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.configuration.IConfigurationAware;
 import org.opendaylight.controller.configuration.IConfigurationService;
 import org.opendaylight.controller.containermanager.ContainerChangeEvent;
@@ -63,8 +63,6 @@ import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.IObjectReader;
 import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
 import org.opendaylight.controller.sal.utils.NodeCreator;
-import org.opendaylight.controller.sal.utils.ObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.ServiceHelper;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
@@ -76,10 +74,10 @@ public class ContainerManager extends Authorization<String> implements IContaine
         CommandProvider, ICacheUpdateAware<String, Object>, IContainerInternal, IContainerAuthorization,
         IConfigurationAware {
     private static final Logger logger = LoggerFactory.getLogger(ContainerManager.class);
-    private static String ROOT = GlobalConstants.STARTUPHOME.toString();
-    private static String containersFileName = ROOT + "containers.conf";
+    private static String CONTAINERS_FILE_NAME = "containers.conf";
     private static final String allContainersGroup = "allContainers";
     private IClusterGlobalServices clusterServices;
+    private IConfigurationService configurationService;
     /*
      * Collection containing the configuration objects. This is configuration
      * world: container names (also the map key) are maintained as they were
@@ -171,6 +169,16 @@ public class ContainerManager extends Authorization<String> implements IContaine
         }
     }
 
+    public void setConfigurationService(IConfigurationService service) {
+        logger.trace("Got configuration service set request {}", service);
+        this.configurationService = service;
+    }
+
+    public void unsetConfigurationService(IConfigurationService service) {
+        logger.trace("Got configuration service UNset request");
+        this.configurationService = null;
+    }
+
     private void allocateCaches() {
         logger.debug("Container Manager allocating caches");
 
@@ -290,7 +298,7 @@ public class ContainerManager extends Authorization<String> implements IContaine
         createDefaultAuthorizationGroups();
 
         // Read startup configuration and create local database
-        loadConfigurations();
+        loadContainerConfig();
     }
 
     public void destroy() {
@@ -728,29 +736,19 @@ public class ContainerManager extends Authorization<String> implements IContaine
         return flowSpecConfig;
     }
 
-    private void loadConfigurations() {
-        /*
-         * Read containers, container flows and finally containers' entries from file
-         * and program the database accordingly
-         */
-        if ((clusterServices != null) && (clusterServices.amICoordinator())) {
-            loadContainerConfig();
-        }
-    }
-
     private Status saveContainerConfig() {
         return saveContainerConfigLocal();
     }
 
     public Status saveContainerConfigLocal() {
-        ObjectWriter objWriter = new ObjectWriter();
+        Status status = configurationService.persistConfiguration(
+                new ArrayList<ConfigurationObject>(containerConfigs.values()), CONTAINERS_FILE_NAME);
 
-        Status status = objWriter.write(new ConcurrentHashMap<String, ContainerConfig>(containerConfigs), containersFileName);
         if (!status.isSuccess()) {
             return new Status(StatusCode.INTERNALERROR, "Failed to save container configurations: "
                     + status.getDescription());
         }
-        return new Status(StatusCode.SUCCESS);
+        return status;
     }
 
     private void removeComponentsStartUpfiles(String containerName) {
@@ -1335,18 +1333,9 @@ public class ContainerManager extends Authorization<String> implements IContaine
         return ois.readObject();
     }
 
-    @SuppressWarnings("unchecked")
     private void loadContainerConfig() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<String, ContainerConfig> configMap = (ConcurrentMap<String, ContainerConfig>) objReader.read(this,
-                containersFileName);
-
-        if (configMap == null) {
-            return;
-        }
-
-        for (Map.Entry<String, ContainerConfig> configEntry : configMap.entrySet()) {
-            addContainer(configEntry.getValue());
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, CONTAINERS_FILE_NAME)) {
+            addContainer((ContainerConfig) conf);
         }
     }
 
index 6733100ac2eb225cc32e297d249a3c01569cd3ae..1de9c4856c8c4a682cef53e954893954417ddaed 100644 (file)
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-dependency-plugin</artifactId>
             <version>2.8</version>
+            <dependencies>
+              <dependency>
+                <groupId>org.opendaylight.controller</groupId>
+                <artifactId>sanitytest</artifactId>
+                <version>${controller.version}</version>
+             </dependency>
+            </dependencies>
             <executions>
               <execution>
                 <id>copy</id>
           </plugin>
         </plugins>
       </build>
+      <dependencies>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>sanitytest</artifactId>
+        </dependency>
+      </dependencies>
     </profile>
   </profiles>
 
index be6fae759819e4d3226e96309e1e658db202480f..47563b94cfe177cf8bab8e8c20d00436d422b87d 100644 (file)
@@ -114,6 +114,14 @@ org.eclipse.gemini.web.tomcat.config.path=configuration/tomcat-server.xml
 # The maximum number of ports handled in one discovery batch (default 512)
 # of.discoveryBatchMaxPorts=512
 
+# OVSDB configuration
+# ovsdb plugin supports both active and passive connections. It listens on port 6640 by default for Active connections.
+ovsdb.listenPort=6640
+
+# ovsdb creates Openflow nodes/bridges. This configuration configures the bridge's Openflow version.
+# default Openflow version = 1.0, we also support 1.3.
+# ovsdb.of.version=1.3
+
 # TLS configuration
 # To enable TLS, set secureChannelEnabled=true and specify the location of controller Java KeyStore and TrustStore files.
 # The Java KeyStore contains controller's private key and certificate. The Java TrustStore contains the trusted certificate
index 2a3c08e41f67a1cad618330acf2b2be000b10fa3..e02b6bb39e181ef5dea71722a450d29fe9389a97 100644 (file)
        org.opendaylight.controller.sal.utils,
        org.opendaylight.controller.sal.core,
        org.opendaylight.controller.configuration,
-       org.opendaylight.controller.forwardingrulesmanager,
        org.opendaylight.controller.hosttracker,
        org.opendaylight.controller.hosttracker.hostAware,
        org.opendaylight.controller.clustering.services,
        org.opendaylight.controller.sal.packet,
        org.opendaylight.controller.sal.routing,
-       org.opendaylight.controller.topologymanager,
        org.eclipse.osgi.framework.console,
        org.osgi.framework,
        org.slf4j,
-       org.apache.felix.dm,
-       org.apache.commons.lang3.builder
+       org.apache.felix.dm
       </Import-Package>
       <Export-Package>
        org.opendaylight.controller.forwarding.staticrouting
  <dependencies>
   <dependency>
    <groupId>org.opendaylight.controller</groupId>
-   <artifactId>topologymanager</artifactId>
-  </dependency>
-  <dependency>
-   <groupId>org.opendaylight.controller</groupId>
-   <artifactId>forwardingrulesmanager</artifactId>
+   <artifactId>clustering.services</artifactId>
   </dependency>
   <dependency>
    <groupId>org.opendaylight.controller</groupId>
index 2b8bbef5075f50d54bce2c6fa319367ab8b5a13a..7be9c2367721717f41728356eff9fa7b815cf1a5 100644 (file)
@@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory;
 
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.hosttracker.IfIptoHost;
 import org.opendaylight.controller.hosttracker.IfNewHostNotify;
 
@@ -35,6 +36,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      * instantiated in order to get an fully working implementation
      * Object
      */
+    @Override
     public Object[] getImplementations() {
         Object[] res = { StaticRoutingImplementation.class };
         return res;
@@ -53,6 +55,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      * also optional per-container different behavior if needed, usually
      * should not be the case though.
      */
+    @Override
     public void configureInstance(Component c, Object imp, String containerName) {
         if (imp.equals(StaticRoutingImplementation.class)) {
             c.setInterface(new String[] {
@@ -74,6 +77,11 @@ public class Activator extends ComponentActivatorAbstractBase {
                     IStaticRoutingAware.class).setCallbacks(
                     "setStaticRoutingAware", "unsetStaticRoutingAware")
                     .setRequired(false));
+
+            c.add(createContainerServiceDependency(containerName).setService(
+                    IConfigurationContainerService.class).setCallbacks(
+                    "setConfigurationContainerService",
+                    "unsetConfigurationContainerService").setRequired(true));
         }
     }
 }
index fe00b774f5113090b6841a986d3154e8f8564f9d..fedf5541d069c88c1b7e86ae0ba21cb9f7be5c68 100644 (file)
@@ -14,6 +14,7 @@ import java.io.ObjectInputStream;
 import java.net.Inet4Address;
 import java.net.InetAddress;
 import java.nio.ByteBuffer;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Dictionary;
 import java.util.EnumSet;
@@ -23,7 +24,6 @@ import java.util.Set;
 import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.Callable;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -36,7 +36,9 @@ import org.opendaylight.controller.clustering.services.CacheConfigException;
 import org.opendaylight.controller.clustering.services.CacheExistException;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.forwarding.staticrouting.IForwardingStaticRouting;
 import org.opendaylight.controller.forwarding.staticrouting.IStaticRoutingAware;
 import org.opendaylight.controller.forwarding.staticrouting.StaticRoute;
@@ -46,10 +48,7 @@ import org.opendaylight.controller.hosttracker.IHostId;
 import org.opendaylight.controller.hosttracker.IfIptoHost;
 import org.opendaylight.controller.hosttracker.IfNewHostNotify;
 import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
-import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.IObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
 import org.slf4j.Logger;
@@ -61,13 +60,13 @@ import org.slf4j.LoggerFactory;
 public class StaticRoutingImplementation implements IfNewHostNotify, IForwardingStaticRouting, IObjectReader,
         IConfigurationContainerAware {
     private static Logger log = LoggerFactory.getLogger(StaticRoutingImplementation.class);
-    private static String ROOT = GlobalConstants.STARTUPHOME.toString();
+    private static final String STATIC_ROUTES_FILE_NAME = "staticRouting.conf";
     ConcurrentMap<String, StaticRoute> staticRoutes;
     ConcurrentMap<String, StaticRouteConfig> staticRouteConfigs;
     private IfIptoHost hostTracker;
     private Timer gatewayProbeTimer;
-    private String staticRoutesFileName = null;
     private IClusterContainerServices clusterContainerService = null;
+    private IConfigurationContainerService configurationService;
     private Set<IStaticRoutingAware> staticRoutingAware = Collections
             .synchronizedSet(new HashSet<IStaticRoutingAware>());
     private ExecutorService executor;
@@ -95,6 +94,16 @@ public class StaticRoutingImplementation implements IfNewHostNotify, IForwarding
         }
     }
 
+    public void setConfigurationContainerService(IConfigurationContainerService service) {
+        log.trace("Got configuration service set request {}", service);
+        this.configurationService = service;
+    }
+
+    public void unsetConfigurationContainerService(IConfigurationContainerService service) {
+        log.trace("Got configuration service UNset request");
+        this.configurationService = null;
+    }
+
     @Override
     public ConcurrentMap<String, StaticRouteConfig> getStaticRouteConfigs() {
         return staticRouteConfigs;
@@ -107,18 +116,10 @@ public class StaticRoutingImplementation implements IfNewHostNotify, IForwarding
         return ois.readObject();
     }
 
-    @SuppressWarnings("unchecked")
-    private void loadConfiguration() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<String, StaticRouteConfig> confList = (ConcurrentMap<String, StaticRouteConfig>) objReader.read(
-                this, staticRoutesFileName);
-
-        if (confList == null) {
-            return;
-        }
 
-        for (StaticRouteConfig conf : confList.values()) {
-            addStaticRoute(conf);
+    private void loadConfiguration() {
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, STATIC_ROUTES_FILE_NAME)) {
+            addStaticRoute((StaticRouteConfig) conf);
         }
     }
 
@@ -127,11 +128,8 @@ public class StaticRoutingImplementation implements IfNewHostNotify, IForwarding
     }
 
     public Status saveConfigInternal() {
-        Status status;
-        ObjectWriter objWriter = new ObjectWriter();
-
-        status = objWriter.write(new ConcurrentHashMap<String, StaticRouteConfig>(staticRouteConfigs),
-                staticRoutesFileName);
+        Status status = configurationService.persistConfiguration(
+                new ArrayList<ConfigurationObject>(staticRouteConfigs.values()), STATIC_ROUTES_FILE_NAME);
 
         if (status.isSuccess()) {
             return status;
@@ -140,7 +138,6 @@ public class StaticRoutingImplementation implements IfNewHostNotify, IForwarding
         }
     }
 
-    @SuppressWarnings("deprecation")
     private void allocateCaches() {
         if (this.clusterContainerService == null) {
             log.trace("un-initialized clusterContainerService, can't create cache");
@@ -159,7 +156,7 @@ public class StaticRoutingImplementation implements IfNewHostNotify, IForwarding
         }
     }
 
-    @SuppressWarnings({ "unchecked", "deprecation" })
+    @SuppressWarnings({ "unchecked" })
     private void retrieveCaches() {
         if (this.clusterContainerService == null) {
             log.warn("un-initialized clusterContainerService, can't retrieve cache");
@@ -421,15 +418,11 @@ public class StaticRoutingImplementation implements IfNewHostNotify, IForwarding
             containerName = "";
         }
 
-        staticRoutesFileName = ROOT + "staticRouting_" + containerName + ".conf";
-
         log.debug("forwarding.staticrouting starting on container {}", containerName);
         allocateCaches();
         retrieveCaches();
         this.executor = Executors.newFixedThreadPool(1);
-        if ((clusterContainerService != null) && (clusterContainerService.amICoordinator())) {
-            loadConfiguration();
-        }
+        loadConfiguration();
 
         /*
          * Slow probe to identify any gateway that might have silently appeared
index 5583b7a0dd58f2153391de2e9b9705e448ec71f9..4687866c29bb2e02a92d34e7b5b2f1c19f6699f8 100644 (file)
               org.opendaylight.controller.forwardingrulesmanager
             </Export-Package>
             <Import-Package>
-              org.opendaylight.controller.clustering.services,
               org.opendaylight.controller.configuration,
-              org.opendaylight.controller.hosttracker,
-              org.opendaylight.controller.hosttracker.hostAware,
               org.opendaylight.controller.switchmanager,
               org.opendaylight.controller.sal.action,
               org.opendaylight.controller.sal.core,
     </plugins>
   </build>
   <dependencies>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>hosttracker</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>configuration</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.services</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>switchmanager</artifactId>
index c634426d433578bed1e5c7e8d9fa3049e8a10ae7..d0878f982cda5d10142375dca91fa2f3380546ef 100644 (file)
@@ -13,6 +13,8 @@ import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.opendaylight.controller.configuration.ConfigurationObject;
+
 /**
  * PortGroupConfig class represents the User's Configuration with a Opaque
  * Regular Expression String that is parsed and handled by PortGroupProvider.
@@ -23,7 +25,7 @@ import java.util.List;
  *
  *
  */
-public class PortGroupConfig implements Serializable {
+public class PortGroupConfig extends ConfigurationObject implements Serializable {
     private static final long serialVersionUID = 1L;
     private static final String prettyFields[] = { "Name", "Match Criteria" };
 
@@ -136,23 +138,30 @@ public class PortGroupConfig implements Serializable {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         PortGroupConfig other = (PortGroupConfig) obj;
         if (matchString == null) {
-            if (other.matchString != null)
+            if (other.matchString != null) {
                 return false;
-        } else if (!matchString.equals(other.matchString))
+            }
+        } else if (!matchString.equals(other.matchString)) {
             return false;
+        }
         if (name == null) {
-            if (other.name != null)
+            if (other.name != null) {
                 return false;
-        } else if (!name.equals(other.name))
+            }
+        } else if (!name.equals(other.name)) {
             return false;
+        }
         return true;
     }
 
index deaa23e062b631c4f549c460ba3bc56239b2dc7b..eaee390eec8bfa7b79c18a702628c90f8f5f0e29 100644 (file)
@@ -36,8 +36,6 @@
               org.opendaylight.controller.clustering.services,
               org.opendaylight.controller.configuration,
               org.opendaylight.controller.containermanager,
-              org.opendaylight.controller.hosttracker,
-              org.opendaylight.controller.hosttracker.hostAware,
               org.opendaylight.controller.switchmanager,
               org.opendaylight.controller.sal.action,
               org.opendaylight.controller.sal.core,
     </plugins>
   </build>
   <dependencies>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>hosttracker</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>configuration</artifactId>
       <groupId>equinoxSDK381</groupId>
       <artifactId>org.apache.felix.gogo.runtime</artifactId>
     </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>connectionmanager</artifactId>
index ec8112035f4c89805ff987cfd2cfd31643bdef39..a53ea111d295c7d89690063591ac3c1e773e7ced 100644 (file)
@@ -17,6 +17,7 @@ import org.apache.felix.dm.Component;
 import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.connectionmanager.IConnectionManager;
 import org.opendaylight.controller.containermanager.IContainerManager;
 import org.opendaylight.controller.forwardingrulesmanager.IForwardingRulesManager;
@@ -98,6 +99,10 @@ public class Activator extends ComponentActivatorAbstractBase {
                     .setCallbacks("setIContainer", "unsetIContainer").setRequired(true));
             c.add(createServiceDependency().setService(IConnectionManager.class)
                     .setCallbacks("setIConnectionManager", "unsetIConnectionManager").setRequired(true));
+            c.add(createContainerServiceDependency(containerName).setService(
+                    IConfigurationContainerService.class).setCallbacks(
+                    "setConfigurationContainerService",
+                    "unsetConfigurationContainerService").setRequired(true));
             if (GlobalConstants.DEFAULT.toString().equals(containerName)) {
                 c.add(createServiceDependency().setService(IContainerManager.class)
                         .setCallbacks("setIContainerManager", "unsetIContainerManager").setRequired(true));
index 9c002206879f1a8cff46a9d1df2bf6c6a9685185..bce7dd30ba59de6c9707062f3fdeaf9f23a8141d 100644 (file)
@@ -33,7 +33,9 @@ import org.opendaylight.controller.clustering.services.CacheExistException;
 import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.connectionmanager.IConnectionManager;
 import org.opendaylight.controller.containermanager.IContainerManager;
 import org.opendaylight.controller.forwardingrulesmanager.FlowConfig;
@@ -66,8 +68,6 @@ import org.opendaylight.controller.sal.match.MatchType;
 import org.opendaylight.controller.sal.utils.EtherTypes;
 import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.IObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
 import org.opendaylight.controller.switchmanager.IInventoryListener;
@@ -98,14 +98,15 @@ public class ForwardingRulesManager implements
     private static final String PORT_REMOVED = "Port removed";
     private static final String NODE_DOWN = "Node is Down";
     private static final String INVALID_FLOW_ENTRY = "Invalid FlowEntry";
-    private String frmFileName;
-    private String portGroupFileName;
+    private static final String STATIC_FLOWS_FILE_NAME = "frm_staticflows.conf";
+    private static final String PORT_GROUP_FILE_NAME = "portgroup.conf";
     private ConcurrentMap<Integer, FlowConfig> staticFlows;
     private ConcurrentMap<Integer, Integer> staticFlowsOrdinal;
     private ConcurrentMap<String, PortGroupConfig> portGroupConfigs;
     private ConcurrentMap<PortGroupConfig, Map<Node, PortGroup>> portGroupData;
     private ConcurrentMap<String, Object> TSPolicies;
     private IContainerManager containerManager;
+    private IConfigurationContainerService configurationService;
     private boolean inContainerMode; // being used by global instance only
     protected boolean stopping;
 
@@ -1945,22 +1946,7 @@ public class ForwardingRulesManager implements
 
     @Override
     public List<FlowConfig> getStaticFlows() {
-        return getStaticFlowsOrderedList(staticFlows, staticFlowsOrdinal.get(0).intValue());
-    }
-
-    // TODO: need to come out with a better algorithm for maintaining the order
-    // of the configuration entries
-    // with actual one, index associated to deleted entries cannot be reused and
-    // map grows...
-    private List<FlowConfig> getStaticFlowsOrderedList(ConcurrentMap<Integer, FlowConfig> flowMap, int maxKey) {
-        List<FlowConfig> orderedList = new ArrayList<FlowConfig>();
-        for (int i = 0; i <= maxKey; i++) {
-            FlowConfig entry = flowMap.get(i);
-            if (entry != null) {
-                orderedList.add(entry);
-            }
-        }
-        return orderedList;
+        return new ArrayList<FlowConfig>(staticFlows.values());
     }
 
     @Override
@@ -2003,34 +1989,13 @@ public class ForwardingRulesManager implements
         return new ArrayList<Node>(set);
     }
 
-    @SuppressWarnings("unchecked")
     private void loadFlowConfiguration() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<Integer, FlowConfig> confList = (ConcurrentMap<Integer, FlowConfig>) objReader.read(this,
-                frmFileName);
-
-        ConcurrentMap<String, PortGroupConfig> pgConfig = (ConcurrentMap<String, PortGroupConfig>) objReader.read(this,
-                portGroupFileName);
-
-        if (pgConfig != null) {
-            for (ConcurrentMap.Entry<String, PortGroupConfig> entry : pgConfig.entrySet()) {
-                addPortGroupConfig(entry.getKey(), entry.getValue().getMatchString(), true);
-            }
-        }
-
-        if (confList == null) {
-            return;
-        }
-
-        int maxKey = 0;
-        for (Integer key : confList.keySet()) {
-            if (key.intValue() > maxKey) {
-                maxKey = key.intValue();
-            }
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, PORT_GROUP_FILE_NAME)) {
+            addPortGroupConfig(((PortGroupConfig) conf).getName(), ((PortGroupConfig) conf).getMatchString(), true);
         }
 
-        for (FlowConfig conf : getStaticFlowsOrderedList(confList, maxKey)) {
-            addStaticFlowInternal(conf, true);
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, STATIC_FLOWS_FILE_NAME)) {
+            addStaticFlowInternal((FlowConfig) conf, true);
         }
     }
 
@@ -2045,19 +2010,22 @@ public class ForwardingRulesManager implements
     }
 
     private Status saveConfigInternal() {
-        ObjectWriter objWriter = new ObjectWriter();
-        ConcurrentMap<Integer, FlowConfig> nonDynamicFlows = new ConcurrentHashMap<Integer, FlowConfig>();
+        List<ConfigurationObject> nonDynamicFlows = new ArrayList<ConfigurationObject>();
+
         for (Integer ordinal : staticFlows.keySet()) {
             FlowConfig config = staticFlows.get(ordinal);
             // Do not save dynamic and controller generated static flows
             if (config.isDynamic() || config.isInternalFlow()) {
                 continue;
             }
-            nonDynamicFlows.put(ordinal, config);
+            nonDynamicFlows.add(config);
         }
-        objWriter.write(nonDynamicFlows, frmFileName);
-        objWriter.write(new ConcurrentHashMap<String, PortGroupConfig>(portGroupConfigs), portGroupFileName);
-        return new Status(StatusCode.SUCCESS, null);
+
+        configurationService.persistConfiguration(nonDynamicFlows, STATIC_FLOWS_FILE_NAME);
+        configurationService.persistConfiguration(new ArrayList<ConfigurationObject>(portGroupConfigs.values()),
+                PORT_GROUP_FILE_NAME);
+
+        return new Status(StatusCode.SUCCESS);
     }
 
     @Override
@@ -2432,6 +2400,16 @@ public class ForwardingRulesManager implements
         }
     }
 
+    public void setConfigurationContainerService(IConfigurationContainerService service) {
+        log.trace("Got configuration service set request {}", service);
+        this.configurationService = service;
+    }
+
+    public void unsetConfigurationContainerService(IConfigurationContainerService service) {
+        log.trace("Got configuration service UNset request");
+        this.configurationService = null;
+    }
+
     @Override
     public PortGroupProvider getPortGroupProvider() {
         return portGroupProvider;
@@ -2482,8 +2460,6 @@ public class ForwardingRulesManager implements
      *
      */
     void init() {
-        frmFileName = GlobalConstants.STARTUPHOME.toString() + "frm_staticflows_" + this.getContainerName() + ".conf";
-        portGroupFileName = GlobalConstants.STARTUPHOME.toString() + "portgroup_" + this.getContainerName() + ".conf";
 
         inContainerMode = false;
 
@@ -2655,9 +2631,7 @@ public class ForwardingRulesManager implements
         /*
          * Read startup and build database if we are the coordinator
          */
-        if ((clusterContainerService != null) && (clusterContainerService.amICoordinator())) {
-            loadFlowConfiguration();
-        }
+        loadFlowConfiguration();
     }
 
     /**
index fbd13e13ef5b511cb52b03a4337afb9c6143736d..d84f96d84e7c342702c04d89bde7f09581ee6277 100644 (file)
       <Import-Package>
        org.opendaylight.controller.sal.core,
        org.opendaylight.controller.sal.utils,
-       org.opendaylight.controller.topologymanager,
        org.opendaylight.controller.sal.packet.address,
-       org.opendaylight.controller.switchmanager,
-       org.opendaylight.controller.clustering.services,
        javax.xml.bind.annotation,
        javax.xml.bind,
        org.apache.felix.dm,
-       org.apache.commons.lang3.builder,
        org.osgi.service.component,
        org.slf4j,
        org.eclipse.osgi.framework.console,
   </plugins>
  </build>
  <dependencies>
-  <dependency>
-   <groupId>org.opendaylight.controller</groupId>
-   <artifactId>topologymanager</artifactId>
-  </dependency>
-  <dependency>
-   <groupId>org.opendaylight.controller</groupId>
-   <artifactId>switchmanager</artifactId>
-  </dependency>
-  <dependency>
-   <groupId>org.opendaylight.controller</groupId>
-   <artifactId>clustering.services</artifactId>
-  </dependency>
   <dependency>
    <groupId>org.opendaylight.controller</groupId>
    <artifactId>sal</artifactId>
index f7ced8ee8983111bf28016a7334a9b7f8ff6b046..625ababf7ae006871972284532d5e80f9a6e434a 100644 (file)
     </plugins>
   </build>
   <dependencies>
-      <dependency>
-        <groupId>org.opendaylight.controller</groupId>
-        <artifactId>connectionmanager</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>org.opendaylight.controller</groupId>
-        <artifactId>connectionmanager.implementation</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>org.opendaylight.controller</groupId>
-        <artifactId>sal.connection</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>org.opendaylight.controller</groupId>
-        <artifactId>sal.connection.implementation</artifactId>
-      </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>topologymanager</artifactId>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>commons.logback_settings</artifactId>
-    </dependency>
   </dependencies>
 </project>
index c2d30e78c64b7c0204252f4d0a40bfc526b0cc36..eb902528c1fb5ae87b7a1eb7d155ca51554888d3 100644 (file)
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal.implementation</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal.connection</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal.connection.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>connectionmanager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>connectionmanager.implementation</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>containermanager</artifactId>
index a3c8c5f232b0b6e7daae0350880eca7e790985a5..52aa8d029066b3093a90300f6bb078886b2b3d7b 100644 (file)
@@ -21,8 +21,8 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration
 import org.opendaylight.yangtools.concepts.Registration\r
 import org.opendaylight.yangtools.yang.binding.Notification\r
 import org.slf4j.LoggerFactory\r
-import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder\r
-\r
+import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder\rimport com.google.common.collect.Multimaps
+
 class NotificationBrokerImpl implements NotificationProviderService, AutoCloseable {\r
 \r
     val Multimap<Class<? extends Notification>, NotificationListener<?>> listeners;\r
@@ -31,12 +31,12 @@ class NotificationBrokerImpl implements NotificationProviderService, AutoCloseab
     var ExecutorService executor;\r
 \r
     new() {\r
-        listeners = HashMultimap.create()\r
+        listeners = Multimaps.synchronizedSetMultimap(HashMultimap.create())\r
     }\r
 \r
     @Deprecated\r
     new(ExecutorService executor) {\r
-        listeners = HashMultimap.create()\r
+        listeners = Multimaps.synchronizedSetMultimap(HashMultimap.create())\r
         this.executor = executor;\r
     }\r
 \r
index d2295c49de06871ed01719c10e29d8b9433578c8..aaed12f740ea7224c540fdc936f544308ccb1a3e 100644 (file)
@@ -89,6 +89,8 @@ public class BindingIndependentConnector implements //
         Provider, //
         AutoCloseable {
 
+
+
     private final Logger LOG = LoggerFactory.getLogger(BindingIndependentConnector.class);
 
     @SuppressWarnings( "deprecation")
@@ -589,7 +591,7 @@ public class BindingIndependentConnector implements //
                 }
 
             } catch (Exception e) {
-                LOG.error("Could not forward Rpcs of type {}", service.getName());
+                LOG.error("Could not forward Rpcs of type {}", service.getName(),e);
             }
             registrations = ImmutableSet.of();
         }
@@ -721,8 +723,10 @@ public class BindingIndependentConnector implements //
                         } else {
                             strategy = new NoInputNoOutputInvocationStrategy(rpc,targetMethod);
                         }
+                    } else if(inputClass.isPresent()){
+                        strategy = new NoOutputInvocationStrategy(rpc,targetMethod, inputClass.get());
                     } else {
-                        strategy = null;
+                        strategy = new NoInputNoOutputInvocationStrategy(rpc,targetMethod);
                     }
                     return strategy;
                 }
@@ -814,6 +818,46 @@ public class BindingIndependentConnector implements //
             return Futures.immediateFuture(null);
         }
     }
+    
+    private class NoOutputInvocationStrategy extends RpcInvocationStrategy {
+
+        
+        @SuppressWarnings("rawtypes")
+        private WeakReference<Class> inputClass;
+
+        @SuppressWarnings({ "rawtypes", "unchecked" })
+        public NoOutputInvocationStrategy(QName rpc, Method targetMethod, 
+                Class<? extends DataContainer> inputClass) {
+            super(rpc,targetMethod);
+            this.inputClass = new WeakReference(inputClass);
+        }
+        
+        
+        @Override
+        public RpcResult<CompositeNode> uncheckedInvoke(RpcService rpcService, CompositeNode domInput) throws Exception {
+            DataContainer bindingInput = mappingService.dataObjectFromDataDom(inputClass.get(), domInput);
+            Future<RpcResult<?>> result = (Future<RpcResult<?>>) targetMethod.invoke(rpcService, bindingInput);
+            if (result == null) {
+                return Rpcs.getRpcResult(false);
+            }
+            RpcResult<?> bindingResult = result.get();
+            return Rpcs.getRpcResult(true);
+        }
+
+        @Override
+        public Future<RpcResult<?>> forwardToDomBroker(DataObject input) {
+            if(biRouter != null) {
+                CompositeNode xml = mappingService.toDataDom(input);
+                CompositeNode wrappedXml = ImmutableCompositeNode.create(rpc,ImmutableList.<Node<?>>of(xml));
+                RpcResult<CompositeNode> result = biRouter.invokeRpc(rpc, wrappedXml);
+                Object baResultValue = null;
+                RpcResult<?> baResult = Rpcs.<Void>getRpcResult(result.isSuccessful(), null, result.getErrors());
+                return Futures.<RpcResult<?>>immediateFuture(baResult);
+            }
+            return Futures.<RpcResult<?>>immediateFuture(Rpcs.getRpcResult(false));
+        }
+
+    }
 
     public boolean isRpcForwarding() {
         return rpcForwarding;
@@ -824,7 +868,6 @@ public class BindingIndependentConnector implements //
     }
 
     public boolean isNotificationForwarding() {
-        // TODO Auto-generated method stub
         return notificationForwarding;
     }
 
index 7c606e61c5af689c4fc6045c643bc4ea242a93ec..3c5efa5e3af11a44b73fb2fbec2188ef8e7f1340 100644 (file)
@@ -65,7 +65,7 @@ public class TestHelper {
 
                 mavenBundle(CONTROLLER, "netconf-client").versionAsInProject(), //
                 mavenBundle(CONTROLLER, "netconf-util").versionAsInProject(), //
-                mavenBundle(CONTROLLER + ".thirdparty", "ganymed", "1.0-SNAPSHOT"), //
+                mavenBundle(CONTROLLER + ".thirdparty", "ganymed").versionAsInProject(), //
                 mavenBundle(CONTROLLER, "netconf-mapping-api").versionAsInProject(), //
 
                 mavenBundle(CONTROLLER, "config-persister-impl").versionAsInProject(), //
index 200948cc0c78c2bff6959b7fbfb9d03a2aa1ea68..4d395267dd8db5f59ba65d7802d8eade7184f921 100644 (file)
@@ -19,6 +19,7 @@ import com.google.common.base.Predicate;
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.HashMultimap;
 import com.google.common.collect.Multimap;
+import com.google.common.collect.Multimaps;
 
 /**
  * Base abstract implementation of DataReadRouter, which performs
@@ -29,8 +30,8 @@ import com.google.common.collect.Multimap;
  */
 public abstract class AbstractDataReadRouter<P extends Path<P>, D> implements DataReader<P, D> {
 
-    Multimap<P, DataReaderRegistration<P, D>> configReaders = HashMultimap.create();
-    Multimap<P, DataReaderRegistration<P, D>> operationalReaders = HashMultimap.create();
+    Multimap<P, DataReaderRegistration<P, D>> configReaders = Multimaps.synchronizedSetMultimap(HashMultimap.<P, DataReaderRegistration<P, D>>create());
+    Multimap<P, DataReaderRegistration<P, D>> operationalReaders = Multimaps.synchronizedSetMultimap(HashMultimap.<P, DataReaderRegistration<P, D>>create());
 
     @Override
     public D readConfigurationData(P path) {
index 527b42897589bbbd972260296cc16482b7d79db2..927975ca53bbb06bb661225ee70f3e7bcad175b9 100644 (file)
@@ -44,6 +44,7 @@ import org.opendaylight.yangtools.yang.common.RpcResult
 import org.slf4j.LoggerFactory\r
 \r
 import static com.google.common.base.Preconditions.*\rimport org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent
+import com.google.common.collect.Multimaps
 
 abstract class AbstractDataBroker<P extends Path<P>, D, DCL extends DataChangeListener<P, D>> implements DataModificationTransactionFactory<P, D>, //\r
 DataReader<P, D>, //\r
@@ -67,8 +68,8 @@ DataProvisionService<P, D> {
     @Property\r
     private val AtomicLong finishedTransactionsCount = new AtomicLong\r
 \r
-    Multimap<P, DataChangeListenerRegistration<P, D, DCL>> listeners = HashMultimap.create();\r
-    Multimap<P, DataCommitHandlerRegistrationImpl<P, D>> commitHandlers = HashMultimap.create();\r
+    Multimap<P, DataChangeListenerRegistration<P, D, DCL>> listeners = Multimaps.synchronizedSetMultimap(HashMultimap.create());\r
+    Multimap<P, DataCommitHandlerRegistrationImpl<P, D>> commitHandlers = Multimaps.synchronizedSetMultimap(HashMultimap.create());\r
     \r
     val ListenerRegistry<RegistrationListener<DataCommitHandlerRegistration<P,D>>> commitHandlerRegistrationListeners = new ListenerRegistry();\r
     public new() {\r
index 53fa4d087d5a02d2013b28ef6a616ab83cba69a9..1159d5650e6599a72db0af912909244d17cf612b 100644 (file)
@@ -21,6 +21,7 @@ import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier
 import org.osgi.framework.BundleContext
 import org.osgi.framework.ServiceRegistration
 import org.opendaylight.controller.sal.dom.broker.impl.SchemaContextProviders
+import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry
 
 class BrokerConfigActivator implements AutoCloseable {
 
@@ -29,12 +30,12 @@ class BrokerConfigActivator implements AutoCloseable {
     @Property
     private var DataBrokerImpl dataService;
 
-    private var ServiceRegistration<SchemaService> schemaReg;
     private var ServiceRegistration<DataBrokerService> dataReg;
     private var ServiceRegistration<DataProviderService> dataProviderReg;
     private var ServiceRegistration<MountService> mountReg;
     private var ServiceRegistration<MountProvisionService> mountProviderReg;
     private var SchemaService schemaService;
+    private var ServiceRegistration<RpcProvisionRegistry> rpcProvisionRegistryReg;
     private var MountPointManagerImpl mountService;
 
     SchemaAwareDataStoreAdapter wrappedStore
@@ -45,7 +46,6 @@ class BrokerConfigActivator implements AutoCloseable {
 
         val serviceRef = context.getServiceReference(SchemaService);
         schemaService = context.getService(serviceRef);
-        schemaReg = context.registerService(SchemaService, schemaService, emptyProperties);
 
         broker.setRouter(new SchemaAwareRpcBroker("/", SchemaContextProviders.fromSchemaService(schemaService)));
 
@@ -70,14 +70,16 @@ class BrokerConfigActivator implements AutoCloseable {
 
         mountReg = context.registerService(MountService, mountService, emptyProperties);
         mountProviderReg = context.registerService(MountProvisionService, mountService, emptyProperties);
+
+        rpcProvisionRegistryReg = context.registerService(RpcProvisionRegistry, broker.getRouter(), emptyProperties);
     }
 
     override def close() {
-        schemaReg?.unregister();
         dataReg?.unregister();
         dataProviderReg?.unregister();
         mountReg?.unregister();
         mountProviderReg?.unregister();
+        rpcProvisionRegistryReg?.unregister();
     }
 
 }
index 6242dee038661da6d4d79685bc6e0a35b7c720da..763407f23a671476c7f47a9c8f7e3d63e0b2b128 100644 (file)
@@ -34,11 +34,12 @@ import org.slf4j.LoggerFactory;
 import com.google.common.collect.HashMultimap;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Multimap;
+import com.google.common.collect.Multimaps;
 
 public class NotificationRouterImpl implements NotificationRouter {
     private static Logger log = LoggerFactory.getLogger(NotificationRouterImpl.class);
 
-    private Multimap<QName, Registration<NotificationListener>> listeners = HashMultimap.create();
+    private Multimap<QName, Registration<NotificationListener>> listeners = Multimaps.synchronizedSetMultimap(HashMultimap.<QName, Registration<NotificationListener>>create());
 
     private void sendNotification(CompositeNode notification) {
         QName type = notification.getNodeType();
index 4955eceaffe971b11c8f11f6106935323aa48d3a..28d5ae914fc686a8cd41032755b77db529f9a85b 100644 (file)
@@ -126,6 +126,7 @@ public class SchemaAwareRpcBroker implements RpcRouter, Identifiable<String> {
         RpcDefinition definition = findRpcDefinition(rpcType);
         checkArgument(!isRoutedRpc(definition), "RPC Type must not be routed.");
         GlobalRpcRegistration reg = new GlobalRpcRegistration(rpcType, implementation, this);
+        implementations.putIfAbsent(rpcType, implementation);
         return reg;
     }
 
index a26fc257c26e49e87f74bc77faf8b0b760868b7c..5b97443b92e455aafb8bcf54cffd1dbc29d2f1e9 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.controller.sal.core.api.notify.NotificationPublishServic
 import org.opendaylight.controller.sal.core.api.notify.NotificationService
 import org.opendaylight.controller.sal.core.api.model.SchemaService
 import org.opendaylight.controller.sal.core.api.mount.MountProvisionService
+import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry
 
 class ProxyFactory {
 
@@ -47,6 +48,10 @@ class ProxyFactory {
         new SchemaServiceProxy(ref as ServiceReference<SchemaService>, service);
     }
 
+    private static def dispatch createProxyImpl(ServiceReference<?> ref, RpcProvisionRegistry service) {
+        new RpcProvisionRegistryProxy(ref as ServiceReference<RpcProvisionRegistry>, service);
+    }
+
     private static def dispatch createProxyImpl(ServiceReference<?> reference, BrokerService service) {
         throw new IllegalArgumentException("Not supported class");
     }
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/RpcProvisionRegistryProxy.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/RpcProvisionRegistryProxy.java
new file mode 100644 (file)
index 0000000..e375e14
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.sal.dom.broker.osgi;
+
+import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
+import org.opendaylight.controller.sal.core.api.Broker;
+import org.opendaylight.controller.sal.core.api.RpcImplementation;
+import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry;
+import org.opendaylight.controller.sal.core.api.RpcRegistrationListener;
+import org.opendaylight.controller.sal.core.api.RpcRoutingContext;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.osgi.framework.ServiceReference;
+
+public class RpcProvisionRegistryProxy extends AbstractBrokerServiceProxy<RpcProvisionRegistry>
+                                       implements RpcProvisionRegistry {
+
+    public RpcProvisionRegistryProxy(ServiceReference<RpcProvisionRegistry> ref, RpcProvisionRegistry delegate) {
+        super(ref, delegate);
+    }
+
+    @Override
+    public Broker.RpcRegistration addRpcImplementation(QName rpcType, RpcImplementation implementation) throws IllegalArgumentException {
+        return getDelegate().addRpcImplementation(rpcType, implementation);
+    }
+
+    @Override
+    public ListenerRegistration<RpcRegistrationListener> addRpcRegistrationListener(RpcRegistrationListener listener) {
+        return getDelegate().addRpcRegistrationListener(listener);
+    }
+
+    @Override
+    public Broker.RoutedRpcRegistration addRoutedRpcImplementation(QName rpcType, RpcImplementation implementation) {
+        return getDelegate().addRoutedRpcImplementation(rpcType, implementation);
+    }
+
+    @Override
+    public <L extends RouteChangeListener<RpcRoutingContext, InstanceIdentifier>> ListenerRegistration<L> registerRouteChangeListener(L listener) {
+        return getDelegate().registerRouteChangeListener(listener);
+    }
+}
index b925ebdc99738b72aa98e2a3186cc6d57f9578cb..325b342cd88bdb71d6d2138169f2f7ae36c83785 100644 (file)
@@ -293,23 +293,27 @@ public class StatisticsProvider implements AutoCloseable {
         NodeRef targetNodeRef = new NodeRef(targetInstanceId);
     
         try{
-            sendAggregateFlowsStatsFromAllTablesRequest(targetNode.getKey());
-        
-            sendAllFlowsStatsFromAllTablesRequest(targetNodeRef);
-
-            sendAllNodeConnectorsStatisticsRequest(targetNodeRef);
-        
-            sendAllFlowTablesStatisticsRequest(targetNodeRef);
-        
-            sendAllQueueStatsFromAllNodeConnector (targetNodeRef);
-
-            sendAllGroupStatisticsRequest(targetNodeRef);
-            
-            sendAllMeterStatisticsRequest(targetNodeRef);
-            
-            sendGroupDescriptionRequest(targetNodeRef);
-            
-            sendMeterConfigStatisticsRequest(targetNodeRef);
+            if(flowStatsService != null){
+                sendAggregateFlowsStatsFromAllTablesRequest(targetNode.getKey());
+                sendAllFlowsStatsFromAllTablesRequest(targetNodeRef);
+            }
+            if(flowTableStatsService != null){
+                sendAllFlowTablesStatisticsRequest(targetNodeRef);
+            }
+            if(portStatsService != null){
+                sendAllNodeConnectorsStatisticsRequest(targetNodeRef);
+            }
+            if(groupStatsService != null){
+                sendAllGroupStatisticsRequest(targetNodeRef);
+                sendGroupDescriptionRequest(targetNodeRef);
+            }
+            if(meterStatsService != null){
+                sendAllMeterStatisticsRequest(targetNodeRef);
+                sendMeterConfigStatisticsRequest(targetNodeRef);
+            }
+            if(queueStatsService != null){
+                sendAllQueueStatsFromAllNodeConnector (targetNodeRef);
+            }
         }catch(Exception e){
             spLogger.error("Exception occured while sending statistics requests : {}", e);
         }
@@ -366,23 +370,28 @@ public class StatisticsProvider implements AutoCloseable {
         if(tablesId.size() != 0){
             for(Short id : tablesId){
                 
-                spLogger.debug("Send aggregate stats request for flow table {} to node {}",id,targetNodeKey);
-                GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder input = 
-                        new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder();
-                
-                input.setNode(new NodeRef(InstanceIdentifier.builder(Nodes.class).child(Node.class, targetNodeKey).toInstance()));
-                input.setTableId(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId(id));
-                Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>> response = 
-                        flowStatsService.getAggregateFlowStatisticsFromFlowTableForAllFlows(input.build());
-                
-                multipartMessageManager.setTxIdAndTableIdMapEntry(targetNodeKey.getId(), response.get().getResult().getTransactionId(), id);
-                this.multipartMessageManager.addTxIdToRequestTypeEntry(targetNodeKey.getId(), response.get().getResult().getTransactionId()
-                        , StatsRequestType.AGGR_FLOW);
+                sendAggregateFlowsStatsFromTableRequest(targetNodeKey,id);
             }
         }else{
             spLogger.debug("No details found in data store for flow tables associated with Node {}",targetNodeKey);
         }
     }
+    
+    public void sendAggregateFlowsStatsFromTableRequest(NodeKey targetNodeKey,Short tableId) throws InterruptedException, ExecutionException{
+        
+        spLogger.debug("Send aggregate stats request for flow table {} to node {}",tableId,targetNodeKey);
+        GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder input = 
+                new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder();
+                
+        input.setNode(new NodeRef(InstanceIdentifier.builder(Nodes.class).child(Node.class, targetNodeKey).toInstance()));
+        input.setTableId(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId(tableId));
+        Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>> response = 
+                flowStatsService.getAggregateFlowStatisticsFromFlowTableForAllFlows(input.build());
+                
+        multipartMessageManager.setTxIdAndTableIdMapEntry(targetNodeKey.getId(), response.get().getResult().getTransactionId(), tableId);
+        this.multipartMessageManager.addTxIdToRequestTypeEntry(targetNodeKey.getId(), response.get().getResult().getTransactionId()
+                , StatsRequestType.AGGR_FLOW);
+    }
 
     public void sendAllNodeConnectorsStatisticsRequest(NodeRef targetNode) throws InterruptedException, ExecutionException{
         
index 907534bcf5a240c8ea661d24d8d086860c1b0bcc..19f25944b45f0ce34a94c9224ce4b107da4f467b 100644 (file)
@@ -7,12 +7,16 @@
  */
 package org.opendaylight.controller.md.statistics.manager;
 
+import java.net.Inet4Address;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.util.List;
 import java.util.concurrent.ConcurrentMap;
 
 import org.opendaylight.controller.md.statistics.manager.NodeStatisticsAger.FlowEntry;
 import org.opendaylight.controller.md.statistics.manager.NodeStatisticsAger.QueueEntry;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
@@ -88,6 +92,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.nodes.node.meter.MeterStatisticsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.config.stats.reply.MeterConfigStats;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.GenericStatistics;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.FlowCapableNodeConnectorStatisticsData;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.FlowCapableNodeConnectorStatisticsDataBuilder;
@@ -445,11 +451,13 @@ public class StatisticsUpdateCommiter implements OpendaylightGroupStatisticsList
             //TODO: Not a good way to do it, need to figure out better way.
             //TODO: major issue in any alternate approach is that flow key is incrementally assigned 
             //to the flows stored in data store.
+            // Augment same statistics to all the matching masked flow
             if(table != null){
 
                 for(Flow existingFlow : table.getFlow()){
                     sucLogger.debug("Existing flow in data store : {}",existingFlow.toString());
                     if(flowEquals(flowRule,existingFlow)){
+                        it = this.statisticsManager.startChange();
                         InstanceIdentifier<Flow> flowRef = InstanceIdentifier.builder(Nodes.class).child(Node.class, key)
                                 .augmentation(FlowCapableNode.class)
                                 .child(Table.class, new TableKey(tableId))
@@ -460,7 +468,6 @@ public class StatisticsUpdateCommiter implements OpendaylightGroupStatisticsList
                         foundOriginalFlow = true;
                         it.putOperationalData(flowRef, flowBuilder.build());
                         it.commit();
-                        break;
                     }
                 }
             }
@@ -703,8 +710,8 @@ public class StatisticsUpdateCommiter implements OpendaylightGroupStatisticsList
         else if(!matchEquals(statsFlow.getMatch(), storedFlow.getMatch())) {
             return false;
         }
-        if (statsFlow.getPriority() == null) {
-            if (storedFlow.getPriority() != null) {
+        if (storedFlow.getPriority() == null) {
+            if (statsFlow.getPriority() != null && statsFlow.getPriority()!= 0x8000) {
                 return false;
             }
         } else if(!statsFlow.getPriority().equals(storedFlow.getPriority())) {
@@ -722,24 +729,23 @@ public class StatisticsUpdateCommiter implements OpendaylightGroupStatisticsList
     
     /**
      * Explicit equals method to compare the 'match' for flows stored in the data-stores and flow fetched from the switch.
-     * Usecase: e.g If user don't set any ethernet source and destination address for match,data store will store null for 
-     * these address.
-     * e.g [_ethernetMatch=EthernetMatch [_ethernetDestination=null, _ethernetSource=null, _ethernetType=
-     * EthernetType [_type=EtherType [_value=2048], _mask=null, augmentation=[]]
+     * Flow installation process has three steps 
+     * 1) Store flow in config data store 
+     * 2) and send it to plugin for installation
+     * 3) Flow gets installed in switch
      * 
-     * But when you fetch the flows from switch, openflow driver library converts all zero bytes of mac address in the 
-     * message stream to 00:00:00:00:00:00. Following string shows how library interpret the zero mac address bytes and 
-     * eventually when translator convert it to MD-SAL match, this is how it looks 
-     * [_ethernetDestination=EthernetDestination [_address=MacAddress [_value=00:00:00:00:00:00], _mask=null, augmentation=[]], 
-     * _ethernetSource=EthernetSource [_address=MacAddress [_value=00:00:00:00:00:00], _mask=null, augmentation=[]], 
-     * _ethernetType=EthernetType [_type=EtherType [_value=2048], _mask=null, augmentation=[]]
+     * The flow user wants to install and what finally gets installed in switch can be slightly different. 
+     * E.g, If user installs flow with src/dst ip=10.0.0.1/24, when it get installed in the switch
+     * src/dst ip will be changes to 10.0.0.0/24 because of netmask of 24. When statistics manager fetch 
+     * stats it gets 10.0.0.0/24 rather then 10.0.0.1/24. Custom match takes care of by using masked ip
+     * while comparing two ip addresses.
      * 
-     * Similarly for inPort, if user/application don't set any value for it, FRM will store null value for it in data store. 
-     * When we fetch the same flow (with its statistics) from switch, plugin converts its value to openflow:X:0.
-     *  e.g _inPort=Uri [_value=openflow:1:0]  
+     * Sometimes when user don't provide few values that is required by flow installation request, like 
+     * priority,hard timeout, idle timeout, cookies etc, plugin usages default values before sending 
+     * request to the switch. So when statistics manager gets flow statistics, it gets the default value.
+     * But the flow stored in config data store don't have those defaults value. I included those checks 
+     * in the customer flow/match equal function. 
      * 
-     * So this custom equals method add additional check to take care of these scenario, in case any match element is null in data-store-flow, but not
-     * in the flow fetched from switch.
      * 
      * @param statsFlow
      * @param storedFlow
@@ -799,7 +805,7 @@ public class StatisticsUpdateCommiter implements OpendaylightGroupStatisticsList
             if (statsFlow.getLayer3Match() != null) {
                     return false;
             }
-        } else if(!storedFlow.getLayer3Match().equals(statsFlow.getLayer3Match())) {
+        } else if(!layer3MatchEquals(statsFlow.getLayer3Match(),storedFlow.getLayer3Match())) {
             return false;
         }
         if (storedFlow.getLayer4Match()== null) {
@@ -839,4 +845,100 @@ public class StatisticsUpdateCommiter implements OpendaylightGroupStatisticsList
         }
         return true;
     }
+
+    private boolean layer3MatchEquals(Layer3Match statsLayer3Match, Layer3Match storedLayer3Match){
+
+        if(statsLayer3Match instanceof Ipv4Match && storedLayer3Match instanceof Ipv4Match){
+            Ipv4Match statsIpv4Match = (Ipv4Match)statsLayer3Match;
+            Ipv4Match storedIpv4Match = (Ipv4Match)storedLayer3Match;
+            
+            if (storedIpv4Match.getIpv4Destination()== null) {
+                if (statsIpv4Match.getIpv4Destination()!= null) {
+                    return false;
+                }
+            } else if(!IpAddressEquals(statsIpv4Match.getIpv4Destination(),storedIpv4Match.getIpv4Destination())){
+                return false;
+            }
+            if (storedIpv4Match.getIpv4Source() == null) {
+                if (statsIpv4Match.getIpv4Source() != null) {
+                    return false;
+                }
+            } else if(!IpAddressEquals(statsIpv4Match.getIpv4Source(),storedIpv4Match.getIpv4Source())) {
+                return false;
+            }
+            
+            return true;
+        }else{
+            return storedLayer3Match.equals(statsLayer3Match);
+        }
+    }
+    
+    private boolean IpAddressEquals(Ipv4Prefix statsIpAddress, Ipv4Prefix storedIpAddress) {
+        IntegerIpAddress statsIpAddressInt = StrIpToIntIp(statsIpAddress.getValue());
+        IntegerIpAddress storedIpAddressInt = StrIpToIntIp(storedIpAddress.getValue());
+
+        if(IpAndMaskBasedMatch(statsIpAddressInt,storedIpAddressInt)){
+            return true;
+        }
+        if(IpBasedMatch(statsIpAddressInt,storedIpAddressInt)){
+            return true;
+        }
+        return false;
+    }
+
+    private boolean IpAndMaskBasedMatch(IntegerIpAddress statsIpAddressInt,IntegerIpAddress storedIpAddressInt){
+        return ((statsIpAddressInt.getIp() & statsIpAddressInt.getMask()) ==  (storedIpAddressInt.getIp() & storedIpAddressInt.getMask()));
+    }
+
+    private boolean IpBasedMatch(IntegerIpAddress statsIpAddressInt,IntegerIpAddress storedIpAddressInt){
+        return (statsIpAddressInt.getIp() == storedIpAddressInt.getIp());
+    }
+    
+    /*
+     * Method return integer version of ip address. Converted int will be mask if 
+     * mask specified
+     */
+    private IntegerIpAddress StrIpToIntIp(String ipAddresss){
+        
+        String[] parts = ipAddresss.split("/");
+        String ip = parts[0];
+        int prefix;
+
+        if (parts.length < 2) {
+            prefix = 32;
+        } else {
+            prefix = Integer.parseInt(parts[1]);
+        }
+
+        Inet4Address addr =null;
+        try {
+            addr = (Inet4Address) InetAddress.getByName(ip);
+        } catch (UnknownHostException e){}
+
+        byte[] addrBytes = addr.getAddress();
+        int ipInt = ((addrBytes[0] & 0xFF) << 24) |
+                         ((addrBytes[1] & 0xFF) << 16) |
+                         ((addrBytes[2] & 0xFF) << 8)  |
+                         ((addrBytes[3] & 0xFF) << 0);
+
+        int mask = 0xffffffff << 32 - prefix;
+
+        return new IntegerIpAddress(ipInt, mask);
+    }
+    
+    class IntegerIpAddress{
+        int ip;
+        int mask;
+        public IntegerIpAddress(int ip, int mask) {
+            this.ip = ip;
+            this.mask = mask;
+        }
+        public int getIp() {
+            return ip;
+        }
+        public int getMask() {
+            return mask;
+        }
+    }
 }
+
index c4672bf65d590ef21ba359fc73eb5d1820a9eff6..08aeea26783cb203ffaa69655097a3912175eec7 100644 (file)
@@ -223,7 +223,7 @@ public class ServiceProviderController {
                 mavenBundle(ODL, "netconf-impl").versionAsInProject(),
                 mavenBundle(ODL, "netconf-client").versionAsInProject(),
                 mavenBundle(ODL, "netconf-util").versionAsInProject(),
-                mavenBundle(ODL + ".thirdparty", "ganymed", "1.0-SNAPSHOT"),
+                mavenBundle(ODL + ".thirdparty", "ganymed").versionAsInProject(),
                 mavenBundle(ODL, "netconf-mapping-api").versionAsInProject(),
                 mavenBundle(ODL, "config-netconf-connector").versionAsInProject(),
                 mavenBundle(ODL, "config-persister-impl").versionAsInProject(),
index b419df0bbe13e672674d67b31b6b7ed5340acc1b..9d9cad792f41f84a95309bda75f5279a031b397b 100644 (file)
@@ -27,7 +27,6 @@
         <module>netconf-mapping-api</module>
         <module>netconf-client</module>
         <module>netconf-ssh</module>
-        <module>../../third-party/ganymed</module>
         <module>netconf-monitoring</module>
         <module>ietf-netconf-monitoring</module>
         <module>ietf-netconf-monitoring-extension</module>
index 351496abb3052c406260191bc80cf77f8db32266..c30f65903204df027b582c1c5816d5b106c91239 100644 (file)
@@ -16,6 +16,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.networkconfig.neutron.INeutronFloatingIPCRUD;
 import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
 import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD;
@@ -93,6 +94,10 @@ public class Activator extends ComponentActivatorAbstractBase {
                     .setService(IClusterContainerServices.class)
                     .setCallbacks("setClusterContainerService",
                     "unsetClusterContainerService").setRequired(true));
+            c.add(createContainerServiceDependency(containerName).setService(
+                    IConfigurationContainerService.class).setCallbacks(
+                    "setConfigurationContainerService",
+                    "unsetConfigurationContainerService").setRequired(true));
         }
         if (imp.equals(NeutronRouterInterface.class)) {
             // export the service
@@ -105,6 +110,10 @@ public class Activator extends ComponentActivatorAbstractBase {
                     .setService(IClusterContainerServices.class)
                     .setCallbacks("setClusterContainerService",
                     "unsetClusterContainerService").setRequired(true));
+            c.add(createContainerServiceDependency(containerName).setService(
+                    IConfigurationContainerService.class).setCallbacks(
+                    "setConfigurationContainerService",
+                    "unsetConfigurationContainerService").setRequired(true));
         }
         if (imp.equals(NeutronPortInterface.class)) {
             // export the service
@@ -117,6 +126,10 @@ public class Activator extends ComponentActivatorAbstractBase {
                     .setService(IClusterContainerServices.class)
                     .setCallbacks("setClusterContainerService",
                     "unsetClusterContainerService").setRequired(true));
+            c.add(createContainerServiceDependency(containerName).setService(
+                    IConfigurationContainerService.class).setCallbacks(
+                    "setConfigurationContainerService",
+                    "unsetConfigurationContainerService").setRequired(true));
         }
         if (imp.equals(NeutronSubnetInterface.class)) {
             // export the service
@@ -129,6 +142,10 @@ public class Activator extends ComponentActivatorAbstractBase {
                     .setService(IClusterContainerServices.class)
                     .setCallbacks("setClusterContainerService",
                     "unsetClusterContainerService").setRequired(true));
+            c.add(createContainerServiceDependency(containerName).setService(
+                    IConfigurationContainerService.class).setCallbacks(
+                    "setConfigurationContainerService",
+                    "unsetConfigurationContainerService").setRequired(true));
         }
         if (imp.equals(NeutronNetworkInterface.class)) {
             // export the service
@@ -141,6 +158,10 @@ public class Activator extends ComponentActivatorAbstractBase {
                     .setService(IClusterContainerServices.class)
                     .setCallbacks("setClusterContainerService",
                     "unsetClusterContainerService").setRequired(true));
+            c.add(createContainerServiceDependency(containerName).setService(
+                    IConfigurationContainerService.class).setCallbacks(
+                    "setConfigurationContainerService",
+                    "unsetConfigurationContainerService").setRequired(true));
         }
     }
 }
index b1b2610134cb2c7b97970e48e3fec477dab696f3..5cbe5cde9851eabfc7927d5fc3b949e2b26cb4e4 100644 (file)
@@ -19,7 +19,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map.Entry;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
 import org.apache.felix.dm.Component;
@@ -27,7 +26,9 @@ import org.opendaylight.controller.clustering.services.CacheConfigException;
 import org.opendaylight.controller.clustering.services.CacheExistException;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.networkconfig.neutron.INeutronFloatingIPCRUD;
 import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
 import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD;
@@ -36,10 +37,7 @@ import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
 import org.opendaylight.controller.networkconfig.neutron.NeutronFloatingIP;
 import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
 import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.IObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -47,12 +45,11 @@ import org.slf4j.LoggerFactory;
 public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD, IConfigurationContainerAware,
                                                    IObjectReader {
     private static final Logger logger = LoggerFactory.getLogger(NeutronFloatingIPInterface.class);
-    private static String ROOT = GlobalConstants.STARTUPHOME.toString();
-    private static final String FILENAME ="neutron.floatingip";
-    private static String fileName;
+    private static final String FILE_NAME = "neutron.floatingip.conf";
     private String containerName = null;
 
     private IClusterContainerServices clusterContainerService = null;
+    private IConfigurationContainerService configurationService;
     private ConcurrentMap<String, NeutronFloatingIP> floatingIPDB;
 
     // methods needed for creating caches
@@ -69,7 +66,16 @@ public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD, IConf
         }
     }
 
-    @SuppressWarnings("deprecation")
+    public void setConfigurationContainerService(IConfigurationContainerService service) {
+        logger.trace("Configuration service set: {}", service);
+        this.configurationService = service;
+    }
+
+    public void unsetConfigurationContainerService(IConfigurationContainerService service) {
+        logger.trace("Configuration service removed: {}", service);
+        this.configurationService = null;
+    }
+
     private void allocateCache() {
         if (this.clusterContainerService == null) {
             logger.error("un-initialized clusterContainerService, can't create cache");
@@ -88,7 +94,7 @@ public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD, IConf
         logger.debug("Cache successfully created for NeutronFloatingIps");
     }
 
-    @SuppressWarnings({ "unchecked", "deprecation" })
+    @SuppressWarnings({ "unchecked" })
     private void retrieveCache() {
         if (this.clusterContainerService == null) {
             logger.error("un-initialized clusterContainerService, can't retrieve cache");
@@ -104,7 +110,6 @@ public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD, IConf
         logger.debug("Cache was successfully retrieved for Neutron FloatingIPs");
     }
 
-    @SuppressWarnings("deprecation")
     private void destroyCache() {
         if (this.clusterContainerService == null) {
             logger.error("un-initialized clusterMger, can't destroy cache");
@@ -117,9 +122,7 @@ public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD, IConf
     private void startUp() {
         allocateCache();
         retrieveCache();
-        if ((clusterContainerService != null) && (clusterContainerService.amICoordinator())) {
-            loadConfiguration();
-        }
+        loadConfiguration();
     }
 
     /**
@@ -136,7 +139,6 @@ public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD, IConf
             // In the Global instance case the containerName is empty
             this.containerName = "";
         }
-        fileName = ROOT + FILENAME + "_" + containerName + ".conf";
         startUp();
     }
 
@@ -169,6 +171,7 @@ public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD, IConf
 
     // this method uses reflection to update an object from it's delta.
 
+    @SuppressWarnings("unused")
     private boolean overwrite(Object target, Object delta) {
         Method[] methods = target.getClass().getMethods();
 
@@ -203,8 +206,9 @@ public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD, IConf
 
     @Override
     public NeutronFloatingIP getFloatingIP(String uuid) {
-        if (!floatingIPExists(uuid))
+        if (!floatingIPExists(uuid)) {
             return null;
+        }
         return floatingIPDB.get(uuid);
     }
 
@@ -227,12 +231,14 @@ public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD, IConf
         INeutronSubnetCRUD subnetCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
         INeutronPortCRUD portCRUD = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
 
-        if (floatingIPExists(input.getID()))
+        if (floatingIPExists(input.getID())) {
             return false;
+        }
         //if floating_ip_address isn't there, allocate from the subnet pool
         NeutronSubnet subnet = subnetCRUD.getSubnet(networkCRUD.getNetwork(input.getFloatingNetworkUUID()).getSubnets().get(0));
-        if (input.getFloatingIPAddress() == null)
+        if (input.getFloatingIPAddress() == null) {
             input.setFloatingIPAddress(subnet.getLowAddr());
+        }
         subnet.allocateIP(input.getFloatingIPAddress());
 
         //if port_id is there, bind port to this floating ip
@@ -251,8 +257,9 @@ public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD, IConf
         INeutronSubnetCRUD subnetCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
         INeutronPortCRUD portCRUD = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
 
-        if (!floatingIPExists(uuid))
+        if (!floatingIPExists(uuid)) {
             return false;
+        }
         NeutronFloatingIP floatIP = getFloatingIP(uuid);
         //if floating_ip_address isn't there, allocate from the subnet pool
         NeutronSubnet subnet = subnetCRUD.getSubnet(networkCRUD.getNetwork(floatIP.getFloatingNetworkUUID()).getSubnets().get(0));
@@ -269,8 +276,9 @@ public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD, IConf
     public boolean updateFloatingIP(String uuid, NeutronFloatingIP delta) {
         INeutronPortCRUD portCRUD = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
 
-        if (!floatingIPExists(uuid))
+        if (!floatingIPExists(uuid)) {
             return false;
+        }
         NeutronFloatingIP target = floatingIPDB.get(uuid);
         if (target.getPortUUID() != null) {
             NeutronPort port = portCRUD.getPort(target.getPortUUID());
@@ -288,25 +296,17 @@ public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD, IConf
         return true;
     }
 
-    @SuppressWarnings("unchecked")
     private void loadConfiguration() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<String, NeutronFloatingIP> confList = (ConcurrentMap<String, NeutronFloatingIP>)
-                                                            objReader.read(this, fileName);
-
-        if (confList == null) {
-            return;
-        }
-
-        for (String key : confList.keySet()) {
-            floatingIPDB.put(key, confList.get(key));
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, FILE_NAME)) {
+            NeutronFloatingIP nfIP = (NeutronFloatingIP) conf;
+            floatingIPDB.put(nfIP.getID(), nfIP);
         }
     }
 
     @Override
     public Status saveConfiguration() {
-        ObjectWriter objWriter = new ObjectWriter();
-        return objWriter.write(new ConcurrentHashMap<String, NeutronFloatingIP>(floatingIPDB), fileName);
+        return configurationService.persistConfiguration(new ArrayList<ConfigurationObject>(floatingIPDB.values()),
+                FILE_NAME);
     }
 
     @Override
index eda4d21d5dcd20a772791bfea85ac6a081281fb4..c6e161b91f66462941e322914f80ea14a1b28db8 100644 (file)
@@ -19,7 +19,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map.Entry;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
 import org.apache.felix.dm.Component;
@@ -27,13 +26,12 @@ import org.opendaylight.controller.clustering.services.CacheConfigException;
 import org.opendaylight.controller.clustering.services.CacheExistException;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
 import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
-import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.IObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -41,13 +39,12 @@ import org.slf4j.LoggerFactory;
 public class NeutronNetworkInterface implements INeutronNetworkCRUD, IConfigurationContainerAware,
                                                 IObjectReader {
     private static final Logger logger = LoggerFactory.getLogger(NeutronNetworkInterface.class);
-    private static String ROOT = GlobalConstants.STARTUPHOME.toString();
-    private static final String FILENAME ="neutron.network";
-    private static String fileName;
+    private static final String FILE_NAME ="neutron.network.conf";
     private String containerName = null;
 
     private ConcurrentMap<String, NeutronNetwork> networkDB;
     private IClusterContainerServices clusterContainerService = null;
+    private IConfigurationContainerService configurationService;
 
     // methods needed for creating caches
 
@@ -63,7 +60,16 @@ public class NeutronNetworkInterface implements INeutronNetworkCRUD, IConfigurat
         }
     }
 
-    @SuppressWarnings("deprecation")
+    public void setConfigurationContainerService(IConfigurationContainerService service) {
+        logger.trace("Configuration service set: {}", service);
+        this.configurationService = service;
+    }
+
+    public void unsetConfigurationContainerService(IConfigurationContainerService service) {
+        logger.trace("Configuration service removed: {}", service);
+        this.configurationService = null;
+    }
+
     private void allocateCache() {
         if (this.clusterContainerService == null) {
             logger.error("un-initialized clusterContainerService, can't create cache");
@@ -82,7 +88,7 @@ public class NeutronNetworkInterface implements INeutronNetworkCRUD, IConfigurat
         logger.debug("Cache successfully created for Neutron Networks");
     }
 
-    @SuppressWarnings({ "unchecked", "deprecation" })
+    @SuppressWarnings({ "unchecked" })
     private void retrieveCache() {
         if (this.clusterContainerService == null) {
             logger.error("un-initialized clusterContainerService, can't retrieve cache");
@@ -99,9 +105,7 @@ public class NeutronNetworkInterface implements INeutronNetworkCRUD, IConfigurat
     private void startUp() {
         allocateCache();
         retrieveCache();
-        if ((clusterContainerService != null) && (clusterContainerService.amICoordinator())) {
-            loadConfiguration();
-        }
+        loadConfiguration();
     }
 
     /**
@@ -118,11 +122,9 @@ public class NeutronNetworkInterface implements INeutronNetworkCRUD, IConfigurat
             // In the Global instance case the containerName is empty
             this.containerName = "";
         }
-        fileName = ROOT + FILENAME + "_" + containerName + ".conf";
         startUp();
     }
 
-    @SuppressWarnings("deprecation")
     private void destroyCache() {
         if (this.clusterContainerService == null) {
             logger.error("un-initialized clusterMger, can't destroy cache");
@@ -195,8 +197,9 @@ public class NeutronNetworkInterface implements INeutronNetworkCRUD, IConfigurat
 
     @Override
     public NeutronNetwork getNetwork(String uuid) {
-        if (!networkExists(uuid))
+        if (!networkExists(uuid)) {
             return null;
+        }
         return networkDB.get(uuid);
     }
 
@@ -215,8 +218,9 @@ public class NeutronNetworkInterface implements INeutronNetworkCRUD, IConfigurat
 
     @Override
     public boolean addNetwork(NeutronNetwork input) {
-        if (networkExists(input.getID()))
+        if (networkExists(input.getID())) {
             return false;
+        }
         networkDB.putIfAbsent(input.getID(), input);
       //TODO: add code to find INeutronNetworkAware services and call newtorkCreated on them
         return true;
@@ -224,8 +228,9 @@ public class NeutronNetworkInterface implements INeutronNetworkCRUD, IConfigurat
 
     @Override
     public boolean removeNetwork(String uuid) {
-        if (!networkExists(uuid))
+        if (!networkExists(uuid)) {
             return false;
+        }
         networkDB.remove(uuid);
       //TODO: add code to find INeutronNetworkAware services and call newtorkDeleted on them
         return true;
@@ -233,41 +238,36 @@ public class NeutronNetworkInterface implements INeutronNetworkCRUD, IConfigurat
 
     @Override
     public boolean updateNetwork(String uuid, NeutronNetwork delta) {
-        if (!networkExists(uuid))
+        if (!networkExists(uuid)) {
             return false;
+        }
         NeutronNetwork target = networkDB.get(uuid);
         return overwrite(target, delta);
     }
 
     @Override
     public boolean networkInUse(String netUUID) {
-        if (!networkExists(netUUID))
+        if (!networkExists(netUUID)) {
             return true;
+        }
         NeutronNetwork target = networkDB.get(netUUID);
-        if (target.getPortsOnNetwork().size() > 0)
+        if (target.getPortsOnNetwork().size() > 0) {
             return true;
+        }
         return false;
     }
 
-    @SuppressWarnings("unchecked")
     private void loadConfiguration() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<String, NeutronNetwork> confList = (ConcurrentMap<String, NeutronNetwork>)
-                                                            objReader.read(this, fileName);
-
-        if (confList == null) {
-            return;
-        }
-
-        for (String key : confList.keySet()) {
-            networkDB.put(key, confList.get(key));
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, FILE_NAME)) {
+            NeutronNetwork nn = (NeutronNetwork) conf;
+            networkDB.put(nn.getID(), nn);
         }
     }
 
     @Override
     public Status saveConfiguration() {
-        ObjectWriter objWriter = new ObjectWriter();
-        return objWriter.write(new ConcurrentHashMap<String, NeutronNetwork>(networkDB), fileName);
+        return configurationService.persistConfiguration(new ArrayList<ConfigurationObject>(networkDB.values()),
+                FILE_NAME);
     }
 
     @Override
index a49888f6c3e97201059c1c4f2f28e3a8038c3d51..6dc0e46b61749673b799c7d94efb91240658f4e3 100644 (file)
@@ -20,7 +20,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map.Entry;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
 import org.apache.felix.dm.Component;
@@ -28,7 +27,9 @@ import org.opendaylight.controller.clustering.services.CacheConfigException;
 import org.opendaylight.controller.clustering.services.CacheExistException;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
 import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD;
 import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD;
@@ -37,10 +38,7 @@ import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
 import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
 import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
 import org.opendaylight.controller.networkconfig.neutron.Neutron_IPs;
-import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.IObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,12 +46,11 @@ import org.slf4j.LoggerFactory;
 public class NeutronPortInterface implements INeutronPortCRUD, IConfigurationContainerAware,
                                              IObjectReader {
     private static final Logger logger = LoggerFactory.getLogger(NeutronPortInterface.class);
-    private static String ROOT = GlobalConstants.STARTUPHOME.toString();
-    private static final String FILENAME ="neutron.port";
-    private static String fileName;
+    private static final String FILE_NAME ="neutron.port.conf";
     private String containerName = null;
 
     private IClusterContainerServices clusterContainerService = null;
+    private IConfigurationContainerService configurationService;
     private ConcurrentMap<String, NeutronPort> portDB;
 
     // methods needed for creating caches
@@ -70,7 +67,16 @@ public class NeutronPortInterface implements INeutronPortCRUD, IConfigurationCon
         }
     }
 
-    @SuppressWarnings("deprecation")
+    public void setConfigurationContainerService(IConfigurationContainerService service) {
+        logger.trace("Configuration service set: {}", service);
+        configurationService = service;
+    }
+
+    public void unsetConfigurationContainerService(IConfigurationContainerService service) {
+        logger.trace("Configuration service removed: {}", service);
+        configurationService = null;
+    }
+
     private void allocateCache() {
         if (clusterContainerService == null) {
             logger.error("un-initialized clusterContainerService, can't create cache");
@@ -89,7 +95,7 @@ public class NeutronPortInterface implements INeutronPortCRUD, IConfigurationCon
         logger.debug("Cache successfully created for OpenDOVE");
     }
 
-    @SuppressWarnings({ "unchecked", "deprecation" })
+    @SuppressWarnings({ "unchecked" })
     private void retrieveCache() {
         if (clusterContainerService == null) {
             logger.error("un-initialized clusterContainerService, can't retrieve cache");
@@ -105,7 +111,6 @@ public class NeutronPortInterface implements INeutronPortCRUD, IConfigurationCon
         logger.debug("Cache was successfully retrieved for Neutron Ports");
     }
 
-    @SuppressWarnings("deprecation")
     private void destroyCache() {
         if (clusterContainerService == null) {
             logger.error("un-initialized clusterMger, can't destroy cache");
@@ -118,10 +123,7 @@ public class NeutronPortInterface implements INeutronPortCRUD, IConfigurationCon
     private void startUp() {
         allocateCache();
         retrieveCache();
-        if ((clusterContainerService != null) && (clusterContainerService.amICoordinator())) {
-            loadConfiguration();
-        }
-
+        loadConfiguration();
     }
 
     /**
@@ -138,7 +140,6 @@ public class NeutronPortInterface implements INeutronPortCRUD, IConfigurationCon
             // In the Global instance case the containerName is empty
             containerName = "";
         }
-        fileName = ROOT + FILENAME + "_" + containerName + ".conf";
         startUp();
     }
 
@@ -348,25 +349,17 @@ public class NeutronPortInterface implements INeutronPortCRUD, IConfigurationCon
         return null;
     }
 
-    @SuppressWarnings("unchecked")
     private void loadConfiguration() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<String, NeutronPort> confList = (ConcurrentMap<String, NeutronPort>)
-                                                            objReader.read(this, fileName);
-
-        if (confList == null) {
-            return;
-        }
-
-        for (String key : confList.keySet()) {
-            portDB.put(key, confList.get(key));
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, FILE_NAME)) {
+            NeutronPort nn = (NeutronPort) conf;
+            portDB.put(nn.getID(), nn);
         }
     }
 
     @Override
     public Status saveConfiguration() {
-        ObjectWriter objWriter = new ObjectWriter();
-        return objWriter.write(new ConcurrentHashMap<String, NeutronPort>(portDB), fileName);
+        return configurationService.persistConfiguration(new ArrayList<ConfigurationObject>(portDB.values()),
+                FILE_NAME);
     }
 
     @Override
index 9f8aa1937ff1c12c5b74d14aa95968bc3fd6bea2..4e19d36fe0caa5978bdfbaed7b1ed02e4058892b 100644 (file)
@@ -19,7 +19,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map.Entry;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
 import org.apache.felix.dm.Component;
@@ -27,13 +26,12 @@ import org.opendaylight.controller.clustering.services.CacheConfigException;
 import org.opendaylight.controller.clustering.services.CacheExistException;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.networkconfig.neutron.INeutronRouterCRUD;
 import org.opendaylight.controller.networkconfig.neutron.NeutronRouter;
-import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.IObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -41,12 +39,11 @@ import org.slf4j.LoggerFactory;
 public class NeutronRouterInterface implements INeutronRouterCRUD, IConfigurationContainerAware,
                                                IObjectReader {
     private static final Logger logger = LoggerFactory.getLogger(NeutronRouterInterface.class);
-    private static String ROOT = GlobalConstants.STARTUPHOME.toString();
-    private static final String FILENAME ="neutron.router";
-    private static String fileName;
+    private static final String FILE_NAME ="neutron.router.conf";
     private String containerName = null;
 
     private IClusterContainerServices clusterContainerService = null;
+    private IConfigurationContainerService configurationService;
     private ConcurrentMap<String, NeutronRouter> routerDB;
     // methods needed for creating caches
 
@@ -62,7 +59,16 @@ public class NeutronRouterInterface implements INeutronRouterCRUD, IConfiguratio
         }
     }
 
-    @SuppressWarnings("deprecation")
+    public void setConfigurationContainerService(IConfigurationContainerService service) {
+        logger.trace("Configuration service set: {}", service);
+        this.configurationService = service;
+    }
+
+    public void unsetConfigurationContainerService(IConfigurationContainerService service) {
+        logger.trace("Configuration service removed: {}", service);
+        this.configurationService = null;
+    }
+
     private void allocateCache() {
         if (this.clusterContainerService == null) {
             logger.error("un-initialized clusterContainerService, can't create cache");
@@ -81,7 +87,7 @@ public class NeutronRouterInterface implements INeutronRouterCRUD, IConfiguratio
         logger.debug("Cache successfully created for Neutron Routers");
     }
 
-    @SuppressWarnings({ "unchecked", "deprecation" })
+    @SuppressWarnings({ "unchecked" })
     private void retrieveCache() {
         if (this.clusterContainerService == null) {
             logger.error("un-initialized clusterContainerService, can't retrieve cache");
@@ -97,7 +103,6 @@ public class NeutronRouterInterface implements INeutronRouterCRUD, IConfiguratio
         logger.debug("Cache was successfully retrieved for Neutron Routers");
     }
 
-    @SuppressWarnings("deprecation")
     private void destroyCache() {
         if (this.clusterContainerService == null) {
             logger.error("un-initialized clusterMger, can't destroy cache");
@@ -110,10 +115,7 @@ public class NeutronRouterInterface implements INeutronRouterCRUD, IConfiguratio
     private void startUp() {
         allocateCache();
         retrieveCache();
-        if ((clusterContainerService != null) && (clusterContainerService.amICoordinator())) {
-            loadConfiguration();
-        }
-
+        loadConfiguration();
     }
 
     /**
@@ -130,7 +132,6 @@ public class NeutronRouterInterface implements INeutronRouterCRUD, IConfiguratio
             // In the Global instance case the containerName is empty
             this.containerName = "";
         }
-        fileName = ROOT + FILENAME + "_" + containerName + ".conf";
         startUp();
     }
 
@@ -198,8 +199,9 @@ public class NeutronRouterInterface implements INeutronRouterCRUD, IConfiguratio
 
     @Override
     public NeutronRouter getRouter(String uuid) {
-        if (!routerExists(uuid))
+        if (!routerExists(uuid)) {
             return null;
+        }
         return routerDB.get(uuid);
     }
 
@@ -218,55 +220,51 @@ public class NeutronRouterInterface implements INeutronRouterCRUD, IConfiguratio
 
     @Override
     public boolean addRouter(NeutronRouter input) {
-        if (routerExists(input.getID()))
+        if (routerExists(input.getID())) {
             return false;
+        }
         routerDB.putIfAbsent(input.getID(), input);
         return true;
     }
 
     @Override
     public boolean removeRouter(String uuid) {
-        if (!routerExists(uuid))
+        if (!routerExists(uuid)) {
             return false;
+        }
         routerDB.remove(uuid);
         return true;
     }
 
     @Override
     public boolean updateRouter(String uuid, NeutronRouter delta) {
-        if (!routerExists(uuid))
+        if (!routerExists(uuid)) {
             return false;
+        }
         NeutronRouter target = routerDB.get(uuid);
         return overwrite(target, delta);
     }
 
     @Override
     public boolean routerInUse(String routerUUID) {
-        if (!routerExists(routerUUID))
+        if (!routerExists(routerUUID)) {
             return true;
+        }
         NeutronRouter target = routerDB.get(routerUUID);
         return (target.getInterfaces().size() > 0);
     }
 
-    @SuppressWarnings("unchecked")
     private void loadConfiguration() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<String, NeutronRouter> confList = (ConcurrentMap<String, NeutronRouter>)
-                                                            objReader.read(this, fileName);
-
-        if (confList == null) {
-            return;
-        }
-
-        for (String key : confList.keySet()) {
-            routerDB.put(key, confList.get(key));
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, FILE_NAME)) {
+            NeutronRouter nr = (NeutronRouter) conf;
+            routerDB.put(nr.getID(), nr);
         }
     }
 
     @Override
     public Status saveConfiguration() {
-        ObjectWriter objWriter = new ObjectWriter();
-        return objWriter.write(new ConcurrentHashMap<String, NeutronRouter>(routerDB), fileName);
+        return configurationService.persistConfiguration(new ArrayList<ConfigurationObject>(routerDB.values()),
+                FILE_NAME);
     }
 
     @Override
index 049fd3283da007c4bf3a7a1e49191fb5fb04de7f..025c2f12f79013be5ccf57dba0bc2fa1259d7fe9 100644 (file)
@@ -19,7 +19,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map.Entry;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
 import org.apache.felix.dm.Component;
@@ -27,16 +26,15 @@ import org.opendaylight.controller.clustering.services.CacheConfigException;
 import org.opendaylight.controller.clustering.services.CacheExistException;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
 import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD;
 import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
 import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
 import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.IObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -44,13 +42,12 @@ import org.slf4j.LoggerFactory;
 public class NeutronSubnetInterface implements INeutronSubnetCRUD, IConfigurationContainerAware,
                                                IObjectReader {
     private static final Logger logger = LoggerFactory.getLogger(NeutronSubnetInterface.class);
-    private static String ROOT = GlobalConstants.STARTUPHOME.toString();
-    private static final String FILENAME ="neutron.subnet";
-    private static String fileName;
+    private static final String FILE_NAME ="neutron.subnet.conf";
 
     private String containerName = null;
 
     private IClusterContainerServices clusterContainerService = null;
+    private IConfigurationContainerService configurationService;
     private ConcurrentMap<String, NeutronSubnet> subnetDB;
 
     // methods needed for creating caches
@@ -67,7 +64,16 @@ public class NeutronSubnetInterface implements INeutronSubnetCRUD, IConfiguratio
         }
     }
 
-    @SuppressWarnings("deprecation")
+    public void setConfigurationContainerService(IConfigurationContainerService service) {
+        logger.trace("Configuration service set: {}", service);
+        this.configurationService = service;
+    }
+
+    public void unsetConfigurationContainerService(IConfigurationContainerService service) {
+        logger.trace("Configuration service removed: {}", service);
+        this.configurationService = null;
+    }
+
     private void allocateCache() {
         if (this.clusterContainerService == null) {
             logger.error("un-initialized clusterContainerService, can't create cache");
@@ -86,7 +92,7 @@ public class NeutronSubnetInterface implements INeutronSubnetCRUD, IConfiguratio
         logger.debug("Cache successfully created for Neutron Subnets");
     }
 
-    @SuppressWarnings({ "unchecked", "deprecation" })
+    @SuppressWarnings({ "unchecked" })
     private void retrieveCache() {
         if (this.clusterContainerService == null) {
             logger.error("un-initialized clusterContainerService, can't retrieve cache");
@@ -102,7 +108,6 @@ public class NeutronSubnetInterface implements INeutronSubnetCRUD, IConfiguratio
         logger.debug("Cache was successfully retrieved for Neutron Subnets");
     }
 
-    @SuppressWarnings("deprecation")
     private void destroyCache() {
         if (this.clusterContainerService == null) {
             logger.error("un-initialized clusterMger, can't destroy cache");
@@ -115,10 +120,7 @@ public class NeutronSubnetInterface implements INeutronSubnetCRUD, IConfiguratio
     private void startUp() {
         allocateCache();
         retrieveCache();
-        if ((clusterContainerService != null) && (clusterContainerService.amICoordinator())) {
-            loadConfiguration();
-        }
-
+        loadConfiguration();
     }
 
     /**
@@ -135,7 +137,6 @@ public class NeutronSubnetInterface implements INeutronSubnetCRUD, IConfiguratio
             // In the Global instance case the containerName is empty
             this.containerName = "";
         }
-        fileName = ROOT + FILENAME + "_" + containerName + ".conf";
         startUp();
     }
 
@@ -203,8 +204,9 @@ public class NeutronSubnetInterface implements INeutronSubnetCRUD, IConfiguratio
 
     @Override
     public NeutronSubnet getSubnet(String uuid) {
-        if (!subnetExists(uuid))
+        if (!subnetExists(uuid)) {
             return null;
+        }
         return subnetDB.get(uuid);
     }
 
@@ -224,8 +226,9 @@ public class NeutronSubnetInterface implements INeutronSubnetCRUD, IConfiguratio
     @Override
     public boolean addSubnet(NeutronSubnet input) {
         String id = input.getID();
-        if (subnetExists(id))
+        if (subnetExists(id)) {
             return false;
+        }
         subnetDB.putIfAbsent(id, input);
         INeutronNetworkCRUD networkIf = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
 
@@ -236,8 +239,9 @@ public class NeutronSubnetInterface implements INeutronSubnetCRUD, IConfiguratio
 
     @Override
     public boolean removeSubnet(String uuid) {
-        if (!subnetExists(uuid))
+        if (!subnetExists(uuid)) {
             return false;
+        }
         NeutronSubnet target = subnetDB.get(uuid);
         INeutronNetworkCRUD networkIf = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
 
@@ -249,39 +253,33 @@ public class NeutronSubnetInterface implements INeutronSubnetCRUD, IConfiguratio
 
     @Override
     public boolean updateSubnet(String uuid, NeutronSubnet delta) {
-        if (!subnetExists(uuid))
+        if (!subnetExists(uuid)) {
             return false;
+        }
         NeutronSubnet target = subnetDB.get(uuid);
         return overwrite(target, delta);
     }
 
     @Override
     public boolean subnetInUse(String subnetUUID) {
-        if (!subnetExists(subnetUUID))
+        if (!subnetExists(subnetUUID)) {
             return true;
+        }
         NeutronSubnet target = subnetDB.get(subnetUUID);
         return (target.getPortsInSubnet().size() > 0);
     }
 
-    @SuppressWarnings("unchecked")
     private void loadConfiguration() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<String, NeutronSubnet> confList = (ConcurrentMap<String, NeutronSubnet>)
-                                                            objReader.read(this, fileName);
-
-        if (confList == null) {
-            return;
-        }
-
-        for (String key : confList.keySet()) {
-            subnetDB.put(key, confList.get(key));
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, FILE_NAME)) {
+            NeutronSubnet ns = (NeutronSubnet) conf;
+            subnetDB.put(ns.getID(), ns);
         }
     }
 
     @Override
     public Status saveConfiguration() {
-        ObjectWriter objWriter = new ObjectWriter();
-        return objWriter.write(new ConcurrentHashMap<String, NeutronSubnet>(subnetDB), fileName);
+        return configurationService.persistConfiguration(new ArrayList<ConfigurationObject>(subnetDB.values()),
+                FILE_NAME);
     }
 
     @Override
index cdbb7d6b8182309f6ffecd9a1caf91a389adc9dd..3f02ec18b3eaeb7e4601147868a9e5684ce7e2b7 100644 (file)
@@ -48,6 +48,7 @@
         <configuration>
           <instructions>
             <Import-Package>
+              org.opendaylight.controller.configuration,
               org.opendaylight.controller.clustering.services,
               org.opendaylight.controller.sal.core,
               org.opendaylight.controller.sal.utils,
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>clustering.services</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>configuration</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
index 9c8c91b284f0914a16011429306de380fb7f2399..9e5aa2d0b4464178107a242c7274c6fcacb74924 100644 (file)
@@ -17,10 +17,12 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.opendaylight.controller.configuration.ConfigurationObject;
+
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronFloatingIP implements Serializable {
+public class NeutronFloatingIP extends ConfigurationObject implements Serializable {
     private static final long serialVersionUID = 1L;
 
     // See OpenStack Network API v2.0 Reference for description of
index 1277436e236fa375467d3ec07e6dda12a62f70c0..5b35dc2b34ff73519e4350fa7070ec06cf60801d 100644 (file)
@@ -18,10 +18,12 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.opendaylight.controller.configuration.ConfigurationObject;
+
 @XmlRootElement(name = "network")
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronNetwork implements Serializable {
+public class NeutronNetwork extends ConfigurationObject implements Serializable {
     // See OpenStack Network API v2.0 Reference for description of
     // annotated attributes
 
index bcadba202a049f9948d48270964beb94b9d7ea9b..c8ee4e8cccd3021b3a30deb4eb8ca56b16e17593 100644 (file)
@@ -19,11 +19,13 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.opendaylight.controller.configuration.ConfigurationObject;
+
 
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronPort implements Serializable {
+public class NeutronPort extends ConfigurationObject implements Serializable {
     private static final long serialVersionUID = 1L;
 
     // See OpenStack Network API v2.0 Reference for description of
index ed65c5c91b9b8d16b86c1d96499ce135c1b91e52..fa35f71fd6ae425aac90f7d31524198413ade2f2 100644 (file)
@@ -18,10 +18,12 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.opendaylight.controller.configuration.ConfigurationObject;
+
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronRouter implements Serializable {
+public class NeutronRouter extends ConfigurationObject implements Serializable {
     private static final long serialVersionUID = 1L;
 
     // See OpenStack Network API v2.0 Reference for description of
index fbaa63a14800f163659b8fe1616cfca271598879..11a1be21180db9f454cc1817ed55f762429d904d 100644 (file)
@@ -20,11 +20,12 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.commons.net.util.SubnetUtils;
 import org.apache.commons.net.util.SubnetUtils.SubnetInfo;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronSubnet implements Serializable {
+public class NeutronSubnet extends ConfigurationObject implements Serializable {
     private static final long serialVersionUID = 1L;
 
     // See OpenStack Network API v2.0 Reference for description of
index e862a59e8a7bef2772645d9567661be9716a49fd..b79e4325500d01549363e24e97cbc58c8581f7a0 100644 (file)
@@ -15,9 +15,11 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.opendaylight.controller.configuration.ConfigurationObject;
+
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
-public class Neutron_IPs implements Serializable {
+public class Neutron_IPs extends ConfigurationObject implements Serializable {
     private static final long serialVersionUID = 1L;
 
     // See OpenStack Network API v2.0 Reference for description of
index 70bd0d47343a90b6f9b67968d2e4291aa46a7476..afd2f2e47f967454d13549d88b1394211642d359 100644 (file)
     </plugins>
   </build>
   <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>containermanager</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>switchmanager</artifactId>
       <artifactId>bundlescanner</artifactId>
     </dependency>
 
-    <dependency>
-       <groupId>com.fasterxml.jackson.core</groupId>
-       <artifactId>jackson-annotations</artifactId>
-    </dependency>
-
-    <dependency>
-       <groupId>com.fasterxml.jackson.core</groupId>
-       <artifactId>jackson-core</artifactId>
-    </dependency>
-
-    <dependency>
+     <dependency>
       <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-databind</artifactId>
     </dependency>
index b4a4170a90e86d2e70f742ae6a3ecea9dbd56d14..44e2efa7903f1fdc70bf220b12142f4a089978ee 100644 (file)
     </plugins>
   </build>
   <dependencies>
+  <dependency>
+   <groupId>org.opendaylight.controller</groupId>
+   <artifactId>clustering.services</artifactId>
+  </dependency>
    <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
index b1603d712b3c5b4c69dc3b1f8f86ba7fa569e33a..9757e8caddc8f74be3dad68491231d4ab091688c 100644 (file)
@@ -28,7 +28,6 @@
           <instructions>
             <Import-Package>
               org.opendaylight.controller.forwardingrulesmanager,
-              org.opendaylight.controller.containermanager,
               org.opendaylight.controller.sal.core,
               org.opendaylight.controller.sal.flowprogrammer, org.slf4j,
               org.opendaylight.controller.sal.reader,
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>containermanager</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>forwardingrulesmanager</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.services</artifactId>
-    </dependency>
   </dependencies>
 </project>
index bc7d458c466758fc65aa0de080c36a22c8940c54..8f2ad737f78aab913ee81eb50f55ae6c7eae7242 100644 (file)
@@ -43,7 +43,6 @@
           <instructions>
             <Import-Package>
               org.opendaylight.controller.clustering.services,
-              org.opendaylight.controller.containermanager,
               org.opendaylight.controller.sal.core,
               org.opendaylight.controller.sal.flowprogrammer,
               org.opendaylight.controller.sal.reader,
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
-      <artifactId>containermanager</artifactId>
+      <artifactId>sal.connection</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>switchmanager</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>commons.logback_settings</artifactId>
-    </dependency>
   </dependencies>
 </project>
index 010aaa5d411807fc9075e00cf4198c211dd0f74d..ebaf83fd39a5b5363dce448a84befe6b33fec6d1 100644 (file)
               org.opendaylight.controller.switchmanager
             </Export-Package>
             <Import-Package>
-              org.opendaylight.controller.clustering.services,
               org.opendaylight.controller.configuration,
               org.opendaylight.controller.sal.core,
               org.opendaylight.controller.sal.utils,
               org.opendaylight.controller.sal.packet,
               org.opendaylight.controller.sal.inventory,
               org.slf4j,
-              org.apache.felix.dm,
-              org.eclipse.osgi.framework.console,
-              org.osgi.framework,
-              javax.xml.bind.annotation,
-              org.apache.commons.lang3.builder
+              javax.xml.bind.annotation
             </Import-Package>
           </instructions>
           <manifestLocation>${project.basedir}/META-INF</manifestLocation>
     </plugins>
   </build>
   <dependencies>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.services</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>configuration</artifactId>
index 4bb6438b32ce40a71b89796ecc81e91e7382c543..eeccf1080baa66f9e92424a3e691e7015ec36338 100644 (file)
@@ -14,6 +14,7 @@ import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.core.NodeConnector;
 import org.opendaylight.controller.sal.utils.GUIField;
@@ -23,7 +24,7 @@ import org.slf4j.LoggerFactory;
 /**
  * The class represents a Span Port configuration for a network node.
  */
-public class SpanConfig implements Serializable {
+public class SpanConfig extends ConfigurationObject implements Serializable {
     protected static final Logger logger = LoggerFactory
     .getLogger(SpanConfig.class);
     private static final long serialVersionUID = 1L;
@@ -73,23 +74,30 @@ public class SpanConfig implements Serializable {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         SpanConfig other = (SpanConfig) obj;
         if (nodeId == null) {
-            if (other.nodeId != null)
+            if (other.nodeId != null) {
                 return false;
-        } else if (!nodeId.equals(other.nodeId))
+            }
+        } else if (!nodeId.equals(other.nodeId)) {
             return false;
+        }
         if (spanPort == null) {
-            if (other.spanPort != null)
+            if (other.spanPort != null) {
                 return false;
-        } else if (!spanPort.equals(other.spanPort))
+            }
+        } else if (!spanPort.equals(other.spanPort)) {
             return false;
+        }
         return true;
     }
 
index ba9d1a12f3e0b42e389eac6f98bb59bf6557b10d..28c811c669f62418e836fd6ed3af0cb103e040c4 100644 (file)
@@ -12,6 +12,7 @@ import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.sal.core.Description;
 import org.opendaylight.controller.sal.core.ForwardingMode;
 import org.opendaylight.controller.sal.core.Property;
@@ -22,7 +23,7 @@ import org.opendaylight.controller.sal.utils.StatusCode;
 /**
  * The class describes a switch configuration
  */
-public class SwitchConfig implements Cloneable, Serializable {
+public class SwitchConfig extends ConfigurationObject implements Cloneable, Serializable {
     private static final long serialVersionUID = 1L;
     private final String nodeId;
     private final Map<String, Property> nodeProperties;
index 01a73af18c2f989c63bdea0fdf13ed76d3b97006..e16c6051d355dafa96c87cff4cdc74b5fdb49e9d 100644 (file)
@@ -45,9 +45,9 @@
             <Export-Package>
             </Export-Package>
             <Import-Package>
+              org.opendaylight.controller.configuration,
               org.opendaylight.controller.switchmanager,
               org.opendaylight.controller.clustering.services,
-              org.opendaylight.controller.configuration,
               org.opendaylight.controller.sal.core,
               org.opendaylight.controller.sal.utils,
               org.opendaylight.controller.sal.packet,
   <dependencies>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.services</artifactId>
+      <artifactId>configuration</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
-      <artifactId>configuration</artifactId>
+      <artifactId>clustering.services</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
     </dependency>
     <dependency>
       <groupId>equinoxSDK381</groupId>
-      <artifactId>org.apache.felix.gogo.runtime</artifactId>
+      <artifactId>org.eclipse.osgi</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>commons.logback_settings</artifactId>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>org.apache.felix.gogo.runtime</artifactId>
     </dependency>
   </dependencies>
 </project>
index f55fc8e5ee9d574be44cbf907d9e075b50a6f4dd..002e06c0bf4fb3b84d3de4e2f6982552ed86a8b3 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.controller.switchmanager.internal;
 import org.apache.felix.dm.Component;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
 import org.opendaylight.controller.sal.inventory.IInventoryService;
 import org.opendaylight.controller.sal.inventory.IListenInventoryUpdates;
@@ -95,6 +96,10 @@ public class Activator extends ComponentActivatorAbstractBase {
                     IClusterContainerServices.class).setCallbacks(
                     "setClusterContainerService",
                     "unsetClusterContainerService").setRequired(true));
+            c.add(createContainerServiceDependency(containerName).setService(
+                    IConfigurationContainerService.class).setCallbacks(
+                    "setConfigurationContainerService",
+                    "unsetConfigurationContainerService").setRequired(true));
         }
     }
 
index 674da37afb5676a971905aefc3caf2a84eb2c761..770180c04e7ae754e91d12659ae43ea2577a3d4b 100644 (file)
@@ -35,7 +35,9 @@ import org.opendaylight.controller.clustering.services.CacheConfigException;
 import org.opendaylight.controller.clustering.services.CacheExistException;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.sal.core.Bandwidth;
 import org.opendaylight.controller.sal.core.Config;
 import org.opendaylight.controller.sal.core.ConstructionException;
@@ -56,8 +58,6 @@ import org.opendaylight.controller.sal.reader.NodeDescription;
 import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.HexEncode;
 import org.opendaylight.controller.sal.utils.IObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
 import org.opendaylight.controller.statisticsmanager.IStatisticsManager;
@@ -86,8 +86,9 @@ import org.slf4j.LoggerFactory;
 public class SwitchManager implements ISwitchManager, IConfigurationContainerAware,
                                       IObjectReader, IListenInventoryUpdates, CommandProvider {
     private static Logger log = LoggerFactory.getLogger(SwitchManager.class);
-    private static String ROOT = GlobalConstants.STARTUPHOME.toString();
-    private String subnetFileName, spanFileName, switchConfigFileName;
+    private static final String SUBNETS_FILE_NAME = "subnets.conf";
+    private static final String SPAN_FILE_NAME = "spanPorts.conf";
+    private static final String SWITCH_CONFIG_FILE_NAME = "switchConfig.conf";
     private final List<NodeConnector> spanNodeConnectors = new CopyOnWriteArrayList<NodeConnector>();
     // Collection of Subnets keyed by the InetAddress
     private ConcurrentMap<InetAddress, Subnet> subnets;
@@ -101,6 +102,7 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
     private ConcurrentMap<String, Property> controllerProps;
     private IInventoryService inventoryService;
     private IStatisticsManager statisticsManager;
+    private IConfigurationContainerService configurationService;
     private final Set<ISwitchManagerAware> switchManagerAware = Collections
             .synchronizedSet(new HashSet<ISwitchManagerAware>());
     private final Set<IInventoryListener> inventoryListeners = Collections
@@ -116,9 +118,9 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
      * only subnet returned. As soon as a user-configured subnet is created this one will
      * vanish.
      */
-    protected static SubnetConfig DEFAULT_SUBNETCONFIG;
-    protected static Subnet DEFAULT_SUBNET;
-    protected static String DEFAULT_SUBNET_NAME = "default (cannot be modifed)";
+    protected static final SubnetConfig DEFAULT_SUBNETCONFIG;
+    protected static final Subnet DEFAULT_SUBNET;
+    protected static final String DEFAULT_SUBNET_NAME = "default (cannot be modifed)";
     static{
         DEFAULT_SUBNETCONFIG = new SubnetConfig(DEFAULT_SUBNET_NAME, "0.0.0.0/0", new ArrayList<String>());
         DEFAULT_SUBNET = new Subnet(DEFAULT_SUBNETCONFIG);
@@ -164,32 +166,17 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
     }
 
     public void startUp() {
-        String container = this.getContainerName();
-        // Initialize configuration file names
-        subnetFileName = ROOT + "subnets_" + container + ".conf";
-        spanFileName = ROOT + "spanPorts_" + container + ".conf";
-        switchConfigFileName = ROOT + "switchConfig_" + container + ".conf";
-
         // Instantiate cluster synced variables
         allocateCaches();
         retrieveCaches();
 
-        /*
-         * Read startup and build database if we are the coordinator
-         */
-        if ((clusterContainerService != null) && (clusterContainerService.amICoordinator())) {
-            loadSubnetConfiguration();
-            loadSpanConfiguration();
-            loadSwitchConfiguration();
-        }
-
         // Add controller MAC, if first node in the cluster
         if (!controllerProps.containsKey(MacAddress.name)) {
             byte controllerMac[] = getHardwareMAC();
             if (controllerMac != null) {
                 Property existing = controllerProps.putIfAbsent(MacAddress.name, new MacAddress(controllerMac));
                 if (existing == null && log.isTraceEnabled()) {
-                    log.trace("Container {}: Setting controller MAC address in the cluster: {}", container,
+                    log.trace("Container {}: Setting controller MAC address in the cluster: {}", getContainerName(),
                             HexEncode.bytesToHexStringFormat(controllerMac));
                 }
             }
@@ -365,14 +352,10 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
 
     @Override
     public List<Switch> getNetworkDevices() {
-        Set<Node> nodeSet = getNodes();
         List<Switch> swList = new ArrayList<Switch>();
-        if (nodeSet != null) {
-            for (Node node : nodeSet) {
-                swList.add(getSwitchByNode(node));
-            }
+        for (Node node : getNodes()) {
+            swList.add(getSwitchByNode(node));
         }
-
         return swList;
     }
 
@@ -702,48 +685,21 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
         return ois.readObject();
     }
 
-    @SuppressWarnings("unchecked")
     private void loadSubnetConfiguration() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<String, SubnetConfig> confList = (ConcurrentMap<String, SubnetConfig>) objReader
-                .read(this, subnetFileName);
-
-        if (confList == null) {
-            return;
-        }
-
-        for (SubnetConfig conf : confList.values()) {
-            addSubnet(conf);
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, SUBNETS_FILE_NAME)) {
+            addSubnet((SubnetConfig) conf);
         }
     }
 
-    @SuppressWarnings("unchecked")
     private void loadSpanConfiguration() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<Integer, SpanConfig> confList = (ConcurrentMap<Integer, SpanConfig>) objReader
-                .read(this, spanFileName);
-
-        if (confList == null) {
-            return;
-        }
-
-        for (SpanConfig conf : confList.values()) {
-            addSpanConfig(conf);
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, SPAN_FILE_NAME)) {
+            addSpanConfig((SpanConfig) conf);
         }
     }
 
-    @SuppressWarnings("unchecked")
     private void loadSwitchConfiguration() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<String, SwitchConfig> confList = (ConcurrentMap<String, SwitchConfig>) objReader
-                .read(this, switchConfigFileName);
-
-        if (confList == null) {
-            return;
-        }
-
-        for (SwitchConfig conf : confList.values()) {
-            updateNodeConfig(conf);
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, SWITCH_CONFIG_FILE_NAME)) {
+            updateNodeConfig((SwitchConfig) conf);
         }
     }
 
@@ -944,24 +900,36 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
     }
 
     public Status saveSwitchConfigInternal() {
-        Status retS = null, retP = null;
-        ObjectWriter objWriter = new ObjectWriter();
-
-        retS = objWriter.write(new ConcurrentHashMap<String, SubnetConfig>(
-                subnetsConfigList), subnetFileName);
-        retP = objWriter.write(new ConcurrentHashMap<SpanConfig, SpanConfig>(
-                spanConfigList), spanFileName);
-        retS = objWriter.write(new ConcurrentHashMap<String, SwitchConfig>(
-                nodeConfigList), switchConfigFileName);
-        if (retS.equals(retP)) {
-            if (retS.isSuccess()) {
-                return retS;
-            } else {
-                return new Status(StatusCode.INTERNALERROR, "Save failed");
-            }
+        Status status;
+        short number = 0;
+        status = configurationService.persistConfiguration(
+                new ArrayList<ConfigurationObject>(subnetsConfigList.values()), SUBNETS_FILE_NAME);
+        if (status.isSuccess()) {
+            number++;
+        } else {
+            log.warn("Failed to save subnet gateway configurations: " + status.getDescription());
+        }
+        status = configurationService.persistConfiguration(new ArrayList<ConfigurationObject>(spanConfigList.values()),
+                SPAN_FILE_NAME);
+        if (status.isSuccess()) {
+            number++;
         } else {
+            log.warn("Failed to save span port configurations: " + status.getDescription());
+        }
+        status = configurationService.persistConfiguration(new ArrayList<ConfigurationObject>(nodeConfigList.values()),
+                SWITCH_CONFIG_FILE_NAME);
+        if (status.isSuccess()) {
+            number++;
+        } else {
+            log.warn("Failed to save node configurations: " + status.getDescription());
+        }
+        if (number == 0) {
+            return new Status(StatusCode.INTERNALERROR, "Save failed");
+        }
+        if (number < 3) {
             return new Status(StatusCode.INTERNALERROR, "Partial save failure");
         }
+        return status;
     }
 
     @Override
@@ -1652,7 +1620,6 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
         isDefaultContainer = containerName.equals(GlobalConstants.DEFAULT
                 .toString());
 
-        startUp();
     }
 
     /**
@@ -1671,6 +1638,15 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
      *
      */
     void start() {
+        startUp();
+
+        /*
+         * Read startup and build database if we are the coordinator
+         */
+        loadSubnetConfiguration();
+        loadSpanConfiguration();
+        loadSwitchConfiguration();
+
         // OSGI console
         registerWithOSGIConsole();
     }
@@ -1692,6 +1668,16 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
     void stop() {
     }
 
+    public void setConfigurationContainerService(IConfigurationContainerService service) {
+        log.trace("Got configuration service set request {}", service);
+        this.configurationService = service;
+    }
+
+    public void unsetConfigurationContainerService(IConfigurationContainerService service) {
+        log.trace("Got configuration service UNset request");
+        this.configurationService = null;
+    }
+
     public void setInventoryService(IInventoryService service) {
         log.trace("Got inventory service set request {}", service);
         this.inventoryService = service;
@@ -2166,9 +2152,7 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
         if (configuredNotConnectedNodes != null) {
             for (Node node : configuredNotConnectedNodes) {
                 Switch sw = getSwitchByNode(node);
-                if (sw != null) {
-                    configuredNotConnectedSwitches.add(sw);
-                }
+                configuredNotConnectedSwitches.add(sw);
             }
         }
         return configuredNotConnectedSwitches;
index 2fa9c26a9036df67dcd77a8da03b4283e92c5b27..204caf01b4d87453842c4e1834c801617d8e714f 100644 (file)
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>configuration.implementation</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>hosttracker</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>hosttracker.implementation</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>topologymanager</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>protocol_plugins.stub</artifactId>
index 1b1e6f49d153d3b57ccfeb8e120bf2c3d6c7581d..3532ab78e0f10b2c4b4f428abc7b234c136b9b78 100644 (file)
@@ -16,6 +16,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.sal.core.NodeConnector;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -25,7 +26,7 @@ import org.slf4j.LoggerFactory;
  */
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
-public class TopologyUserLinkConfig implements Serializable {
+public class TopologyUserLinkConfig extends ConfigurationObject implements Serializable {
     private static final long serialVersionUID = 1L;
     private static final Logger logger = LoggerFactory.getLogger(TopologyUserLinkConfig.class);
 
@@ -38,19 +39,24 @@ public class TopologyUserLinkConfig implements Serializable {
 
         private String name;
 
+        @Override
         public String toString() {
             return name;
         }
 
         public static STATUS fromString(String str) {
-            if (str == null)
+            if (str == null) {
                 return LINKDOWN;
-            if (str.equals(SUCCESS.toString()))
+            }
+            if (str.equals(SUCCESS.toString())) {
                 return SUCCESS;
-            if (str.equals(LINKDOWN.toString()))
+            }
+            if (str.equals(LINKDOWN.toString())) {
                 return LINKDOWN;
-            if (str.equals(INCORRECT.toString()))
+            }
+            if (str.equals(INCORRECT.toString())) {
                 return INCORRECT;
+            }
             return LINKDOWN;
         }
     }
@@ -111,19 +117,18 @@ public class TopologyUserLinkConfig implements Serializable {
     }
 
     public boolean isValidNodeConnector(String nodeConnectorStr) {
-        NodeConnector nc = NodeConnector.fromString(nodeConnectorStr);
-        if (nc == null) return false;
-        return true;
+        return (NodeConnector.fromString(nodeConnectorStr) != null);
     }
 
     public boolean isValid() {
-        if (name == null || srcNodeConnector == null || dstNodeConnector == null) {
+        if (!isValidResourceName(name)) {
+            logger.debug("Invalid name in user link: {}", name);
             return false;
         }
 
         if (!isValidNodeConnector(srcNodeConnector) ||
                 !isValidNodeConnector(dstNodeConnector)) {
-            logger.debug("Invalid NodeConnector in user link: {}", this);
+            logger.debug("Invalid NodeConnector in user link: {}", name);
             return false;
         }
 
@@ -146,23 +151,30 @@ public class TopologyUserLinkConfig implements Serializable {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         TopologyUserLinkConfig other = (TopologyUserLinkConfig) obj;
         if (dstNodeConnector == null) {
-            if (other.dstNodeConnector != null)
+            if (other.dstNodeConnector != null) {
                 return false;
-        } else if (!dstNodeConnector.equals(other.dstNodeConnector))
+            }
+        } else if (!dstNodeConnector.equals(other.dstNodeConnector)) {
             return false;
+        }
         if (srcNodeConnector == null) {
-            if (other.srcNodeConnector != null)
+            if (other.srcNodeConnector != null) {
                 return false;
-        } else if (!srcNodeConnector.equals(other.srcNodeConnector))
+            }
+        } else if (!srcNodeConnector.equals(other.srcNodeConnector)) {
             return false;
+        }
         return true;
     }
 
index b2a096aa7b36c3d3c85a2a54a9bbefe5b05e2836..4ccbb0197d4bf1cdc1e6d2e87ed6e1a547ea0425 100644 (file)
@@ -18,6 +18,7 @@ import org.apache.felix.dm.Component;
 import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
 import org.opendaylight.controller.sal.topology.IListenTopoUpdates;
 import org.opendaylight.controller.sal.topology.ITopologyService;
@@ -101,6 +102,11 @@ public class Activator extends ComponentActivatorAbstractBase {
                     IClusterContainerServices.class).setCallbacks(
                     "setClusterContainerService",
                     "unsetClusterContainerService").setRequired(true));
+
+            c.add(createContainerServiceDependency(containerName).setService(
+                    IConfigurationContainerService.class).setCallbacks(
+                    "setConfigurationContainerService",
+                    "unsetConfigurationContainerService").setRequired(true));
         }
     }
 }
index b0570fb7f9b6eed29384ac4c0280202df1fd4a5f..3618547ac8c97f1ef80b1ccb179597c520e59872 100644 (file)
@@ -36,7 +36,9 @@ import org.opendaylight.controller.clustering.services.CacheExistException;
 import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.sal.core.Edge;
 import org.opendaylight.controller.sal.core.Host;
 import org.opendaylight.controller.sal.core.Node;
@@ -47,11 +49,8 @@ import org.opendaylight.controller.sal.core.UpdateType;
 import org.opendaylight.controller.sal.topology.IListenTopoUpdates;
 import org.opendaylight.controller.sal.topology.ITopologyService;
 import org.opendaylight.controller.sal.topology.TopoEdgeUpdate;
-import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.IObjectReader;
 import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
-import org.opendaylight.controller.sal.utils.ObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
 import org.opendaylight.controller.switchmanager.ISwitchManager;
@@ -80,9 +79,11 @@ public class TopologyManagerImpl implements
     protected static final String TOPOHOSTSDB = "topologymanager.hostsDB";
     protected static final String TOPONODECONNECTORDB = "topologymanager.nodeConnectorDB";
     protected static final String TOPOUSERLINKSDB = "topologymanager.userLinksDB";
+    private static final String USER_LINKS_FILE_NAME = "userTopology.conf";
     private static final Logger log = LoggerFactory.getLogger(TopologyManagerImpl.class);
     private ITopologyService topoService;
     private IClusterContainerServices clusterContainerService;
+    private IConfigurationContainerService configurationService;
     private ISwitchManager switchManager;
     // DB of all the Edges with properties which constitute our topology
     private ConcurrentMap<Edge, Set<Property>> edgesDB;
@@ -97,8 +98,6 @@ public class TopologyManagerImpl implements
     // Topology Manager Aware listeners - for clusterwide updates
     private Set<ITopologyManagerClusterWideAware> topologyManagerClusterWideAware =
             new CopyOnWriteArraySet<ITopologyManagerClusterWideAware>();
-    private static String ROOT = GlobalConstants.STARTUPHOME.toString();
-    private String userLinksFileName;
     private ConcurrentMap<String, TopologyUserLinkConfig> userLinksDB;
     private BlockingQueue<TopoEdgeUpdate> notifyQ = new LinkedBlockingQueue<TopoEdgeUpdate>();
     private volatile Boolean shuttingDown = false;
@@ -164,6 +163,16 @@ public class TopologyManagerImpl implements
         }
     }
 
+    public void setConfigurationContainerService(IConfigurationContainerService service) {
+        log.trace("Got configuration service set request {}", service);
+        this.configurationService = service;
+    }
+
+    public void unsetConfigurationContainerService(IConfigurationContainerService service) {
+        log.trace("Got configuration service UNset request");
+        this.configurationService = null;
+    }
+
     void setSwitchManager(ISwitchManager s) {
         log.debug("Adding ISwitchManager: {}", s);
         this.switchManager = s;
@@ -193,11 +202,9 @@ public class TopologyManagerImpl implements
             containerName = "UNKNOWN";
         }
 
-        userLinksFileName = ROOT + "userTopology_" + containerName + ".conf";
         registerWithOSGIConsole();
-        if ((clusterContainerService != null) && (clusterContainerService.amICoordinator())) {
-            loadConfiguration();
-        }
+        loadConfiguration();
+
         // Restore the shuttingDown status on init of the component
         shuttingDown = false;
         notifyThread = new Thread(new TopologyNotify(notifyQ));
@@ -292,16 +299,9 @@ public class TopologyManagerImpl implements
         notifyThread = null;
     }
 
-    @SuppressWarnings("unchecked")
     private void loadConfiguration() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<String, TopologyUserLinkConfig> confList =
-                (ConcurrentMap<String, TopologyUserLinkConfig>) objReader.read(this, userLinksFileName);
-
-        if (confList != null) {
-            for (TopologyUserLinkConfig conf : confList.values()) {
-                addUserLink(conf);
-            }
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, USER_LINKS_FILE_NAME)) {
+            addUserLink((TopologyUserLinkConfig) conf);
         }
     }
 
@@ -311,12 +311,10 @@ public class TopologyManagerImpl implements
     }
 
     public Status saveConfigInternal() {
-        ObjectWriter objWriter = new ObjectWriter();
-
-        Status saveStatus = objWriter.write(
-                new ConcurrentHashMap<String, TopologyUserLinkConfig>(userLinksDB), userLinksFileName);
+        Status saveStatus = configurationService.persistConfiguration(
+                new ArrayList<ConfigurationObject>(userLinksDB.values()), USER_LINKS_FILE_NAME);
 
-        if (! saveStatus.isSuccess()) {
+        if (!saveStatus.isSuccess()) {
             return new Status(StatusCode.INTERNALERROR, "Topology save failed: " + saveStatus.getDescription());
         }
         return saveStatus;
index 3b518cc5bc21eec1cff1f9fa12158fca14fe5eeb..768ccba13896d6232590e6c1d2fb1f1defba7f34 100644 (file)
         <configuration>
           <instructions>
             <Import-Package>
-              org.opendaylight.controller.clustering.services,
               org.opendaylight.controller.configuration,
               org.opendaylight.controller.sal.authorization,
               org.opendaylight.controller.sal.core,
               org.opendaylight.controller.sal.packet,
               org.opendaylight.controller.sal.utils,
-              org.opendaylight.controller.containermanager,
               org.slf4j,
               org.eclipse.osgi.framework.console,
               org.osgi.framework,
               org.apache.felix.dm,
-              org.apache.commons.lang3.builder,
               org.apache.commons.logging,
               javax.servlet,
               javax.servlet.http,
               org.springframework.security.web.context,
               org.springframework.security.core,
               org.springframework.security.core.context,
-              org.apache.commons.lang3,
               org.springframework.security.authentication,
               org.springframework.security.core.authority,
               org.springframework.security.core.userdetails,
     </plugins>
   </build>
   <dependencies>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>containermanager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.services</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>configuration</artifactId>
       <artifactId>javax.servlet</artifactId>
     </dependency>
     <!-- Spring security -->
-    <dependency>
-      <groupId>org.springframework.security</groupId>
-      <artifactId>spring-security-config</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.springframework.security</groupId>
       <artifactId>spring-security-core</artifactId>
       <groupId>org.springframework.security</groupId>
       <artifactId>spring-security-web</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.springframework.security</groupId>
-      <artifactId>spring-security-taglibs</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>org.springframework.transaction</artifactId>
-    </dependency>
   </dependencies>
 </project>
index f50f9e71c9c7f05d23de14034744fbeba676c730..3145f2095f4d480af5f91bc5e2303fd89246ae14 100644 (file)
@@ -11,11 +11,13 @@ package org.opendaylight.controller.usermanager;
 
 import java.io.Serializable;
 
+import org.opendaylight.controller.configuration.ConfigurationObject;
+
 /**
  * Configuration Java Object which represents a Remote AAA server configuration
  * information for User Manager.
  */
-public class ServerConfig implements Serializable {
+public class ServerConfig extends ConfigurationObject implements Serializable {
     private static final long serialVersionUID = 1L;
 
     // Order matters: JSP file expects following fields in the following order
@@ -57,28 +59,37 @@ public class ServerConfig implements Serializable {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         ServerConfig other = (ServerConfig) obj;
         if (ip == null) {
-            if (other.ip != null)
+            if (other.ip != null) {
                 return false;
-        } else if (!ip.equals(other.ip))
+            }
+        } else if (!ip.equals(other.ip)) {
             return false;
+        }
         if (protocol == null) {
-            if (other.protocol != null)
+            if (other.protocol != null) {
                 return false;
-        } else if (!protocol.equals(other.protocol))
+            }
+        } else if (!protocol.equals(other.protocol)) {
             return false;
+        }
         if (secret == null) {
-            if (other.secret != null)
+            if (other.secret != null) {
                 return false;
-        } else if (!secret.equals(other.secret))
+            }
+        } else if (!secret.equals(other.secret)) {
             return false;
+        }
         return true;
     }
 
index 83532a1012f6a9431cd4f75a3f1b201e653ec395..75fcec5b3cc5e4d9e2804a0bc74da9dd5ae2456f 100644 (file)
@@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.sal.authorization.AuthResultEnum;
 import org.opendaylight.controller.sal.packet.BitBufferHelper;
 import org.opendaylight.controller.sal.utils.HexEncode;
@@ -38,7 +39,7 @@ import org.slf4j.LoggerFactory;
  */
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
-public class UserConfig implements Serializable {
+public class UserConfig extends ConfigurationObject implements Serializable {
     private static final long serialVersionUID = 1L;
     private static Logger log = LoggerFactory.getLogger(UserConfig.class);
     private static final boolean strongPasswordCheck = Boolean.getBoolean("enableStrongPasswordCheck");
index 84ca46a21bb1761366b01d4db1ecdc3303790f27..08f7dcb313d170560713257d1e15ed0284a12986 100644 (file)
@@ -26,8 +26,8 @@
         <configuration>
           <instructions>
             <Import-Package>
-              org.opendaylight.controller.clustering.services,
               org.opendaylight.controller.configuration,
+              org.opendaylight.controller.clustering.services,
               org.opendaylight.controller.sal.authorization,
               org.opendaylight.controller.sal.core,
               org.opendaylight.controller.sal.packet,
       <groupId>org.slf4j</groupId>
       <artifactId>jcl-over-slf4j</artifactId>
     </dependency>
+
   </dependencies>
 </project>
index 77da099d67d033c9cc19e6acb66a2d4551015056..26e10a6b04580ff921dc96682dc1696e8777cedd 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.controller.usermanager.internal;
 import org.apache.felix.dm.Component;
 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
 import org.opendaylight.controller.configuration.IConfigurationAware;
+import org.opendaylight.controller.configuration.IConfigurationService;
 import org.opendaylight.controller.containermanager.IContainerAuthorization;
 import org.opendaylight.controller.sal.authorization.IResourceAuthorization;
 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
@@ -102,6 +103,11 @@ public class Activator extends ComponentActivatorAbstractBase {
                     "setClusterGlobalService", "unsetClusterGlobalService")
                     .setRequired(true));
 
+            c.add(createServiceDependency().setService(
+                    IConfigurationService.class).setCallbacks(
+                    "setConfigurationService",
+                    "unsetConfigurationService").setRequired(true));
+
             c.add(createServiceDependency().setService(IAAAProvider.class)
                     .setCallbacks("addAAAProvider", "removeAAAProvider")
                     .setRequired(false));
index 5d673fbca4abb8f4ba4d5bc0f962e29d95a4608b..be4b796a56cb3b76b19ae7c08a69dbe0933102e2 100644 (file)
@@ -31,15 +31,14 @@ import org.opendaylight.controller.clustering.services.CacheConfigException;
 import org.opendaylight.controller.clustering.services.CacheExistException;
 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
 import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.configuration.ConfigurationObject;
 import org.opendaylight.controller.configuration.IConfigurationAware;
+import org.opendaylight.controller.configuration.IConfigurationService;
 import org.opendaylight.controller.containermanager.IContainerAuthorization;
 import org.opendaylight.controller.sal.authorization.AuthResultEnum;
 import org.opendaylight.controller.sal.authorization.IResourceAuthorization;
 import org.opendaylight.controller.sal.authorization.UserLevel;
-import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.IObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectReader;
-import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
 import org.opendaylight.controller.usermanager.AuthResponse;
@@ -76,11 +75,10 @@ public class UserManager implements IUserManager, IObjectReader,
     private static final String DEFAULT_ADMIN = "admin";
     private static final String DEFAULT_ADMIN_PASSWORD = "admin";
     private static final String DEFAULT_ADMIN_ROLE = UserLevel.NETWORKADMIN.toString();
-    private static final String ROOT = GlobalConstants.STARTUPHOME.toString();
-    private static final String USERS_FILE_NAME = ROOT + "users.conf";
-    private static final String SERVERS_FILE_NAME = ROOT + "servers.conf";
-    private static final String AUTH_FILE_NAME = ROOT + "authorization.conf";
-    private static final String RECOVERY_FILE = ROOT + "NETWORK_ADMIN_PASSWORD_RECOVERY";
+    private static final String USERS_FILE_NAME = "users.conf";
+    private static final String SERVERS_FILE_NAME = "servers.conf";
+    private static final String AUTH_FILE_NAME = "authorization.conf";
+    private static final String RECOVERY_FILE = "NETWORK_ADMIN_PASSWORD_RECOVERY";
     private ConcurrentMap<String, UserConfig> localUserConfigList;
     private ConcurrentMap<String, ServerConfig> remoteServerConfigList;
     // local authorization info for remotely authenticated users
@@ -88,6 +86,7 @@ public class UserManager implements IUserManager, IObjectReader,
     private ConcurrentMap<String, AuthenticatedUser> activeUsers;
     private ConcurrentMap<String, IAAAProvider> authProviders;
     private IClusterGlobalServices clusterGlobalService = null;
+    private IConfigurationService configurationService;
     private SecurityContextRepository securityContextRepo = new UserSecurityContextRepository();
     private IContainerAuthorization containerAuthorizationClient;
     private Set<IResourceAuthorization> applicationAuthorizationClients;
@@ -204,11 +203,9 @@ public class UserManager implements IUserManager, IObjectReader,
         /*
          * Do not load local startup file if we are not the coordinator
          */
-        if ((clusterGlobalService != null) && (clusterGlobalService.amICoordinator())) {
-            loadUserConfig();
-            loadServerConfig();
-            loadAuthConfig();
-        }
+        loadUserConfig();
+        loadServerConfig();
+        loadAuthConfig();
     }
 
     private void loadSecurityKeys() {
@@ -408,9 +405,8 @@ public class UserManager implements IUserManager, IObjectReader,
     }
 
     private Status saveLocalUserListInternal() {
-        ObjectWriter objWriter = new ObjectWriter();
-        return objWriter.write(new ConcurrentHashMap<String, UserConfig>(
-                localUserConfigList), USERS_FILE_NAME);
+        return configurationService.persistConfiguration(
+                new ArrayList<ConfigurationObject>(localUserConfigList.values()), USERS_FILE_NAME);
     }
 
     @Override
@@ -419,9 +415,8 @@ public class UserManager implements IUserManager, IObjectReader,
     }
 
     private Status saveAAAServerListInternal() {
-        ObjectWriter objWriter = new ObjectWriter();
-        return objWriter.write(new ConcurrentHashMap<String, ServerConfig>(
-                remoteServerConfigList), SERVERS_FILE_NAME);
+        return configurationService.persistConfiguration(
+                new ArrayList<ConfigurationObject>(remoteServerConfigList.values()), SERVERS_FILE_NAME);
     }
 
     @Override
@@ -430,10 +425,8 @@ public class UserManager implements IUserManager, IObjectReader,
     }
 
     private Status saveAuthorizationListInternal() {
-        ObjectWriter objWriter = new ObjectWriter();
-        return objWriter.write(
-                new ConcurrentHashMap<String, AuthorizationConfig>(
-                        authorizationConfList), AUTH_FILE_NAME);
+        return configurationService.persistConfiguration(
+                new ArrayList<ConfigurationObject>(authorizationConfList.values()), AUTH_FILE_NAME);
     }
 
     @Override
@@ -444,48 +437,21 @@ public class UserManager implements IUserManager, IObjectReader,
         return ois.readObject();
     }
 
-    @SuppressWarnings("unchecked")
     private void loadUserConfig() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<String, UserConfig> confList = (ConcurrentMap<String, UserConfig>) objReader
-                .read(this, USERS_FILE_NAME);
-
-        if (confList == null) {
-            return;
-        }
-
-        for (UserConfig conf : confList.values()) {
-            addRemoveLocalUserInternal(conf, false);
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, USERS_FILE_NAME)) {
+            addRemoveLocalUserInternal((UserConfig) conf, false);
         }
     }
 
-    @SuppressWarnings("unchecked")
     private void loadServerConfig() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<String, ServerConfig> confList = (ConcurrentMap<String, ServerConfig>) objReader
-                .read(this, SERVERS_FILE_NAME);
-
-        if (confList == null) {
-            return;
-        }
-
-        for (ServerConfig conf : confList.values()) {
-            addAAAServer(conf);
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, SERVERS_FILE_NAME)) {
+            addAAAServer((ServerConfig) conf);
         }
     }
 
-    @SuppressWarnings("unchecked")
     private void loadAuthConfig() {
-        ObjectReader objReader = new ObjectReader();
-        ConcurrentMap<String, AuthorizationConfig> confList = (ConcurrentMap<String, AuthorizationConfig>) objReader
-                .read(this, AUTH_FILE_NAME);
-
-        if (confList == null) {
-            return;
-        }
-
-        for (AuthorizationConfig conf : confList.values()) {
-            addAuthInfo(conf);
+        for (ConfigurationObject conf : configurationService.retrieveConfiguration(this, AUTH_FILE_NAME)) {
+            addAuthInfo((AuthorizationConfig) conf);
         }
     }
 
@@ -817,6 +783,16 @@ public class UserManager implements IUserManager, IObjectReader,
         }
     }
 
+    public void setConfigurationService(IConfigurationService service) {
+        logger.trace("Got configuration service set request {}", service);
+        this.configurationService = service;
+    }
+
+    public void unsetConfigurationService(IConfigurationService service) {
+        logger.trace("Got configuration service UNset request");
+        this.configurationService = null;
+    }
+
     void unsetContainerAuthClient(IContainerAuthorization s) {
         if (this.containerAuthorizationClient == s) {
             this.containerAuthorizationClient = null;
diff --git a/pom.xml b/pom.xml
index 0641283b58c240489d01f02f64c27f92164cfe18..372f2a9d127e3ca1d455962e5e7d6d9932122b6c 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,6 @@
   <packaging>pom</packaging>
   <modules>
     <module>opendaylight/distribution/opendaylight</module>
-    <module>opendaylight/archetypes</module>
     <module>opendaylight/forwarding/staticrouting</module>
     <module>opendaylight/clustering/services</module>
     <module>opendaylight/clustering/services_implementation</module>
@@ -56,7 +55,7 @@
     <!-- <module>third-party/net.sf.jung2</module> -->
     <!-- <module>third-party/jersey-servlet</module> -->
     <!-- <module>third-party/org.apache.catalina.filters.CorsFilter</module> -->
-    <!-- <module>third-party/ganymed</module> -->
+    <module>third-party/ganymed</module>
 
     <module>third-party/commons/thirdparty</module>