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:
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();
- }
- }
- }
-
-
}