Bump versions of config-subsystem and netconf-subsystem to 0.2.3-SNAPSHOT. 54/2554/1
authorMaros Marsalek <mmarsale@cisco.com>
Fri, 8 Nov 2013 12:15:23 +0000 (13:15 +0100)
committerMaros Marsalek <mmarsale@cisco.com>
Fri, 8 Nov 2013 13:44:50 +0000 (14:44 +0100)
Remove ConfigProvider.

Change-Id: I6d578f5c3b934456cf37a0893e816cfc8d6340f1
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
42 files changed:
opendaylight/commons/opendaylight/pom.xml
opendaylight/config/config-api/pom.xml
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/stat/ConfigProvider.java [deleted file]
opendaylight/config/config-manager/pom.xml
opendaylight/config/config-persister-api/pom.xml
opendaylight/config/config-persister-api/src/main/java/org/opendaylight/controller/config/persist/api/storage/StorageAdapter.java
opendaylight/config/config-persister-file-adapter/pom.xml
opendaylight/config/config-persister-file-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/FileStorageAdapter.java
opendaylight/config/config-util/pom.xml
opendaylight/config/logback-config/pom.xml
opendaylight/config/netty-threadgroup-config/pom.xml
opendaylight/config/pom.xml
opendaylight/config/threadpool-config-api/pom.xml
opendaylight/config/threadpool-config-impl/pom.xml
opendaylight/config/yang-jmx-generator-it/pom.xml
opendaylight/config/yang-jmx-generator-plugin/pom.xml
opendaylight/config/yang-jmx-generator/pom.xml
opendaylight/config/yang-store-api/pom.xml
opendaylight/config/yang-store-impl/pom.xml
opendaylight/config/yang-test/pom.xml
opendaylight/md-sal/sal-binding-broker/pom.xml
opendaylight/md-sal/sal-binding-config/pom.xml
opendaylight/md-sal/sal-binding-it/pom.xml
opendaylight/md-sal/sal-dom-broker/pom.xml
opendaylight/md-sal/sal-netconf-connector/pom.xml
opendaylight/md-sal/samples/toaster-it/pom.xml
opendaylight/netconf/config-netconf-connector/pom.xml
opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java
opendaylight/netconf/config-persister-impl/pom.xml
opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/NoOpStorageAdapter.java
opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/PersisterImpl.java
opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java
opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/PersisterImplTest.java
opendaylight/netconf/netconf-api/pom.xml
opendaylight/netconf/netconf-client/pom.xml
opendaylight/netconf/netconf-impl/pom.xml
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivator.java
opendaylight/netconf/netconf-it/pom.xml
opendaylight/netconf/netconf-mapping-api/pom.xml
opendaylight/netconf/netconf-util/pom.xml
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/osgi/NetconfConfigUtil.java
opendaylight/netconf/pom.xml

index 862f809..f191a29 100644 (file)
@@ -76,8 +76,8 @@
     <yangtools.binding.version>0.6.0-SNAPSHOT</yangtools.binding.version>
     <!--versions for bits of the controller -->
     <controller.version>0.4.1-SNAPSHOT</controller.version>
-    <config.version>0.2.2-SNAPSHOT</config.version>
-    <netconf.version>0.2.2-SNAPSHOT</netconf.version>
+    <config.version>0.2.3-SNAPSHOT</config.version>
+    <netconf.version>0.2.3-SNAPSHOT</netconf.version>
     <mdsal.version>1.0-SNAPSHOT</mdsal.version>
     <containermanager.version>0.5.1-SNAPSHOT</containermanager.version>
     <switchmanager.api.version>0.6.1-SNAPSHOT</switchmanager.api.version>
index 394831d..d733834 100644 (file)
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>config-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
 
     <artifactId>config-api</artifactId>
@@ -49,7 +49,6 @@
                             org.opendaylight.controller.config.api.jmx,
                             org.opendaylight.controller.config.api.jmx.constants,
                             org.opendaylight.controller.config.api.runtime,
-                            org.opendaylight.controller.config.stat,
                         </Export-Package>
                     </instructions>
                 </configuration>
