diff options
author | Dan Timoney <dtimoney@att.com> | 2021-02-17 15:25:45 -0500 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2021-02-18 16:05:55 -0500 |
commit | 69e393da4cce52a0491fffff2dc81fbe59aeca08 (patch) | |
tree | 404cc750fa69ba2a89c7a2fce921da34db5edda4 /northbound/daexim-offsite-backup/provider/src | |
parent | 56c27daf1656fd6436f8c818c771cf803079e1ea (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 'northbound/daexim-offsite-backup/provider/src')
4 files changed, 8 insertions, 7 deletions
diff --git a/northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java b/northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java index 7ee2a91d7..3d32c7d74 100755 --- a/northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java +++ b/northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java @@ -48,6 +48,7 @@ import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; import javax.annotation.Nonnull; import org.eclipse.jdt.annotation.NonNull; +import org.onap.ccsdk.sli.core.utils.common.EnvProperties; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.mdsal.binding.api.DataTreeChangeListener; import org.opendaylight.mdsal.binding.api.RpcProviderService; @@ -112,7 +113,7 @@ public class DaeximOffsiteBackupProvider implements AutoCloseable, DaeximOffsite private void loadProperties() { LOG.info("Loading properties from " + PROPERTIES_FILE); if(properties == null) - properties = new Properties(); + properties = new EnvProperties(); File propertiesFile = new File(PROPERTIES_FILE); if(!propertiesFile.exists()) { LOG.warn("Properties file (" + PROPERTIES_FILE + ") not found. Using default properties."); diff --git a/northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupUtil.java b/northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupUtil.java index 7adb2fa1b..d53d2fcae 100755 --- a/northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupUtil.java +++ b/northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupUtil.java @@ -33,7 +33,7 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsiteb import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataOutputBuilder; import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; - +import org.onap.ccsdk.sli.core.utils.common.EnvProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,7 +43,7 @@ public class DaeximOffsiteBackupUtil extends MdsalHelper { public static void loadProperties() { File file = new File(PROPERTIES_FILE); - Properties properties = new Properties(); + Properties properties = new EnvProperties(); InputStream input = null; if(file.isFile() && file.canRead()) { try { diff --git a/northbound/daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties b/northbound/daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties index 51efc1f1e..3a0ce3591 100755 --- a/northbound/daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties +++ b/northbound/daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties @@ -20,9 +20,9 @@ # Example properties file daeximDirectory=/opt/opendaylight/current/daexim/ -credentials=admin:enc:YWRtaW4xMjM= +credentials=${ODL_USER}:${ODL_PASSWORD} nexusUrl=http://localhost:8081/nexus/content/repositories/ podName=UNKNOWN_ODL file.operational=odl_backup_operational.json file.models=odl_backup_models.json -file.config=odl_backup_config.json
\ No newline at end of file +file.config=odl_backup_config.json diff --git a/northbound/daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties b/northbound/daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties index b69027906..bb1f28a0c 100755 --- a/northbound/daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties +++ b/northbound/daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties @@ -18,9 +18,9 @@ # ============LICENSE_END========================================================= daeximDirectory=/opt/opendaylight/current/daexim/ -credentials=admin:admin123 +credentials=${ODL_USER}:${ODL_PASSWORD} nexusUrl=http://localhost:8081/nexus/content/repositories/ podName=UNKNOWN_ODL file.operational=odl_backup_operational.json file.models=odl_backup_models.json -file.config=odl_backup_config.json
\ No newline at end of file +file.config=odl_backup_config.json |