aboutsummaryrefslogtreecommitdiffstats
path: root/common/openecomp-common-configuration-management/openecomp-configuration-management-api/src/main/java/org/openecomp/config/api/ConfigurationManager.java
diff options
context:
space:
mode:
authorAviZi <avi.ziv@amdocs.com>2017-06-09 02:39:56 +0300
committerAviZi <avi.ziv@amdocs.com>2017-06-09 02:39:56 +0300
commit280f8015d06af1f41a3ef12e8300801c7a5e0d54 (patch)
tree9c1d3978c04cd28068f02073038c936bb49ca9e0 /common/openecomp-common-configuration-management/openecomp-configuration-management-api/src/main/java/org/openecomp/config/api/ConfigurationManager.java
parentfd3821dad11780d33c5373d74c957c442489945e (diff)
[SDC-29] Amdocs OnBoard 1707 initial commit.
Change-Id: Ie4d12a3f574008b792899b368a0902a8b46b5370 Signed-off-by: AviZi <avi.ziv@amdocs.com>
Diffstat (limited to 'common/openecomp-common-configuration-management/openecomp-configuration-management-api/src/main/java/org/openecomp/config/api/ConfigurationManager.java')
-rw-r--r--common/openecomp-common-configuration-management/openecomp-configuration-management-api/src/main/java/org/openecomp/config/api/ConfigurationManager.java98
1 files changed, 98 insertions, 0 deletions
diff --git a/common/openecomp-common-configuration-management/openecomp-configuration-management-api/src/main/java/org/openecomp/config/api/ConfigurationManager.java b/common/openecomp-common-configuration-management/openecomp-configuration-management-api/src/main/java/org/openecomp/config/api/ConfigurationManager.java
new file mode 100644
index 0000000000..ffa9255f2c
--- /dev/null
+++ b/common/openecomp-common-configuration-management/openecomp-configuration-management-api/src/main/java/org/openecomp/config/api/ConfigurationManager.java
@@ -0,0 +1,98 @@
+package org.openecomp.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);
+}