diff --git a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/stat/ConfigProvider.java b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/stat/ConfigProvider.java
deleted file mode 100644 (file)
index 3a81061..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.config.stat;
-
-import org.osgi.framework.BundleContext;
-
-/**
- * Subset of {@link org.osgi.framework.BundleContext}
- */
-public interface ConfigProvider {
-    /**
-     * Returns the value of the specified property. If the key is not found in
-     * the Framework properties, the system properties are then searched. The
-     * method returns {@code null} if the property is not found.
-     *
-     * <p>
-     * All bundles must have permission to read properties whose names start
-     * with &quot;org.osgi.&quot;.
-     *
-     * @param key
-     *            The name of the requested property.
-     * @return The value of the requested property, or {@code null} if the
-     *         property is undefined.
-     * @throws SecurityException
-     *             If the caller does not have the appropriate
-     *             {@code PropertyPermission} to read the property, and the Java
-     *             Runtime Environment supports permissions.
-     */
-    String getProperty(String key);
-
-    public static class ConfigProviderImpl implements ConfigProvider {
-        private final BundleContext context;
-
-        public ConfigProviderImpl(BundleContext context) {
-            this.context = context;
-        }
-
-        @Override
-        public String getProperty(String key) {
-            return context.getProperty(key);
-        }
-
-        @Override
-        public String toString() {
-            return "ConfigProviderImpl{" + "context=" + context + '}';
-        }
-    }
-
-}
index 138f500..b55b5da 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>config-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
     <artifactId>config-manager</artifactId>
index 504c295..51f8c0b 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>config-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
     <artifactId>config-persister-api</artifactId>
@@ -33,7 +33,6 @@
                             com.google.common.base,
                             org.w3c.dom,
                             org.osgi.framework,
-                            org.opendaylight.controller.config.stat
                         </Import-Package>
                         <Export-Package>
                             org.opendaylight.controller.config.persist.api,
index 4475040..9daf4a1 100644 (file)
@@ -9,7 +9,7 @@
 package org.opendaylight.controller.config.persist.api.storage;
 
 import org.opendaylight.controller.config.persist.api.Persister;
-import org.opendaylight.controller.config.stat.ConfigProvider;
+import org.osgi.framework.BundleContext;
 
 /**
  * Plugins for {@link org.opendaylight.controller.config.persist.api.Persister}
@@ -17,6 +17,6 @@ import org.opendaylight.controller.config.stat.ConfigProvider;
  */
 public interface StorageAdapter extends Persister {
 
-    void setProperties(ConfigProvider configProvider);
+    void setProperties(BundleContext bundleContext);
 
 }
index a5c026d..b243ead 100644 (file)
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>config-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
     <artifactId>config-persister-file-adapter</artifactId>
@@ -80,7 +80,6 @@
                             javax.xml.transform.stream,
                             org.apache.commons.lang3,
                             org.opendaylight.controller.config.persist.api,
-                            org.opendaylight.controller.config.stat,
                             org.opendaylight.controller.config.persist.api.storage,
                             org.slf4j,
                             org.w3c.dom,
index a866743..775fb1f 100644 (file)
@@ -16,7 +16,7 @@ import com.google.common.collect.Sets;
 import com.google.common.io.Files;
 import org.apache.commons.lang3.StringUtils;
 import org.opendaylight.controller.config.persist.api.storage.StorageAdapter;
