summaryrefslogtreecommitdiffstats
path: root/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java
diff options
context:
space:
mode:
authorvempo <vitaliy.emporopulo@amdocs.com>2018-10-28 14:45:46 +0200
committervempo <vitaliy.emporopulo@amdocs.com>2018-10-28 14:45:46 +0200
commit2074ab2e8b4416126542c09205d3ca6646ed6718 (patch)
treeab4e013ce2d30d8e87221b58d673b6525d952dd9 /common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java
parent313e73a58a9a01bbceb007b6de617fda521bdd6e (diff)
Removed support of dynamic configuration
Configuration framework will not poll configuration for changes, and will not notify client code of them. Also minor cleanup, added unit tests. Change-Id: I428b23f7acb13c6610390f46aae6e011d6b0ee80 Issue-ID: SDC-1867 Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java')
-rw-r--r--common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java59
1 files changed, 3 insertions, 56 deletions
diff --git a/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java b/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java
index 58720fc76d..af5ae04104 100644
--- a/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java
+++ b/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java
@@ -34,7 +34,6 @@ import org.onap.config.ConfigurationUtils;
import org.onap.config.Constants;
import org.onap.config.NonConfigResource;
import org.onap.config.api.Config;
-import org.onap.config.api.ConfigurationChangeListener;
import org.onap.config.api.Hint;
public class ConfigurationImpl implements org.onap.config.api.Configuration {
@@ -44,8 +43,6 @@ public class ConfigurationImpl implements org.onap.config.api.Configuration {
private static boolean instantiated = false;
- ConfigurationChangeNotifier changeNotifier;
-
public ConfigurationImpl() throws Exception {
if (instantiated || !CliConfigurationImpl.class.isAssignableFrom(this.getClass())) {
throw new RuntimeException("Illegal access to configuration.");
@@ -126,15 +123,14 @@ public class ConfigurationImpl implements org.onap.config.api.Configuration {
}
}
instantiated = true;
- changeNotifier = new ConfigurationChangeNotifier(moduleConfigStore);
}
private void populateFinalConfigurationIncrementally(Map<String, AggregateConfiguration> configs) {
- if (configs.get(Constants.DEFAULT_TENANT + Constants.KEY_ELEMENTS_DELIMETER + Constants.DB_NAMESPACE) != null) {
+ if (configs.get(Constants.DEFAULT_TENANT + Constants.KEY_ELEMENTS_DELIMITER + Constants.DB_NAMESPACE) != null) {
ConfigurationRepository.lookup().populateConfiguration(
- Constants.DEFAULT_TENANT + Constants.KEY_ELEMENTS_DELIMETER + Constants.DB_NAMESPACE,
- configs.remove(Constants.DEFAULT_TENANT + Constants.KEY_ELEMENTS_DELIMETER + Constants.DB_NAMESPACE)
+ Constants.DEFAULT_TENANT + Constants.KEY_ELEMENTS_DELIMITER + Constants.DB_NAMESPACE,
+ configs.remove(Constants.DEFAULT_TENANT + Constants.KEY_ELEMENTS_DELIMITER + Constants.DB_NAMESPACE)
.getFinalConfiguration());
}
@@ -189,43 +185,6 @@ public class ConfigurationImpl implements org.onap.config.api.Configuration {
}
@Override
- public void addConfigurationChangeListener(String tenant, String namespace, String key,
- ConfigurationChangeListener myself) {
- tenant = ConfigurationRepository.lookup().isValidTenant(tenant) ? tenant.toUpperCase()
- : Constants.DEFAULT_TENANT;
- namespace = ConfigurationRepository.lookup().isValidNamespace(namespace) ? namespace.toUpperCase()
- : Constants.DEFAULT_NAMESPACE;
- if (key == null || key.trim().length() == 0) {
- throw new IllegalArgumentException(KEY_CANNOT_BE_NULL);
- }
- if (myself == null) {
- throw new IllegalArgumentException("ConfigurationChangeListener instance is null.");
- }
- try {
- changeNotifier.notifyChangesTowards(tenant, namespace, key, myself);
- } catch (Exception exception) {
- exception.printStackTrace();
- }
- }
-
- @Override
- public void removeConfigurationChangeListener(String tenant, String namespace, String key,
- ConfigurationChangeListener myself) {
- tenant = ConfigurationRepository.lookup().isValidTenant(tenant) ? tenant.toUpperCase()
- : Constants.DEFAULT_TENANT;
- namespace = ConfigurationRepository.lookup().isValidNamespace(namespace) ? namespace.toUpperCase()
- : Constants.DEFAULT_NAMESPACE;
- if (key == null || key.trim().length() == 0) {
- throw new IllegalArgumentException(KEY_CANNOT_BE_NULL);
- }
- try {
- changeNotifier.stopNotificationTowards(tenant, namespace, key, myself);
- } catch (Exception exception) {
- exception.printStackTrace();
- }
- }
-
- @Override
public <T> Map<String, T> populateMap(String tenantId, String namespace, String key, Class<T> clazz) {
if (tenantId == null || tenantId.trim().length() == 0) {
tenantId = tenant.get();
@@ -574,16 +533,4 @@ public class ConfigurationImpl implements org.onap.config.api.Configuration {
}
return collection;
}
-
- public void shutdown() {
- if (changeNotifier != null) {
- try {
- changeNotifier.shutdown();
- } catch (Exception exception) {
- exception.printStackTrace();
- }
- }
- }
-
-
}