From: Maros Marsalek Date: Fri, 8 Nov 2013 12:15:23 +0000 (+0100) Subject: Bump versions of config-subsystem and netconf-subsystem to 0.2.3-SNAPSHOT. X-Git-Tag: jenkins-controller-bulk-release-prepare-only-2-1~443^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=bd2fdc53c6e7d21febc673b1d7062ca82849eb74 Bump versions of config-subsystem and netconf-subsystem to 0.2.3-SNAPSHOT. Remove ConfigProvider. Change-Id: I6d578f5c3b934456cf37a0893e816cfc8d6340f1 Signed-off-by: Maros Marsalek --- diff --git a/opendaylight/commons/opendaylight/pom.xml b/opendaylight/commons/opendaylight/pom.xml index 862f809df2..f191a291b5 100644 --- a/opendaylight/commons/opendaylight/pom.xml +++ b/opendaylight/commons/opendaylight/pom.xml @@ -76,8 +76,8 @@ 0.6.0-SNAPSHOT 0.4.1-SNAPSHOT - 0.2.2-SNAPSHOT - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT + 0.2.3-SNAPSHOT 1.0-SNAPSHOT 0.5.1-SNAPSHOT 0.6.1-SNAPSHOT diff --git a/opendaylight/config/config-api/pom.xml b/opendaylight/config/config-api/pom.xml index 394831d252..d733834b43 100644 --- a/opendaylight/config/config-api/pom.xml +++ b/opendaylight/config/config-api/pom.xml @@ -6,7 +6,7 @@ config-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT config-api @@ -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, 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 index 3a81061881..0000000000 --- a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/stat/ConfigProvider.java +++ /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. - * - *

