summaryrefslogtreecommitdiffstats
path: root/adaptors/sql-resource/provider/src/main
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2021-02-17 15:25:45 -0500
committerDan Timoney <dtimoney@att.com>2021-02-18 16:05:55 -0500
commit69e393da4cce52a0491fffff2dc81fbe59aeca08 (patch)
tree404cc750fa69ba2a89c7a2fce921da34db5edda4 /adaptors/sql-resource/provider/src/main
parent56c27daf1656fd6436f8c818c771cf803079e1ea (diff)
Add new EnvProperties class
Added new class EnvProperties, which extends java.util.Properties and supports property values containing embedded environment variable references. Updated code to use this class to load svclogic.properties, and updated dmaap listener to use that class to load dmaap listener configuration. Issue-ID: SDNC-1482 Signed-off-by: Dan Timoney <dtimoney@att.com> Change-Id: I7538b719631d8c10c27d059aeb4f70ce92760ebd
Diffstat (limited to 'adaptors/sql-resource/provider/src/main')
-rwxr-xr-xadaptors/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourcePropertiesProviderImpl.java5
-rwxr-xr-xadaptors/sql-resource/provider/src/main/resources/sql-resource.properties2
-rw-r--r--adaptors/sql-resource/provider/src/main/resources/svclogic.properties8
3 files changed, 8 insertions, 7 deletions
diff --git a/adaptors/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourcePropertiesProviderImpl.java b/adaptors/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourcePropertiesProviderImpl.java
index 7c9f6f161..f55390c39 100755
--- a/adaptors/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourcePropertiesProviderImpl.java
+++ b/adaptors/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourcePropertiesProviderImpl.java
@@ -33,6 +33,7 @@ import org.onap.ccsdk.sli.core.utils.JREFileResolver;
import org.onap.ccsdk.sli.core.utils.KarafRootFileResolver;
import org.onap.ccsdk.sli.core.utils.PropertiesFileResolver;
import org.onap.ccsdk.sli.core.utils.common.CoreDefaultFileResolver;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.onap.ccsdk.sli.core.utils.common.SdncConfigEnvVarFileResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -89,7 +90,7 @@ public class SqlResourcePropertiesProviderImpl implements SqlResourcePropertiesP
final File propertiesFile = determinePropertiesFile(this);
if (propertiesFile != null) {
try (FileInputStream fileInputStream = new FileInputStream(propertiesFile)) {
- properties = new Properties();
+ properties = new EnvProperties();
properties.load(fileInputStream);
} catch (final IOException e) {
LOG.error("Failed to load properties for file: {}", propertiesFile.toString(),
@@ -101,7 +102,7 @@ public class SqlResourcePropertiesProviderImpl implements SqlResourcePropertiesP
InputStream propStr = getClass().getResourceAsStream("/" + SQLRESOURCE_PROP_FILE_NAME);
if (propStr != null) {
- properties = new Properties();
+ properties = new EnvProperties();
try {
properties.load(propStr);
propStr.close();
diff --git a/adaptors/sql-resource/provider/src/main/resources/sql-resource.properties b/adaptors/sql-resource/provider/src/main/resources/sql-resource.properties
index ac32f7734..0e3714eb6 100755
--- a/adaptors/sql-resource/provider/src/main/resources/sql-resource.properties
+++ b/adaptors/sql-resource/provider/src/main/resources/sql-resource.properties
@@ -19,5 +19,5 @@
# ============LICENSE_END=========================================================
###
-org.openecomp.sdnc.resource.sql.cryptkey=QtfJMKggVk
+org.onap.sdnc.resource.sql.cryptkey=${SQL_CRYPTKEY:-duMmyCrYptkEy}
diff --git a/adaptors/sql-resource/provider/src/main/resources/svclogic.properties b/adaptors/sql-resource/provider/src/main/resources/svclogic.properties
index 18718b869..65f3b2315 100644
--- a/adaptors/sql-resource/provider/src/main/resources/svclogic.properties
+++ b/adaptors/sql-resource/provider/src/main/resources/svclogic.properties
@@ -21,10 +21,10 @@
org.onap.ccsdk.sli.adaptors.dbtype=jdbc
org.onap.ccsdk.sli.adaptors.jdbc.hosts=sdnctldb01,sdnctldb02
-org.onap.ccsdk.sli.adaptors.jdbc.url=jdbc:mysql://DBHOST:3306/sdnctl
-org.onap.ccsdk.sli.adaptors.jdbc.database=sdnctl
-org.onap.ccsdk.sli.adaptors.jdbc.user=sdnctl
-org.onap.ccsdk.sli.adaptors.jdbc.password=gamma
+org.onap.ccsdk.sli.adaptors.jdbc.url=jdbc:mysql://DBHOST:3306/${MYSQL_DATABASE}
+org.onap.ccsdk.sli.adaptors.jdbc.database=${MYSQL_DATABASE}
+org.onap.ccsdk.sli.adaptors.jdbc.user=${MYSQL_USER}
+org.onap.ccsdk.sli.adaptors.jdbc.password=${MYSQL_PASSWORD}
org.onap.ccsdk.sli.adaptors.jdbc.connection.name=sdnctldb01
org.onap.ccsdk.sli.adaptors.jdbc.connection.timeout=50