aboutsummaryrefslogtreecommitdiffstats
path: root/ccsdk-app-common/src/main/java/org/onap/ccsdk/dashboard/util/DashboardProperties.java
diff options
context:
space:
mode:
Diffstat (limited to 'ccsdk-app-common/src/main/java/org/onap/ccsdk/dashboard/util/DashboardProperties.java')
-rw-r--r--ccsdk-app-common/src/main/java/org/onap/ccsdk/dashboard/util/DashboardProperties.java78
1 files changed, 65 insertions, 13 deletions
diff --git a/ccsdk-app-common/src/main/java/org/onap/ccsdk/dashboard/util/DashboardProperties.java b/ccsdk-app-common/src/main/java/org/onap/ccsdk/dashboard/util/DashboardProperties.java
index 717be11..a04a76e 100644
--- a/ccsdk-app-common/src/main/java/org/onap/ccsdk/dashboard/util/DashboardProperties.java
+++ b/ccsdk-app-common/src/main/java/org/onap/ccsdk/dashboard/util/DashboardProperties.java
@@ -2,7 +2,7 @@
* =============LICENSE_START=========================================================
*
* =================================================================================
- * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
*
* ECOMP is a trademark and service mark of AT&T Intellectual Property.
*******************************************************************************/
+
package org.onap.ccsdk.dashboard.util;
import org.springframework.beans.factory.annotation.Autowired;
@@ -58,25 +59,67 @@ public class DashboardProperties {
*/
public static final String CONTROLLER_SUBKEY_URL = "url";
/**
+ * Subkey for property with Inventory URL
+ */
+ public static final String CONTROLLER_SUBKEY_INVENTORY_URL = "inventory.url";
+ /**
+ * Subkey for property with Deployment Handler URL
+ */
+ public static final String CONTROLLER_SUBKEY_DHANDLER_URL = "dhandler.url";
+ /**
+ * Subkey for property with Consul URL
+ */
+ public static final String CONTROLLER_SUBKEY_CONSUL_URL = "consul.url";
+ /**
* Subkey for property with Controller user name for authentication
*/
public static final String CONTROLLER_SUBKEY_USERNAME = "username";
/**
* Subkey for property with Controller password
*/
- public static final String CONTROLLER_SUBKEY_PASSWORD = "password";
+ public static final String CONTROLLER_SUBKEY_PASS = "password";
/**
* Subkey for property with Controller password encryption status
*/
public static final String CONTROLLER_SUBKEY_ENCRYPTED = "is_encrypted";
-
- private Environment environment;
-
/**
- * No-arg constructor
+ * Key for dashboard deployment environment - dev/uat/prod
*/
- public DashboardProperties() {
- }
+ public static final String CONTROLLER_IN_ENV = "controller.env";
+
+ /**
+ * Key for cloudify tenant environment
+ */
+ public static final String CLOUDIFY_TENANT_PRIM = "cloudify.tenant.primary";
+
+ /**
+ * Key for aic tenant environment
+ */
+ public static final String AIC_TENANT_PRIM = "aic.tenant.primary";
+
+ /**
+ * Key for controller type: ATT or OS
+ */
+ public static final String CONTROLLER_TYPE = "controller.type";
+
+ /** Key for K8s deploy permission string
+ *
+ */
+ public static final String APP_K8S_PERM = "k8s.deploy.perm";
+
+ public static final String OPS_K8S_URL = "ops.k8s.url";
+
+ public static final String OPS_GRAFANA_URL = "ops.grf.url";
+
+ public static final String OPS_CLOUDIFY_URL = "ops.cfy.url";
+
+ public static final String OPS_CONSUL_URL = "ops.cnsl.url";
+
+ public static final String OPS_PROMETHEUS_URL = "ops.prom.url";
+
+ public static final String OPS_DBCL_URL = "ops.dbcl.url";
+
+ private static Environment environment;
protected Environment getEnvironment() {
return environment;
@@ -96,7 +139,7 @@ public class DashboardProperties {
* Property key
* @return True or false
*/
- public boolean containsProperty(final String key) {
+ public static boolean containsProperty(final String key) {
return environment.containsProperty(key);
}
@@ -105,16 +148,25 @@ public class DashboardProperties {
* Property key
* @return String value; throws unchecked exception if key is not found
*/
- public String getProperty(final String key) {
+ public static String getProperty(final String key) {
return environment.getRequiredProperty(key);
}
/**
* @param key
* Property key
+ * @return String value; throws unchecked exception if key is not found
+ */
+ public static String getPropertyDef(final String key, String defVal) {
+ return environment.getProperty(key, defVal);
+ }
+
+ /**
+ * @param key
+ * Property key
* @return True or False; null if key is not found
*/
- public Boolean getBooleanProperty(final String key) {
+ public static Boolean getBooleanProperty(final String key) {
final String value = getProperty(key);
return Boolean.parseBoolean(value);
}
@@ -128,7 +180,7 @@ public class DashboardProperties {
* @return Array of values with leading and trailing whitespace removed;
* null if key is not found.
*/
- public String[] getCsvListProperty(final String key) {
+ public static String[] getCsvListProperty(final String key) {
String listVal = getProperty(key);
if (listVal == null)
return null;
@@ -146,7 +198,7 @@ public class DashboardProperties {
* Second part of key
* @return Property value for key "controllerKey.propKey"
*/
- public String getControllerProperty(final String controllerKey, final String propKey) {
+ public static String getControllerProperty(final String controllerKey, final String propKey) {
final String key = controllerKey + '.' + propKey;
return getProperty(key);
}