-import org.opendaylight.controller.config.stat.ConfigProvider;
+import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xml.sax.SAXException;
@@ -55,8 +55,8 @@ public class FileStorageAdapter implements StorageAdapter {
     private File storage;
 
     @Override
-    public void setProperties(ConfigProvider configProvider) {
-        File storage = extractStorageFileFromProperties(configProvider);
+    public void setProperties(BundleContext bundleContext) {
+        File storage = extractStorageFileFromProperties(bundleContext);
         logger.debug("Using file {}", storage.getAbsolutePath());
         // Create file if it does not exist
         File parentFile = storage.getAbsoluteFile().getParentFile();
@@ -92,12 +92,12 @@ public class FileStorageAdapter implements StorageAdapter {
         numberOfStoredBackups = numberOfBackups;
     }
 
-    private static File extractStorageFileFromProperties(ConfigProvider configProvider) {
-        String fileStorageProperty = configProvider.getProperty(FILE_STORAGE_PROP);
+    private static File extractStorageFileFromProperties(BundleContext bundleContext) {
+        String fileStorageProperty = bundleContext.getProperty(FILE_STORAGE_PROP);
         Preconditions.checkNotNull(fileStorageProperty, "Unable to find " + FILE_STORAGE_PROP
-                + " in received properties :" + configProvider);
+                + " in received context :" + bundleContext);
         File result = new File(fileStorageProperty);
-        String numberOfBAckupsAsString = configProvider.getProperty(NUMBER_OF_BACKUPS);
+        String numberOfBAckupsAsString = bundleContext.getProperty(NUMBER_OF_BACKUPS);
         if (numberOfBAckupsAsString != null) {
             numberOfStoredBackups = Integer.valueOf(numberOfBAckupsAsString);
         } else {
index bf681b1..206184c 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>config-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
     <artifactId>config-util</artifactId>
index 9abc8cc..b63f329 100644 (file)
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>config-subsystem</artifactId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
     <artifactId>logback-config</artifactId>
     <name>${project.artifactId}</name>
index e1b8fb3..ef63fce 100644 (file)
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>config-subsystem</artifactId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
index 6cf23e8..2842b5c 100755 (executable)
@@ -10,7 +10,7 @@
     </parent>
 
 
-    <version>0.2.2-SNAPSHOT</version>
+    <version>0.2.3-SNAPSHOT</version>
     <artifactId>config-subsystem</artifactId>
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>
index 1f8f1ea..d8ddc4f 100644 (file)
@@ -3,7 +3,7 @@
    <parent>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>config-subsystem</artifactId>
-      <version>0.2.2-SNAPSHOT</version>
+      <version>0.2.3-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>threadpool-config-api</artifactId>
index 1227978..e265604 100644 (file)
@@ -3,7 +3,7 @@
    <parent>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>config-subsystem</artifactId>
-      <version>0.2.2-SNAPSHOT</version>
+      <version>0.2.3-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>threadpool-config-impl</artifactId>
index 336d0c3..bcec65f 100644 (file)
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>config-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
 
     <artifactId>yang-jmx-generator-it</artifactId>
index 1d53f58..f06c7bd 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>config-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
     <artifactId>yang-jmx-generator-plugin</artifactId>
index 3784638..cd98571 100644 (file)
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>config-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
 
     <artifactId>yang-jmx-generator</artifactId>
index 6e850b2..9b103df 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>config-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
     <artifactId>yang-store-api</artifactId>
index 07ac4d4..ae59dde 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>config-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
     <artifactId>yang-store-impl</artifactId>
index 3de0688..b7540c8 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>config-subsystem</artifactId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
 
     <artifactId>yang-test</artifactId>
index 9ca025b..b0e2023 100644 (file)
@@ -47,7 +47,7 @@
                     <dependency>
                         <groupId>org.opendaylight.controller</groupId>
                         <artifactId>yang-jmx-generator-plugin</artifactId>
-                        <version>0.2.2-SNAPSHOT</version>
+                        <version>0.2.3-SNAPSHOT</version>
                     </dependency>
                 </dependencies>
             </plugin>
index 6638050..3bc50cd 100644 (file)
@@ -52,7 +52,7 @@
                     <dependency>
                         <groupId>org.opendaylight.controller</groupId>
                         <artifactId>yang-jmx-generator-plugin</artifactId>
-                        <version>0.2.2-SNAPSHOT</version>
+                        <version>0.2.3-SNAPSHOT</version>
                     </dependency>
                 </dependencies>
             </plugin>
@@ -82,7 +82,7 @@
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>config-api</artifactId>
-            <version>0.2.2-SNAPSHOT</version>
+            <version>0.2.3-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
index 2b632b4..a20491b 100644 (file)
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>config-manager</artifactId>
-      <version>0.2.2-SNAPSHOT</version>
+      <version>0.2.3-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller.model</groupId>
index 74dd1a9..f92d86a 100644 (file)
@@ -55,7 +55,7 @@
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>config-api</artifactId>
-            <version>0.2.2-SNAPSHOT</version>
+            <version>0.2.3-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
index 57e4d85..59ec7a7 100644 (file)
@@ -7,7 +7,7 @@
         <version>1.0-SNAPSHOT</version>
     </parent>
     <properties>
-        <netconf.version>0.2.2-SNAPSHOT</netconf.version>
+        <netconf.version>0.2.3-SNAPSHOT</netconf.version>
     </properties>
     <artifactId>sal-netconf-connector</artifactId>
     <scm>
@@ -33,7 +33,7 @@
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>netconf-client</artifactId>
-            <version>0.2.2-SNAPSHOT</version>
+            <version>${netconf.version}</version>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
index f66bfd4..6f53bcd 100644 (file)
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>config-manager</artifactId>
-            <version>0.2.2-SNAPSHOT</version>
+            <version>0.2.3-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>equinoxSDK381</groupId>
index 989bd9e..74c08e3 100755 (executable)
@@ -5,7 +5,7 @@
     <parent>
         <artifactId>netconf-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
     <artifactId>config-netconf-connector</artifactId>
     <name>${project.artifactId}</name>
index fe2fc1c..d404a96 100644 (file)
@@ -441,8 +441,6 @@ public class NetconfMappingTest extends AbstractConfigTest {
 
         Element response = get();
 
-        System.err.println(XmlUtil.toString(response));
-
         assertEquals(2, getElementsSize(response, "instance"));
         assertEquals(2, getElementsSize(response, "asdf"));
         assertEquals(5, getElementsSize(response, "inner-running-data"));
index 603f40b..85592e5 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <artifactId>netconf-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
     <artifactId>config-persister-impl</artifactId>
     <name>${project.artifactId}</name>
@@ -72,7 +72,6 @@
                             javax.management,
                             javax.xml.parsers,
                             org.opendaylight.controller.config.persist.api,
-                            org.opendaylight.controller.config.stat,
                             org.opendaylight.controller.config.persist.api.storage,
                             org.opendaylight.controller.netconf.api,
                             org.opendaylight.controller.netconf.api.jmx,
index 08b0d1a..cd60431 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.controller.netconf.persist.impl;
 
 import com.google.common.base.Optional;
 import org.opendaylight.controller.config.persist.api.storage.StorageAdapter;
-import org.opendaylight.controller.config.stat.ConfigProvider;
+import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -20,8 +20,8 @@ public class NoOpStorageAdapter implements StorageAdapter {
     private static final Logger logger = LoggerFactory.getLogger(NoOpStorageAdapter.class);
 
     @Override
-    public void setProperties(ConfigProvider configProvider) {
-        logger.debug("setProperties called with {}", configProvider);
+    public void setProperties(BundleContext bundleContext) {
+        logger.debug("setProperties called with {}", bundleContext);
     }
 
     @Override
index 03892f0..e06968e 100644 (file)
@@ -12,7 +12,7 @@ import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
 import org.opendaylight.controller.config.persist.api.Persister;
 import org.opendaylight.controller.config.persist.api.storage.StorageAdapter;
-import org.opendaylight.controller.config.stat.ConfigProvider;
+import org.osgi.framework.BundleContext;
 
 import java.io.IOException;
 
@@ -36,8 +36,8 @@ public final class PersisterImpl implements Persister {
         this.storage = storage;
     }
 
-    public static Optional<PersisterImpl> createFromProperties(ConfigProvider configProvider) {
-        String storageAdapterClass = configProvider.getProperty(STORAGE_ADAPTER_CLASS_PROP);
+    public static Optional<PersisterImpl> createFromProperties(BundleContext bundleContext) {
+        String storageAdapterClass = bundleContext.getProperty(STORAGE_ADAPTER_CLASS_PROP);
         StorageAdapter storage;
         if (storageAdapterClass == null || storageAdapterClass.equals("")) {
             return Optional.absent();
@@ -45,7 +45,7 @@ public final class PersisterImpl implements Persister {
 
         try {
             storage = StorageAdapter.class.cast(resolveClass(storageAdapterClass, StorageAdapter.class).newInstance());
-            storage.setProperties(configProvider);
+            storage.setProperties(bundleContext);
 
         } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
             throw new IllegalArgumentException("Unable to instantiate storage adapter from " + storageAdapterClass, e);
index cf1b0af..ae6c953 100644 (file)
@@ -12,7 +12,6 @@ import com.google.common.base.Optional;
 import org.opendaylight.controller.netconf.persist.impl.ConfigPersisterNotificationHandler;
 import org.opendaylight.controller.netconf.persist.impl.NoOpStorageAdapter;
 import org.opendaylight.controller.netconf.persist.impl.PersisterImpl;
-import org.opendaylight.controller.config.stat.ConfigProvider;
 import org.opendaylight.controller.netconf.util.osgi.NetconfConfigUtil;
 import org.opendaylight.controller.netconf.util.osgi.NetconfConfigUtil.TLSConfiguration;
 import org.osgi.framework.BundleActivator;
@@ -38,16 +37,15 @@ public class ConfigPersisterActivator implements BundleActivator {
     public void start(BundleContext context) throws Exception {
         logger.debug("ConfigPersister activator started");
 
-        ConfigProvider configProvider = new ConfigProvider.ConfigProviderImpl(context);
-        Optional<PersisterImpl> maybePersister = PersisterImpl.createFromProperties(configProvider);
+        Optional<PersisterImpl> maybePersister = PersisterImpl.createFromProperties(context);
         if (maybePersister.isPresent() == false) {
             throw new IllegalStateException("No persister is defined in " + PersisterImpl.STORAGE_ADAPTER_CLASS_PROP
                     + " property. For noop persister use " + NoOpStorageAdapter.class.getCanonicalName()
                     + " . Persister is not operational");
         }
 
-        Optional<TLSConfiguration> maybeTLSConfiguration = NetconfConfigUtil.extractTLSConfiguration(configProvider);
-        Optional<InetSocketAddress> maybeTCPAddress = NetconfConfigUtil.extractTCPNetconfAddress(configProvider);
+        Optional<TLSConfiguration> maybeTLSConfiguration = NetconfConfigUtil.extractTLSConfiguration(context);
+        Optional<InetSocketAddress> maybeTCPAddress = NetconfConfigUtil.extractTCPNetconfAddress(context);
 
         InetSocketAddress address;
         if (maybeTLSConfiguration.isPresent()) {
index df6b1db..44b3b61 100644 (file)
@@ -16,7 +16,7 @@ import org.mockito.MockitoAnnotations;
 import org.opendaylight.controller.config.persist.api.Persister;
 import org.opendaylight.controller.config.persist.api.storage.StorageAdapter;
 import org.opendaylight.controller.config.persist.storage.file.FileStorageAdapter;
-import org.opendaylight.controller.config.stat.ConfigProvider;
+import org.osgi.framework.BundleContext;
 
 import java.io.File;
 import java.io.IOException;
@@ -34,7 +34,7 @@ import static org.mockito.Mockito.verify;
 
 public class PersisterImplTest {
     @Mock
-    ConfigProvider mockedConfigProvider;
+    BundleContext mockedContext;
 
     @Before
     public void setUpMocks() {
@@ -43,10 +43,10 @@ public class PersisterImplTest {
 
     @Test
     public void testFromProperties() throws Exception {
-        doReturn(MockAdapter.class.getName()).when(mockedConfigProvider).getProperty(
+        doReturn(MockAdapter.class.getName()).when(mockedContext).getProperty(
                 PersisterImpl.STORAGE_ADAPTER_CLASS_PROP);
 
-        PersisterImpl persisterImpl = PersisterImpl.createFromProperties(mockedConfigProvider).get();
+        PersisterImpl persisterImpl = PersisterImpl.createFromProperties(mockedContext).get();
         persisterImpl.persistConfig(null);
         persisterImpl.loadLastConfig();
         persisterImpl.persistConfig(null);
@@ -59,29 +59,29 @@ public class PersisterImplTest {
 
     @Test
     public void testFromProperties2() throws Exception {
-        mockedConfigProvider = mock(ConfigProvider.class);
-        doReturn(FileStorageAdapter.class.getName()).when(mockedConfigProvider).getProperty(
+        mockedContext = mock(BundleContext.class);
+        doReturn(FileStorageAdapter.class.getName()).when(mockedContext).getProperty(
                 PersisterImpl.STORAGE_ADAPTER_CLASS_PROP);
         doReturn("target" + File.separator + "generated-test-sources" + File.separator + "testFile").when(
-                mockedConfigProvider).getProperty(FileStorageAdapter.FILE_STORAGE_PROP);
-        doReturn("mockedConfigProvider").when(mockedConfigProvider).toString();
-        doReturn(null).when(mockedConfigProvider).getProperty("numberOfBackups");
+                mockedContext).getProperty(FileStorageAdapter.FILE_STORAGE_PROP);
+        doReturn("mockedContext").when(mockedContext).toString();
+        doReturn(null).when(mockedContext).getProperty("numberOfBackups");
 
-        PersisterImpl persisterImpl = PersisterImpl.createFromProperties(mockedConfigProvider).get();
+        PersisterImpl persisterImpl = PersisterImpl.createFromProperties(mockedContext).get();
         assertTrue(persisterImpl.getStorage() instanceof FileStorageAdapter);
     }
 
     @Test
     public void testFromProperties3() throws Exception {
-        mockedConfigProvider = mock(ConfigProvider.class);
-        doReturn(FileStorageAdapter.class.getName()).when(mockedConfigProvider).getProperty(
+        mockedContext = mock(BundleContext.class);
+        doReturn(FileStorageAdapter.class.getName()).when(mockedContext).getProperty(
                 PersisterImpl.STORAGE_ADAPTER_CLASS_PROP);
         doReturn("target" + File.separator + "generated-test-sources" + File.separator + "testFile").when(
-                mockedConfigProvider).getProperty(FileStorageAdapter.FILE_STORAGE_PROP);
-        doReturn("mockedConfigProvider").when(mockedConfigProvider).toString();
-        doReturn("0").when(mockedConfigProvider).getProperty("numberOfBackups");
+                mockedContext).getProperty(FileStorageAdapter.FILE_STORAGE_PROP);
+        doReturn("mockedContext").when(mockedContext).toString();
+        doReturn("0").when(mockedContext).getProperty("numberOfBackups");
         try {
-            PersisterImpl.createFromProperties(mockedConfigProvider).get();
+            PersisterImpl.createFromProperties(mockedContext).get();
             fail();
         } catch (RuntimeException e) {
             assertThat(
@@ -123,7 +123,7 @@ public class PersisterImplTest {
         static int props = 0;
 
         @Override
-        public void setProperties(ConfigProvider configProvider) {
+        public void setProperties(BundleContext configProvider) {
             props++;
         }
 
index 902cf2a..0e9b421 100644 (file)
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>netconf-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>netconf-api</artifactId>
index 0864a52..ffd46e8 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <artifactId>netconf-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
     <artifactId>netconf-client</artifactId>
     <name>${project.artifactId}</name>
index 1bd3a78..028e9b4 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <artifactId>netconf-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>netconf-impl</artifactId>
                             org.w3c.dom,
                             org.xml.sax,
                             org.opendaylight.controller.netconf.util.messages,
-                            org.opendaylight.controller.config.stat,
                             com.siemens.ct.exi.exceptions
                         </Import-Package>
                     </instructions>
index 824518a..fc240f9 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.netconf.impl.osgi;
 
 import com.google.common.base.Optional;
 import io.netty.util.HashedWheelTimer;
-import org.opendaylight.controller.config.stat.ConfigProvider;
 import org.opendaylight.controller.netconf.impl.DefaultCommitNotificationProducer;
 import org.opendaylight.controller.netconf.impl.NetconfServerDispatcher;
 import org.opendaylight.controller.netconf.impl.NetconfServerSessionListenerFactory;
@@ -39,9 +38,8 @@ public class NetconfImplActivator implements BundleActivator {
 
     @Override
     public void start(final BundleContext context) throws Exception {
-        final ConfigProvider configProvider = new ConfigProvider.ConfigProviderImpl(context);
-        maybeTCPAddress = NetconfConfigUtil.extractTCPNetconfAddress(configProvider);
-        maybeTLSConfiguration = NetconfConfigUtil.extractTLSConfiguration(configProvider);
+        maybeTCPAddress = NetconfConfigUtil.extractTCPNetconfAddress(context);
+        maybeTLSConfiguration = NetconfConfigUtil.extractTLSConfiguration(context);
         if (maybeTCPAddress.isPresent() == false && maybeTLSConfiguration.isPresent() == false) {
             throw new IllegalStateException("TCP nor TLS is configured, netconf not available.");
         }
index 6facfa8..8606421 100644 (file)
@@ -7,7 +7,7 @@
     <parent>
         <artifactId>netconf-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
 
     <artifactId>netconf-it</artifactId>
index 9fb8206..d7775d1 100644 (file)
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>netconf-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>netconf-mapping-api</artifactId>
index 4638a10..c19506b 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <artifactId>netconf-subsystem</artifactId>
         <groupId>org.opendaylight.controller</groupId>
-        <version>0.2.2-SNAPSHOT</version>
+        <version>0.2.3-SNAPSHOT</version>
     </parent>
     <artifactId>netconf-util</artifactId>
     <name>${project.artifactId}</name>
@@ -78,7 +78,6 @@
                             org.opendaylight.controller.netconf.util.handler,
                         </Export-Package>
                         <Import-Package>
-                            org.opendaylight.controller.config.stat,
                             com.google.common.base,
                             com.google.common.collect,
                             ch.ethz.ssh2,
index 54041e6..7606839 100644 (file)
@@ -8,21 +8,19 @@
 
 package org.opendaylight.controller.netconf.util.osgi;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
+import com.google.common.base.Optional;
+import org.opendaylight.protocol.util.SSLUtil;
+import org.osgi.framework.BundleContext;
 
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
 import java.net.InetSocketAddress;
 
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContext;
-
-import org.opendaylight.controller.config.stat.ConfigProvider;
-import org.opendaylight.protocol.util.SSLUtil;
-
-import com.google.common.base.Optional;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
 
 public class NetconfConfigUtil {
     private static final String PREFIX_PROP = "netconf.";
@@ -37,19 +35,19 @@ public class NetconfConfigUtil {
     private static final String NETCONF_TLS_KEYSTORE_PROP = PREFIX_PROP + InfixProp.tls + ".keystore";
     private static final String NETCONF_TLS_KEYSTORE_PASSWORD_PROP = NETCONF_TLS_KEYSTORE_PROP + ".password";
 
-    public static Optional<InetSocketAddress> extractTCPNetconfAddress(ConfigProvider configProvider) {
-        return extractSomeNetconfAddress(configProvider, InfixProp.tcp);
+    public static Optional<InetSocketAddress> extractTCPNetconfAddress(BundleContext context) {
+        return extractSomeNetconfAddress(context, InfixProp.tcp);
     }
 
-    public static Optional<TLSConfiguration> extractTLSConfiguration(ConfigProvider configProvider) {
-        Optional<InetSocketAddress> address = extractSomeNetconfAddress(configProvider, InfixProp.tls);
+    public static Optional<TLSConfiguration> extractTLSConfiguration(BundleContext context) {
+        Optional<InetSocketAddress> address = extractSomeNetconfAddress(context, InfixProp.tls);
         if (address.isPresent()) {
-            String keystoreFileName = configProvider.getProperty(NETCONF_TLS_KEYSTORE_PROP);
+            String keystoreFileName = context.getProperty(NETCONF_TLS_KEYSTORE_PROP);
             File keystoreFile = new File(keystoreFileName);
             checkState(keystoreFile.exists() && keystoreFile.isFile() && keystoreFile.canRead(),
                     "Keystore file %s does not exist or is not readable file", keystoreFileName);
             keystoreFile = keystoreFile.getAbsoluteFile();
-            String keystorePassword = configProvider.getProperty(NETCONF_TLS_KEYSTORE_PASSWORD_PROP);
+            String keystorePassword = context.getProperty(NETCONF_TLS_KEYSTORE_PASSWORD_PROP);
             checkNotNull(keystoreFileName, "Property %s must be defined for tls netconf server",
                     NETCONF_TLS_KEYSTORE_PROP);
             keystorePassword = keystorePassword != null ? keystorePassword : "";
@@ -98,7 +96,7 @@ public class NetconfConfigUtil {
     }
 
     /**
-     * @param configProvider
+     * @param context
      *            from which properties are being read.
      * @param infixProp
      *            either tcp or tls
@@ -107,14 +105,14 @@ public class NetconfConfigUtil {
      * @throws IllegalStateException
      *             if address or port are invalid
      */
-    private static Optional<InetSocketAddress> extractSomeNetconfAddress(ConfigProvider configProvider,
+    private static Optional<InetSocketAddress> extractSomeNetconfAddress(BundleContext context,
             InfixProp infixProp) {
-        String address = configProvider.getProperty(PREFIX_PROP + infixProp + ADDRESS_SUFFIX_PROP);
+        String address = context.getProperty(PREFIX_PROP + infixProp + ADDRESS_SUFFIX_PROP);
         if (address == null) {
             return Optional.absent();
         }
         String portKey = PREFIX_PROP + infixProp + PORT_SUFFIX_PROP;
-        String portString = configProvider.getProperty(portKey);
+        String portString = context.getProperty(portKey);
         checkNotNull(portString, "Netconf port must be specified in properties file with " + portKey);
         try {
             int port = Integer.valueOf(portString);
index 5efff5d..b22732e 100644 (file)
@@ -9,7 +9,7 @@
         <relativePath>../commons/opendaylight</relativePath>
     </parent>
 
-    <version>0.2.2-SNAPSHOT</version>
+    <version>0.2.3-SNAPSHOT</version>
     <artifactId>netconf-subsystem</artifactId>
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>