- * All bundles must have permission to read properties whose names start - * with "org.osgi.". - * - * @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 + '}'; - } - } - -} diff --git a/opendaylight/config/config-manager/pom.xml b/opendaylight/config/config-manager/pom.xml index 138f5007a7..b55b5da8a2 100644 --- a/opendaylight/config/config-manager/pom.xml +++ b/opendaylight/config/config-manager/pom.xml @@ -4,7 +4,7 @@ config-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT .. config-manager diff --git a/opendaylight/config/config-persister-api/pom.xml b/opendaylight/config/config-persister-api/pom.xml index 504c295639..51f8c0b825 100644 --- a/opendaylight/config/config-persister-api/pom.xml +++ b/opendaylight/config/config-persister-api/pom.xml @@ -4,7 +4,7 @@ config-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT .. config-persister-api @@ -33,7 +33,6 @@ com.google.common.base, org.w3c.dom, org.osgi.framework, - org.opendaylight.controller.config.stat org.opendaylight.controller.config.persist.api, diff --git a/opendaylight/config/config-persister-api/src/main/java/org/opendaylight/controller/config/persist/api/storage/StorageAdapter.java b/opendaylight/config/config-persister-api/src/main/java/org/opendaylight/controller/config/persist/api/storage/StorageAdapter.java index 447504027e..9daf4a1325 100644 --- a/opendaylight/config/config-persister-api/src/main/java/org/opendaylight/controller/config/persist/api/storage/StorageAdapter.java +++ b/opendaylight/config/config-persister-api/src/main/java/org/opendaylight/controller/config/persist/api/storage/StorageAdapter.java @@ -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); } diff --git a/opendaylight/config/config-persister-file-adapter/pom.xml b/opendaylight/config/config-persister-file-adapter/pom.xml index a5c026da27..b243eadcc6 100644 --- a/opendaylight/config/config-persister-file-adapter/pom.xml +++ b/opendaylight/config/config-persister-file-adapter/pom.xml @@ -6,7 +6,7 @@ config-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT .. config-persister-file-adapter @@ -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, diff --git a/opendaylight/config/config-persister-file-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/FileStorageAdapter.java b/opendaylight/config/config-persister-file-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/FileStorageAdapter.java index a866743b0d..775fb1f881 100644 --- a/opendaylight/config/config-persister-file-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/FileStorageAdapter.java +++ b/opendaylight/config/config-persister-file-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/FileStorageAdapter.java @@ -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 { diff --git a/opendaylight/config/config-util/pom.xml b/opendaylight/config/config-util/pom.xml index bf681b1065..206184ccce 100644 --- a/opendaylight/config/config-util/pom.xml +++ b/opendaylight/config/config-util/pom.xml @@ -4,7 +4,7 @@ config-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT .. config-util diff --git a/opendaylight/config/logback-config/pom.xml b/opendaylight/config/logback-config/pom.xml index 9abc8ccb63..b63f3298c1 100644 --- a/opendaylight/config/logback-config/pom.xml +++ b/opendaylight/config/logback-config/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.controller config-subsystem - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT logback-config ${project.artifactId} diff --git a/opendaylight/config/netty-threadgroup-config/pom.xml b/opendaylight/config/netty-threadgroup-config/pom.xml index e1b8fb34da..ef63fce2ce 100644 --- a/opendaylight/config/netty-threadgroup-config/pom.xml +++ b/opendaylight/config/netty-threadgroup-config/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.controller config-subsystem - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT 4.0.0 diff --git a/opendaylight/config/pom.xml b/opendaylight/config/pom.xml index 6cf23e8868..2842b5c450 100755 --- a/opendaylight/config/pom.xml +++ b/opendaylight/config/pom.xml @@ -10,7 +10,7 @@ - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT config-subsystem pom ${project.artifactId} diff --git a/opendaylight/config/threadpool-config-api/pom.xml b/opendaylight/config/threadpool-config-api/pom.xml index 1f8f1ea87e..d8ddc4f24d 100644 --- a/opendaylight/config/threadpool-config-api/pom.xml +++ b/opendaylight/config/threadpool-config-api/pom.xml @@ -3,7 +3,7 @@ org.opendaylight.controller config-subsystem - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT 4.0.0 threadpool-config-api diff --git a/opendaylight/config/threadpool-config-impl/pom.xml b/opendaylight/config/threadpool-config-impl/pom.xml index 12279781a2..e265604d7c 100644 --- a/opendaylight/config/threadpool-config-impl/pom.xml +++ b/opendaylight/config/threadpool-config-impl/pom.xml @@ -3,7 +3,7 @@ org.opendaylight.controller config-subsystem - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT 4.0.0 threadpool-config-impl diff --git a/opendaylight/config/yang-jmx-generator-it/pom.xml b/opendaylight/config/yang-jmx-generator-it/pom.xml index 336d0c3b82..bcec65f2e7 100644 --- a/opendaylight/config/yang-jmx-generator-it/pom.xml +++ b/opendaylight/config/yang-jmx-generator-it/pom.xml @@ -6,7 +6,7 @@ config-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT yang-jmx-generator-it diff --git a/opendaylight/config/yang-jmx-generator-plugin/pom.xml b/opendaylight/config/yang-jmx-generator-plugin/pom.xml index 1d53f58d5c..f06c7bdad8 100644 --- a/opendaylight/config/yang-jmx-generator-plugin/pom.xml +++ b/opendaylight/config/yang-jmx-generator-plugin/pom.xml @@ -4,7 +4,7 @@ config-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT .. yang-jmx-generator-plugin diff --git a/opendaylight/config/yang-jmx-generator/pom.xml b/opendaylight/config/yang-jmx-generator/pom.xml index 37846384bf..cd985714d4 100644 --- a/opendaylight/config/yang-jmx-generator/pom.xml +++ b/opendaylight/config/yang-jmx-generator/pom.xml @@ -6,7 +6,7 @@ config-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT yang-jmx-generator diff --git a/opendaylight/config/yang-store-api/pom.xml b/opendaylight/config/yang-store-api/pom.xml index 6e850b2566..9b103df8d7 100644 --- a/opendaylight/config/yang-store-api/pom.xml +++ b/opendaylight/config/yang-store-api/pom.xml @@ -4,7 +4,7 @@ config-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT .. yang-store-api diff --git a/opendaylight/config/yang-store-impl/pom.xml b/opendaylight/config/yang-store-impl/pom.xml index 07ac4d4bb6..ae59dde26c 100644 --- a/opendaylight/config/yang-store-impl/pom.xml +++ b/opendaylight/config/yang-store-impl/pom.xml @@ -4,7 +4,7 @@ config-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT .. yang-store-impl diff --git a/opendaylight/config/yang-test/pom.xml b/opendaylight/config/yang-test/pom.xml index 3de06882a6..b7540c8787 100644 --- a/opendaylight/config/yang-test/pom.xml +++ b/opendaylight/config/yang-test/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.controller config-subsystem - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT yang-test diff --git a/opendaylight/md-sal/sal-binding-broker/pom.xml b/opendaylight/md-sal/sal-binding-broker/pom.xml index 9ca025b393..b0e2023f1f 100644 --- a/opendaylight/md-sal/sal-binding-broker/pom.xml +++ b/opendaylight/md-sal/sal-binding-broker/pom.xml @@ -47,7 +47,7 @@ org.opendaylight.controller yang-jmx-generator-plugin - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT diff --git a/opendaylight/md-sal/sal-binding-config/pom.xml b/opendaylight/md-sal/sal-binding-config/pom.xml index 6638050ae0..3bc50cdd2e 100644 --- a/opendaylight/md-sal/sal-binding-config/pom.xml +++ b/opendaylight/md-sal/sal-binding-config/pom.xml @@ -52,7 +52,7 @@ org.opendaylight.controller yang-jmx-generator-plugin - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT @@ -82,7 +82,7 @@ org.opendaylight.controller config-api - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT org.opendaylight.controller diff --git a/opendaylight/md-sal/sal-binding-it/pom.xml b/opendaylight/md-sal/sal-binding-it/pom.xml index 2b632b4ab0..a20491b6be 100644 --- a/opendaylight/md-sal/sal-binding-it/pom.xml +++ b/opendaylight/md-sal/sal-binding-it/pom.xml @@ -198,7 +198,7 @@ org.opendaylight.controller config-manager - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT org.opendaylight.controller.model diff --git a/opendaylight/md-sal/sal-dom-broker/pom.xml b/opendaylight/md-sal/sal-dom-broker/pom.xml index 74dd1a9901..f92d86af91 100644 --- a/opendaylight/md-sal/sal-dom-broker/pom.xml +++ b/opendaylight/md-sal/sal-dom-broker/pom.xml @@ -55,7 +55,7 @@ org.opendaylight.controller config-api - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT org.opendaylight.yangtools diff --git a/opendaylight/md-sal/sal-netconf-connector/pom.xml b/opendaylight/md-sal/sal-netconf-connector/pom.xml index 57e4d858c1..59ec7a780b 100644 --- a/opendaylight/md-sal/sal-netconf-connector/pom.xml +++ b/opendaylight/md-sal/sal-netconf-connector/pom.xml @@ -7,7 +7,7 @@ 1.0-SNAPSHOT - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT sal-netconf-connector @@ -33,7 +33,7 @@ org.opendaylight.controller netconf-client - 0.2.2-SNAPSHOT + ${netconf.version} org.opendaylight.yangtools diff --git a/opendaylight/md-sal/samples/toaster-it/pom.xml b/opendaylight/md-sal/samples/toaster-it/pom.xml index f66bfd4b74..6f53bcd2c4 100644 --- a/opendaylight/md-sal/samples/toaster-it/pom.xml +++ b/opendaylight/md-sal/samples/toaster-it/pom.xml @@ -144,7 +144,7 @@ org.opendaylight.controller config-manager - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT equinoxSDK381 diff --git a/opendaylight/netconf/config-netconf-connector/pom.xml b/opendaylight/netconf/config-netconf-connector/pom.xml index 989bd9e676..74c08e379f 100755 --- a/opendaylight/netconf/config-netconf-connector/pom.xml +++ b/opendaylight/netconf/config-netconf-connector/pom.xml @@ -5,7 +5,7 @@ netconf-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT config-netconf-connector ${project.artifactId} diff --git a/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java b/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java index fe2fc1c5da..d404a96468 100644 --- a/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java +++ b/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java @@ -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")); diff --git a/opendaylight/netconf/config-persister-impl/pom.xml b/opendaylight/netconf/config-persister-impl/pom.xml index 603f40b020..85592e5aa2 100644 --- a/opendaylight/netconf/config-persister-impl/pom.xml +++ b/opendaylight/netconf/config-persister-impl/pom.xml @@ -5,7 +5,7 @@ netconf-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT config-persister-impl ${project.artifactId} @@ -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, diff --git a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/NoOpStorageAdapter.java b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/NoOpStorageAdapter.java index 08b0d1a511..cd604312f4 100644 --- a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/NoOpStorageAdapter.java +++ b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/NoOpStorageAdapter.java @@ -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 diff --git a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/PersisterImpl.java b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/PersisterImpl.java index 03892f0da7..e06968e868 100644 --- a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/PersisterImpl.java +++ b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/PersisterImpl.java @@ -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 createFromProperties(ConfigProvider configProvider) { - String storageAdapterClass = configProvider.getProperty(STORAGE_ADAPTER_CLASS_PROP); + public static Optional 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); diff --git a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java index cf1b0af454..ae6c95312c 100644 --- a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java +++ b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java @@ -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 maybePersister = PersisterImpl.createFromProperties(configProvider); + Optional 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 maybeTLSConfiguration = NetconfConfigUtil.extractTLSConfiguration(configProvider); - Optional maybeTCPAddress = NetconfConfigUtil.extractTCPNetconfAddress(configProvider); + Optional maybeTLSConfiguration = NetconfConfigUtil.extractTLSConfiguration(context); + Optional maybeTCPAddress = NetconfConfigUtil.extractTCPNetconfAddress(context); InetSocketAddress address; if (maybeTLSConfiguration.isPresent()) { diff --git a/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/PersisterImplTest.java b/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/PersisterImplTest.java index df6b1db97a..44b3b61043 100644 --- a/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/PersisterImplTest.java +++ b/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/PersisterImplTest.java @@ -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++; } diff --git a/opendaylight/netconf/netconf-api/pom.xml b/opendaylight/netconf/netconf-api/pom.xml index 902cf2a863..0e9b421229 100644 --- a/opendaylight/netconf/netconf-api/pom.xml +++ b/opendaylight/netconf/netconf-api/pom.xml @@ -6,7 +6,7 @@ netconf-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT 4.0.0 netconf-api diff --git a/opendaylight/netconf/netconf-client/pom.xml b/opendaylight/netconf/netconf-client/pom.xml index 0864a52356..ffd46e882c 100644 --- a/opendaylight/netconf/netconf-client/pom.xml +++ b/opendaylight/netconf/netconf-client/pom.xml @@ -5,7 +5,7 @@ netconf-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT netconf-client ${project.artifactId} diff --git a/opendaylight/netconf/netconf-impl/pom.xml b/opendaylight/netconf/netconf-impl/pom.xml index 1bd3a78326..028e9b4bd4 100644 --- a/opendaylight/netconf/netconf-impl/pom.xml +++ b/opendaylight/netconf/netconf-impl/pom.xml @@ -5,7 +5,7 @@ netconf-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT 4.0.0 netconf-impl @@ -126,7 +126,6 @@ org.w3c.dom, org.xml.sax, org.opendaylight.controller.netconf.util.messages, - org.opendaylight.controller.config.stat, com.siemens.ct.exi.exceptions diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivator.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivator.java index 824518a5ef..fc240f91c9 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivator.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivator.java @@ -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."); } diff --git a/opendaylight/netconf/netconf-it/pom.xml b/opendaylight/netconf/netconf-it/pom.xml index 6facfa8fba..8606421ab9 100644 --- a/opendaylight/netconf/netconf-it/pom.xml +++ b/opendaylight/netconf/netconf-it/pom.xml @@ -7,7 +7,7 @@ netconf-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT netconf-it diff --git a/opendaylight/netconf/netconf-mapping-api/pom.xml b/opendaylight/netconf/netconf-mapping-api/pom.xml index 9fb820695a..d7775d156d 100644 --- a/opendaylight/netconf/netconf-mapping-api/pom.xml +++ b/opendaylight/netconf/netconf-mapping-api/pom.xml @@ -6,7 +6,7 @@ netconf-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT 4.0.0 netconf-mapping-api diff --git a/opendaylight/netconf/netconf-util/pom.xml b/opendaylight/netconf/netconf-util/pom.xml index 4638a1009e..c19506b236 100644 --- a/opendaylight/netconf/netconf-util/pom.xml +++ b/opendaylight/netconf/netconf-util/pom.xml @@ -5,7 +5,7 @@ netconf-subsystem org.opendaylight.controller - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT netconf-util ${project.artifactId} @@ -78,7 +78,6 @@ org.opendaylight.controller.netconf.util.handler, - org.opendaylight.controller.config.stat, com.google.common.base, com.google.common.collect, ch.ethz.ssh2, diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/osgi/NetconfConfigUtil.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/osgi/NetconfConfigUtil.java index 54041e6602..76068399c1 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/osgi/NetconfConfigUtil.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/osgi/NetconfConfigUtil.java @@ -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 extractTCPNetconfAddress(ConfigProvider configProvider) { - return extractSomeNetconfAddress(configProvider, InfixProp.tcp); + public static Optional extractTCPNetconfAddress(BundleContext context) { + return extractSomeNetconfAddress(context, InfixProp.tcp); } - public static Optional extractTLSConfiguration(ConfigProvider configProvider) { - Optional address = extractSomeNetconfAddress(configProvider, InfixProp.tls); + public static Optional extractTLSConfiguration(BundleContext context) { + Optional 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 extractSomeNetconfAddress(ConfigProvider configProvider, + private static Optional 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); diff --git a/opendaylight/netconf/pom.xml b/opendaylight/netconf/pom.xml index 5efff5d9a0..b22732e630 100644 --- a/opendaylight/netconf/pom.xml +++ b/opendaylight/netconf/pom.xml @@ -9,7 +9,7 @@ ../commons/opendaylight - 0.2.2-SNAPSHOT + 0.2.3-SNAPSHOT netconf-subsystem pom ${project.artifactId}