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 /adaptors/aai-service/provider/src/main | |
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 'adaptors/aai-service/provider/src/main')
4 files changed, 10 insertions, 7 deletions
diff --git a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java index 9facab82c..b38e75195 100755 --- a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java +++ b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java @@ -53,6 +53,7 @@ import java.util.TreeSet; import org.apache.commons.lang.StringUtils; import org.onap.aai.inventory.v21.GenericVnf; import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; +import org.onap.ccsdk.sli.core.utils.common.EnvProperties; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.FrameworkUtil; @@ -194,7 +195,7 @@ public abstract class AAIRequest { try { Reader reader = new InputStreamReader(in, StandardCharsets.UTF_8); - Properties properties = new Properties(); + Properties properties = new EnvProperties(); properties.load(reader); LOG.info("loaded " + properties.size()); diff --git a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java index 4d51550a3..747688746 100755 --- a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java +++ b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java @@ -81,6 +81,7 @@ import org.onap.ccsdk.sli.core.sli.MetricLogger; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicResource; +import org.onap.ccsdk.sli.core.utils.common.EnvProperties; import org.onap.aai.inventory.v21.GenericVnf; import org.onap.aai.inventory.v21.PhysicalLink; import org.onap.aai.inventory.v21.ResultData; @@ -322,7 +323,7 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe } private static Properties getProperties(URL url) { - Properties properties = new Properties(); + Properties properties = new EnvProperties(); try { properties.load(url.openStream()); } catch (IOException exc) { @@ -491,7 +492,7 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe } InputStream is = null; - Properties props = new Properties(); + Properties props = new EnvProperties(); try { if(LOG.isDebugEnabled()) diff --git a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceProvider.java b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceProvider.java index 743f975b6..edc2e850d 100755 --- a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceProvider.java +++ b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceProvider.java @@ -37,6 +37,7 @@ import org.onap.ccsdk.sli.core.utils.KarafRootFileResolver; import org.onap.ccsdk.sli.core.utils.PropertiesFileResolver; import org.onap.ccsdk.sli.core.utils.common.BundleContextFileResolver; 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.osgi.framework.BundleContext; import org.osgi.framework.FrameworkUtil; @@ -110,7 +111,7 @@ public class AAIServiceProvider implements UtilsProvider { final File propertiesFile = determinePropertiesFile(); if (propertiesFile != null) { try(FileInputStream fileInputStream = new FileInputStream(propertiesFile)) { - properties = new Properties(); + properties = new EnvProperties(); properties.load(fileInputStream); if(properties.containsKey(AAICLIENT_PROPERTY_NAME)) { diff --git a/adaptors/aai-service/provider/src/main/resources/aaiclient.properties b/adaptors/aai-service/provider/src/main/resources/aaiclient.properties index 979537f8e..3fd79d0c9 100755 --- a/adaptors/aai-service/provider/src/main/resources/aaiclient.properties +++ b/adaptors/aai-service/provider/src/main/resources/aaiclient.properties @@ -27,11 +27,11 @@ # Certificate keystore and truststore # org.onap.ccsdk.sli.adaptors.aai.ssl.trust=/opt/onap/ccsdk/data/stores/truststore.onap.client.jks -org.onap.ccsdk.sli.adaptors.aai.ssl.trust.psswd=adminadmin +org.onap.ccsdk.sli.adaptors.aai.ssl.trust.psswd=${AAI_TRUSTSTORE_PASSWORD:-adminadmin}` org.onap.ccsdk.sli.adaptors.aai.host.certificate.ignore=true -org.onap.ccsdk.sli.adaptors.aai.client.name=SDNC -org.onap.ccsdk.sli.adaptors.aai.client.psswd=SDNC +org.onap.ccsdk.sli.adaptors.aai.client.name=${AAI_CLIENT_NAME:-SDNC} +org.onap.ccsdk.sli.adaptors.aai.client.psswd=${AAI_CLIENT_PASSWORD:-SDNC} org.onap.ccsdk.sli.adaptors.aai.application=CCSDK # |