diff options
author | amitjai <amitjai@amdocs.com> | 2018-04-27 13:28:57 +0530 |
---|---|---|
committer | Oren Kleks <orenkle@amdocs.com> | 2018-04-30 06:05:27 +0000 |
commit | 42c920baf4dbb9fe8775843a6d4c9f70fa29f064 (patch) | |
tree | ac2aff977e2b129e61d2166c4832842676e4f5c3 /common/onap-common-configuration-management/onap-configuration-management-api/src/main/java/org/onap/config/api/ConfigurationManager.java | |
parent | f487427a32f410ab5c97a4092865d32beb88ee27 (diff) |
Rename packages from openecomp to onap.
This task is all about package name space change also make changes to pom for common module
Change-Id: Ie9bda0f958a9a05826c0374830cc9cb7d6d196b6
Issue-ID: SDC-1272
Signed-off-by: amitjai <amitjai@amdocs.com>
Diffstat (limited to 'common/onap-common-configuration-management/onap-configuration-management-api/src/main/java/org/onap/config/api/ConfigurationManager.java')
-rw-r--r-- | common/onap-common-configuration-management/onap-configuration-management-api/src/main/java/org/onap/config/api/ConfigurationManager.java | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/common/onap-common-configuration-management/onap-configuration-management-api/src/main/java/org/onap/config/api/ConfigurationManager.java b/common/onap-common-configuration-management/onap-configuration-management-api/src/main/java/org/onap/config/api/ConfigurationManager.java new file mode 100644 index 0000000000..0e8f1409a0 --- /dev/null +++ b/common/onap-common-configuration-management/onap-configuration-management-api/src/main/java/org/onap/config/api/ConfigurationManager.java @@ -0,0 +1,98 @@ +package org.onap.config.api; + + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Proxy; +import java.util.Collection; +import java.util.Map; +import java.util.ServiceLoader; + +/** + * The interface Configuration manager. + */ +public interface ConfigurationManager extends Configuration { + + /** + * The constant config. + */ + public static final Configuration config = lookup(); + + /** + * Lookup configuration. + * + * @return the configuration + */ + public static Configuration lookup() { + if (config == null) { + ServiceLoader<ConfigurationManager> loader = ServiceLoader.load(ConfigurationManager.class); + for (ConfigurationManager configuration : loader) { + return (Configuration) Proxy.newProxyInstance(ConfigurationManager.class.getClassLoader(), + new Class[]{Configuration.class}, (object, method, args) -> { + try { + return method.invoke(configuration, args); + } catch (InvocationTargetException ite) { + throw ite.getTargetException(); + } + }); + } + } + return config; + } + + /** + * Gets configuration value. + * + * @param queryData the query data + * @return the configuration value + */ + public String getConfigurationValue(Map<String, Object> queryData); + + /** + * Update configuration value. + * + * @param updateData the update data + */ + public void updateConfigurationValue(Map<String, Object> updateData); + + /** + * List configuration map. + * + * @param query the query + * @return the map + */ + public Map<String, String> listConfiguration(Map<String, Object> query); + + /** + * Update configuration values boolean. + * + * @param tenant the tenant + * @param namespace the namespace + * @param configKeyValueStore the config key value store + * @return the boolean + */ + public boolean updateConfigurationValues(String tenant, String namespace, + Map configKeyValueStore); + + /** + * Gets tenants. + * + * @return the tenants + */ + public Collection<String> getTenants(); + + /** + * Gets namespaces. + * + * @return the namespaces + */ + public Collection<String> getNamespaces(); + + /** + * Gets keys. + * + * @param tenant the tenant + * @param namespace the namespace + * @return the keys + */ + public Collection<String> getKeys(String tenant, String namespace); +} |