Add new EnvProperties class 97/117997/4
authorDan Timoney <dtimoney@att.com>
Wed, 17 Feb 2021 20:25:45 +0000 (15:25 -0500)
committerDan Timoney <dtimoney@att.com>
Thu, 18 Feb 2021 21:05:55 +0000 (16:05 -0500)
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

62 files changed:
adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java
adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java
adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceProvider.java
adaptors/aai-service/provider/src/main/resources/aaiclient.properties
adaptors/ansible-adapter/ansible-adapter-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdapterPropertiesProviderImpl.java
adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/MdsalResourcePropertiesProviderImpl.java
adaptors/mdsal-resource/provider/src/main/resources/mdsal-resource.properties
adaptors/mdsal-resource/provider/src/main/resources/svclogic.properties
adaptors/netbox-client/provider/pom.xml
adaptors/netbox-client/provider/src/main/java/org/onap/ccsdk/sli/adaptors/netbox/property/NetboxProperties.java
adaptors/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourcePropertiesProviderImpl.java
adaptors/sql-resource/provider/src/main/resources/sql-resource.properties
adaptors/sql-resource/provider/src/main/resources/svclogic.properties
adaptors/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/ITCaseSqlResource.java
adaptors/sql-resource/provider/src/test/resources/sql-resource.properties
adaptors/sql-resource/provider/src/test/resources/svclogic.properties
core/sli/common/pom.xml
core/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/MessageWriter.java
core/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicStoreFactory.java
core/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/ITCaseSvcLogicParser.java
core/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/TestSvcLogicLoader.java
core/sli/common/src/test/resources/svclogic.properties
core/sli/provider/pom.xml
core/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicPropertiesProviderImpl.java
core/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java
core/sli/provider/src/test/resources/svclogic.properties
core/sliapi/model/swagger/src/main/json/sliapi.json
core/sliapi/model/swagger/src/main/yaml/sliapi.yaml
core/sliapi/provider/pom.xml
core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java
core/sliapi/provider/src/test/resources/svclogic.properties
core/utils/provider/pom.xml
core/utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/common/EnvProperties.java [new file with mode: 0644]
core/utils/provider/src/test/java/org/onap/ccsdk/sli/core/utils/common/EnvPropertiesTest.java [new file with mode: 0644]
core/utils/provider/src/test/resources/svclogic.properties [new file with mode: 0644]
northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java
northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupUtil.java
northbound/daexim-offsite-backup/provider/src/main/resources/daexim-offsite-backup.properties
northbound/daexim-offsite-backup/provider/src/test/resources/daexim-offsite-backup.properties
northbound/dmaap-listener/pom.xml
northbound/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/DmaapListener.java
northbound/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestDmaapListener.java
northbound/dmaap-listener/src/test/resources/dmaap-consumer-1.properties
northbound/dmaap-listener/src/test/resources/dmaap-consumer-a1Adapter-policy-1.properties
northbound/dmaap-listener/src/test/resources/dmaap-consumer-cMNotify-1.properties
northbound/dmaap-listener/src/test/resources/dmaap-consumer-esrsysteminfo.properties
northbound/dmaap-listener/src/test/resources/dmaap-consumer-generic-vnf.properties
northbound/dmaap-listener/src/test/resources/dmaap-consumer-pserver.properties
northbound/lcm/provider/pom.xml
northbound/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java
northbound/lcm/provider/src/test/resources/svclogic.properties
northbound/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java
northbound/ueb-listener/src/test/resources/ueb-listener.properties
plugins/grToolkit/provider/pom.xml
plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java
plugins/grToolkit/provider/src/main/resources/gr-toolkit.properties
plugins/grToolkit/provider/src/test/resources/gr-toolkit.properties
plugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties
plugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties
plugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties
plugins/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java
plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java

index 9facab8..b38e751 100755 (executable)
@@ -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());
 
index 4d51550..7476887 100755 (executable)
@@ -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())
index 743f975..edc2e85 100755 (executable)
@@ -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)) {
index 979537f..3fd79d0 100755 (executable)
 # 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
 #
index 482aaf8..36eec6a 100755 (executable)
@@ -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 AnsibleAdapterPropertiesProviderImpl implements AnsibleAdapterPrope
         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 AnsibleAdapterPropertiesProviderImpl implements AnsibleAdapterPrope
 
             InputStream propStr = getClass().getResourceAsStream("/" + ANSIBLEADAPTER_PROP_FILE_NAME);
             if (propStr != null) {
-                properties = new Properties();
+                properties = new EnvProperties();
                 try {
                     properties.load(propStr);
                     propStr.close();
index e9e006f..eee5f09 100755 (executable)
@@ -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 MdsalResourcePropertiesProviderImpl implements MdsalResourcePropert
         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 MdsalResourcePropertiesProviderImpl implements MdsalResourcePropert
 
             InputStream propStr = getClass().getResourceAsStream("/" + MDSALRESOURCE_PROP_FILE_NAME);
             if (propStr != null) {
-                properties = new Properties();
+                properties = new EnvProperties();
                 try {
                     properties.load(propStr);
                     propStr.close();
index 47c8ebf..4e348b3 100644 (file)
@@ -19,8 +19,8 @@
 # ============LICENSE_END=========================================================
 ###
 
-org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-user=admin
-org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-passwd=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
+org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-user=${ODL_USER:-admin}
+org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-passwd=${ODL_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U}
 org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-host=localhost
 org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-protocol=http
 org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-port=8181
index 0abadc5..2c91a05 100644 (file)
@@ -20,7 +20,7 @@
 ###
 
 org.onap.ccsdk.sli.adaptors.dbtype = jdbc
-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}
index 483e808..93eedd9 100644 (file)
@@ -22,7 +22,7 @@
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
         <version>2.1.1-SNAPSHOT</version>
-        <relativePath/>
+        <relativePath />
     </parent>
 
     <groupId>org.onap.ccsdk.sli.adaptors</groupId>
     <name>ccsdk-sli-adaptors :: netbox-client :: ${project.artifactId}</name>
 
     <dependencyManagement>
-       <dependencies>
-               <dependency>
-  <groupId>org.onap.ccsdk.sli.core</groupId>
-  <artifactId>sli-core-artifacts</artifactId>
-  <version>${project.version}</version>
-  <type>pom</type>
-  <scope>import</scope>
-               </dependency>
-       </dependencies>
+        <dependencies>
+            <dependency>
+                <groupId>org.onap.ccsdk.sli.core</groupId>
+                <artifactId>sli-core-artifacts</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
     </dependencyManagement>
     <dependencies>
 
index 9b4751e..643a2db 100644 (file)
@@ -20,6 +20,8 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
 import java.util.Properties;
+
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkUtil;
@@ -52,7 +54,7 @@ public class NetboxProperties {
     }
 
     private void loadProps() {
-        properties = new Properties();
+        properties = new EnvProperties();
         // Try to load config from dir
         final String ccsdkConfigDir =
             System.getProperty(PROPERTIES_DIR_KEY, DEFAULT_PROPERTIES_DIR) + "/" + NETBOX_PROPERTY_FILE_NAME;
index 7c9f6f1..f55390c 100755 (executable)
@@ -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();
index ac32f77..0e3714e 100755 (executable)
@@ -19,5 +19,5 @@
 # ============LICENSE_END=========================================================
 ###
 
-org.openecomp.sdnc.resource.sql.cryptkey=QtfJMKggVk
+org.onap.sdnc.resource.sql.cryptkey=${SQL_CRYPTKEY:-duMmyCrYptkEy}
 
index 18718b8..65f3b23 100644 (file)
 
 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
index 2863c6c..4bf991e 100755 (executable)
@@ -29,6 +29,7 @@ import java.util.Properties;
 
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -45,7 +46,7 @@ public class ITCaseSqlResource extends TestCase {
        public void testExists() throws Exception {
 
 
-               Properties props = new Properties();
+               Properties props = new EnvProperties();
                InputStream propStr = getClass().getResourceAsStream("/svclogic.properties");
                if (propStr == null) {
                        fail("src/test/resources/svclogic.properties missing");
index ac32f77..0e3714e 100755 (executable)
@@ -19,5 +19,5 @@
 # ============LICENSE_END=========================================================
 ###
 
-org.openecomp.sdnc.resource.sql.cryptkey=QtfJMKggVk
+org.onap.sdnc.resource.sql.cryptkey=${SQL_CRYPTKEY:-duMmyCrYptkEy}
 
index 6504e1a..80c0253 100644 (file)
 org.onap.ccsdk.sli.dbtype=jdbc
 
 org.onap.ccsdk.sli.jdbc.hosts=sdnctldb01
-org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://dbhost:3306/sdnctl
+org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://dbhost:3306/${MYSQL_DATABASE}
 org.onap.ccsdk.sli.jdbc.driver=org.mariadb.jdbc.Driver
-org.onap.ccsdk.sli.jdbc.database=sdnctl
-org.onap.ccsdk.sli.jdbc.user=sdnctl
-org.onap.ccsdk.sli.jdbc.password=gamma
+org.onap.ccsdk.sli.jdbc.database=${MYSQL_DATABASE}
+org.onap.ccsdk.sli.jdbc.user=${MYSQL_USER}
+org.onap.ccsdk.sli.jdbc.password=${MYSQL_PASSWORD}
 org.onap.ccsdk.sli.jdbc.connection.name=sdnctldb01
 org.onap.ccsdk.sli.jdbc.connection.timeout=50
 org.onap.ccsdk.sli.jdbc.request.timeout=100
index 34db310..716bef3 100755 (executable)
@@ -6,7 +6,7 @@
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
         <version>2.1.1-SNAPSHOT</version>
-        <relativePath/>
+        <relativePath />
     </parent>
 
     <groupId>org.onap.ccsdk.sli.core</groupId>
@@ -18,8 +18,8 @@
     <description>The SLI Common package includes common classes used by the various SLI subcomponents, as well as classes used by clients to interface with the service logic interpreter</description>
 
     <properties>
-       <!--  Ignore deprecated classes in coverage counts -->
-       <sonar.coverage.exclusions>**/MessageWriter.java</sonar.coverage.exclusions>
+        <!--  Ignore deprecated classes in coverage counts -->
+        <sonar.coverage.exclusions>**/MessageWriter.java</sonar.coverage.exclusions>
 
     </properties>
 
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <environmentVariables>
+                        <MYSQL_USER>dummyUser</MYSQL_USER>
+                        <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+                        <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+                    </environmentVariables>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <configuration>
+                    <environmentVariables>
+                        <MYSQL_USER>dummyUser</MYSQL_USER>
+                        <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+                        <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+                    </environmentVariables>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 </project>
index 5ededb9..1b9b179 100644 (file)
@@ -30,6 +30,7 @@ import java.util.Date;
 import java.util.Properties;
 import javax.sql.rowset.CachedRowSet;
 import org.onap.ccsdk.sli.core.dblib.DbLibService;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,7 +63,7 @@ public class MessageWriter {
                initialized = true;
 
                // Read properties
-               Properties props = new Properties();
+               Properties props = new EnvProperties();
                String propPath = System.getenv(SVCLOGIC_PROP_VAR);
 
                if (propPath == null) {
index e0eb573..9076901 100644 (file)
@@ -27,6 +27,7 @@ import java.io.InputStream;
 import java.util.Properties;
 import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
 import org.onap.ccsdk.sli.core.utils.PathValidator;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -58,7 +59,7 @@ public class SvcLogicStoreFactory {
 
        public static SvcLogicStore getSvcLogicStore(InputStream inStr) throws SvcLogicException
        {
-               Properties props = new Properties();
+               Properties props = new EnvProperties();
 
                try {
                        props.load(inStr);
index 50eb917..715af9e 100644 (file)
@@ -43,6 +43,7 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -64,7 +65,7 @@ public class ITCaseSvcLogicParser {
 
                InputStream propStr = ITCaseSvcLogicParser.class.getResourceAsStream("/svclogic.properties");
 
-               Properties props = new Properties();
+               Properties props = new EnvProperties();
 
                props.load(propStr);
 
@@ -150,7 +151,7 @@ public class ITCaseSvcLogicParser {
 
         InputStream propStr = ITCaseSvcLogicParser.class.getResourceAsStream("/dblib.properties");
 
-        Properties props = new Properties();
+        Properties props = new EnvProperties();
 
         props.load(propStr);
 
index 2dd83e8..c868c8a 100644 (file)
@@ -7,6 +7,7 @@ import java.io.InputStream;
 import java.net.URL;
 import java.util.Properties;
 import org.junit.Test;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 
 public class TestSvcLogicLoader {
 
@@ -16,7 +17,7 @@ public class TestSvcLogicLoader {
 
         InputStream propStr = ITCaseSvcLogicParser.class.getResourceAsStream("/svclogic.properties");
 
-        Properties props = new Properties();
+        Properties props = new EnvProperties();
 
         props.load(propStr);
 
index 426960f..85818d7 100644 (file)
@@ -20,8 +20,8 @@
 ###
 
 org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:${MYSQL_DATABASE};create=true
 org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
-org.onap.ccsdk.sli.jdbc.database = sdnctl
-org.onap.ccsdk.sli.jdbc.user = test
-org.onap.ccsdk.sli.jdbc.password = test
+org.onap.ccsdk.sli.jdbc.database = ${MYSQL_DATABASE}
+org.onap.ccsdk.sli.jdbc.user = ${MYSQL_USER}
+org.onap.ccsdk.sli.jdbc.password = ${MYSQL_PASSWORD}
index d45b2e0..5f23680 100755 (executable)
@@ -6,7 +6,7 @@
                <groupId>org.onap.ccsdk.parent</groupId>
                <artifactId>binding-parent</artifactId>
                <version>2.1.1-SNAPSHOT</version>
-               <relativePath/>
+               <relativePath />
        </parent>
 
        <groupId>org.onap.ccsdk.sli.core</groupId>
                        <artifactId>mdsal-binding-api</artifactId>
                        <scope>provided</scope>
                </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
-            <artifactId>rfc6991</artifactId>
+               <dependency>
+                       <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+                       <artifactId>rfc6991</artifactId>
                        <scope>provided</scope>
-        </dependency>
+               </dependency>
                <dependency>
                        <groupId>org.opendaylight.bgpcep</groupId>
                        <artifactId>bgp-concepts</artifactId>
                        <scope>provided</scope>
                        <optional>true</optional>
                </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal</groupId>
-            <artifactId>mdsal-dom-api</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal</groupId>
-            <artifactId>yang-binding</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-              <groupId>com.google.code.findbugs</groupId>
-              <artifactId>annotations</artifactId>
-        </dependency>
+               <dependency>
+                       <groupId>org.opendaylight.mdsal</groupId>
+                       <artifactId>mdsal-dom-api</artifactId>
+                       <scope>provided</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.opendaylight.mdsal</groupId>
+                       <artifactId>yang-binding</artifactId>
+                       <scope>provided</scope>
+               </dependency>
+               <dependency>
+                       <groupId>com.google.code.findbugs</groupId>
+                       <artifactId>annotations</artifactId>
+               </dependency>
                <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                                        </execution>
                                </executions>
                        </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-surefire-plugin</artifactId>
+                               <configuration>
+                                       <environmentVariables>
+                                               <MYSQL_USER>dummyUser</MYSQL_USER>
+                                               <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+                                               <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+                                       </environmentVariables>
+                               </configuration>
+                       </plugin>
+                       <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <configuration>
+                    <environmentVariables>
+                        <MYSQL_USER>dummyUser</MYSQL_USER>
+                        <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+                        <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+                    </environmentVariables>
+                </configuration>
+            </plugin>
                </plugins>
        </build>
 </project>
index aad7a5a..40d3056 100644 (file)
@@ -35,6 +35,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;
@@ -69,9 +70,10 @@ public class SvcLogicPropertiesProviderImpl implements SvcLogicPropertiesProvide
        private Vector<PropertiesFileResolver> sliPropertiesFileResolvers = new Vector<>();
 
        /**
-        * The configuration properties for the db connection.
+        * The configuration properties for the db connection.  Use EnvProperties class, which
+        * extends Properties and resolves env variable references in values
         */
-       private Properties properties;
+       private EnvProperties properties;
 
        /**
         * Set up the prioritized list of strategies for resolving dblib properties
@@ -91,7 +93,7 @@ public class SvcLogicPropertiesProviderImpl implements SvcLogicPropertiesProvide
                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(),
@@ -103,7 +105,7 @@ public class SvcLogicPropertiesProviderImpl implements SvcLogicPropertiesProvide
 
                        InputStream propStr = getClass().getResourceAsStream("/" + SVCLOGIC_PROP_FILE_NAME);
                        if (propStr != null) {
-                               properties = new Properties();
+                               properties = new EnvProperties();
                                try {
                                        properties.load(propStr);
                                        propStr.close();
index ad439cd..0258226 100644 (file)
@@ -65,6 +65,7 @@ import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicPropertiesProvider;
 import org.onap.ccsdk.sli.core.sli.provider.base.SwitchNodeExecutor;
 import org.onap.ccsdk.sli.core.sli.provider.base.UpdateNodeExecutor;
 import org.onap.ccsdk.sli.core.sli.provider.base.WhileNodeExecutor;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -106,7 +107,7 @@ public class ITCaseSvcLogicGraphExecutor {
 
         InputStream propStr = ITCaseSvcLogicGraphExecutor.class.getResourceAsStream("/svclogic.properties");
 
-        Properties svcprops = new Properties();
+        Properties svcprops = new EnvProperties();
         svcprops.load(propStr);
 
         SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops);
@@ -152,7 +153,7 @@ public class ITCaseSvcLogicGraphExecutor {
 
             InputStream propStr = getClass().getResourceAsStream("/svclogic.properties");
 
-            Properties svcprops = new Properties();
+            Properties svcprops = new EnvProperties();
             svcprops.load(propStr);
 
 
index 426960f..85818d7 100644 (file)
@@ -20,8 +20,8 @@
 ###
 
 org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:${MYSQL_DATABASE};create=true
 org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
-org.onap.ccsdk.sli.jdbc.database = sdnctl
-org.onap.ccsdk.sli.jdbc.user = test
-org.onap.ccsdk.sli.jdbc.password = test
+org.onap.ccsdk.sli.jdbc.database = ${MYSQL_DATABASE}
+org.onap.ccsdk.sli.jdbc.user = ${MYSQL_USER}
+org.onap.ccsdk.sli.jdbc.password = ${MYSQL_PASSWORD}
index 3848cb5..284defc 100644 (file)
@@ -1 +1 @@
-{"swagger":"2.0","info":{"description":"This module contains a collection of generally useful derived\nYANG data types for Internet addresses and related things.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code.  All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.,Defines API to service logic interpreter,This module contains a collection of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code.  All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.","version":"1.2.0-SNAPSHOT","title":"ietf-inet-types,SLI-API,ietf-yang-types API"},"consumes":["application/json","application/xml"],"produces":["application/json","application/xml"],"paths":{"/config/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/config/SLI-API:test-results/SLI-API:test-result/":{"post":{"description":"creates sli.api.testresults.TestResult","parameters":[{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}}},"/config/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/operational/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}}},"/operational/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}}},"/operations/SLI-API:execute-graph/":{"post":{"tags":["SLI-API"],"parameters":[{"in":"body","name":"sli.api.executegraph.Input.body-param","required":false,"schema":{"properties":{"input":{"originalRef":"#/definitions/sli.api.executegraph.Input","$ref":"#/definitions/sli.api.executegraph.Input"}}}}],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"},"schema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"}},"201":{"description":"No response"}}}},"/operations/SLI-API:healthcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"},"schema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"}},"201":{"description":"No response"}}}},"/operations/SLI-API:vlbcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"},"schema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"}},"201":{"description":"No response"}}}}},"definitions":{"sli.api.ExecuteGraph":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.Healthcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.ModeEnumeration":{"type":"string","enum":["sync","async"]},"sli.api.ParameterSetting":{"type":"object","properties":{"string-value":{"type":"string"},"boolean-value":{"type":"boolean"},"parameter-name":{"type":"string","description":"Parameter name"},"int-value":{"type":"integer","format":"int32"}}},"sli.api.ResponseFields":{"type":"object","properties":{"response-code":{"type":"string"},"response-message":{"type":"string"},"context-memory-json":{"type":"string"},"ack-final-indicator":{"type":"string"}}},"sli.api.TestResults":{"type":"object","properties":{"test-result":{"type":"array","items":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"sli.api.Vlbcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.executegraph.Input":{"type":"object","properties":{"mode":{"originalRef":"#/definitions/sli.api.ModeEnumeration","$ref":"#/definitions/sli.api.ModeEnumeration"},"module-name":{"type":"string"},"sli-parameter":{"type":"array","items":{"originalRef":"#/definitions/sli.api.ParameterSetting","$ref":"#/definitions/sli.api.ParameterSetting"}},"rpc-name":{"type":"string"}}},"sli.api.testresults.TestResult":{"type":"object","properties":{"results":{"type":"array","items":{"type":"string"}},"test-identifier":{"type":"string"}}}}}
\ No newline at end of file
+{"swagger":"2.0","info":{"description":"Defines API to service logic interpreter,This module contains a collection of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code.  All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.,This module contains a collection of generally useful derived\nYANG data types for Internet addresses and related things.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code.  All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.","version":"1.2.0-SNAPSHOT","title":"SLI-API,ietf-yang-types,ietf-inet-types API"},"consumes":["application/json","application/xml"],"produces":["application/json","application/xml"],"paths":{"/config/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/config/SLI-API:test-results/SLI-API:test-result/":{"post":{"description":"creates sli.api.testresults.TestResult","parameters":[{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}}},"/config/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/operational/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}}},"/operational/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}}},"/operations/SLI-API:execute-graph/":{"post":{"tags":["SLI-API"],"parameters":[{"in":"body","name":"sli.api.executegraph.Input.body-param","required":false,"schema":{"properties":{"input":{"originalRef":"#/definitions/sli.api.executegraph.Input","$ref":"#/definitions/sli.api.executegraph.Input"}}}}],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","schema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"},"responseSchema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"}},"201":{"description":"No response"}}}},"/operations/SLI-API:healthcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","schema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"},"responseSchema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"}},"201":{"description":"No response"}}}},"/operations/SLI-API:vlbcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","schema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"},"responseSchema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"}},"201":{"description":"No response"}}}}},"definitions":{"sli.api.ExecuteGraph":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.Healthcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.ModeEnumeration":{"type":"string","enum":["sync","async"]},"sli.api.ParameterSetting":{"type":"object","properties":{"string-value":{"type":"string"},"boolean-value":{"type":"boolean"},"parameter-name":{"type":"string","description":"Parameter name"},"int-value":{"type":"integer","format":"int32"}}},"sli.api.ResponseFields":{"type":"object","properties":{"response-code":{"type":"string"},"response-message":{"type":"string"},"context-memory-json":{"type":"string"},"ack-final-indicator":{"type":"string"}}},"sli.api.TestResults":{"type":"object","properties":{"test-result":{"type":"array","items":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"sli.api.Vlbcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.executegraph.Input":{"type":"object","properties":{"mode":{"originalRef":"#/definitions/sli.api.ModeEnumeration","$ref":"#/definitions/sli.api.ModeEnumeration"},"module-name":{"type":"string"},"sli-parameter":{"type":"array","items":{"originalRef":"#/definitions/sli.api.ParameterSetting","$ref":"#/definitions/sli.api.ParameterSetting"}},"rpc-name":{"type":"string"}}},"sli.api.testresults.TestResult":{"type":"object","properties":{"results":{"type":"array","items":{"type":"string"}},"test-identifier":{"type":"string"}}}}}
\ No newline at end of file
index b97b132..d323e10 100644 (file)
@@ -1,25 +1,25 @@
 ---
 swagger: "2.0"
 info:
-  description: "This module contains a collection of generally useful derived\nYANG\
-    \ data types for Internet addresses and related things.\n\nCopyright (c) 2013\
-    \ IETF Trust and the persons identified as\nauthors of the code.  All rights reserved.\n\
-    \nRedistribution and use in source and binary forms, with or\nwithout modification,\
+  description: "Defines API to service logic interpreter,This module contains a collection\
+    \ of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust\
+    \ and the persons identified as\nauthors of the code.  All rights reserved.\n\n\
+    Redistribution and use in source and binary forms, with or\nwithout modification,\
     \ is permitted pursuant to, and subject\nto the license terms contained in, the\
     \ Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\n\
     Relating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version\
     \ of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal\
-    \ notices.,Defines API to service logic interpreter,This module contains a collection\
-    \ of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust\
-    \ and the persons identified as\nauthors of the code.  All rights reserved.\n\n\
-    Redistribution and use in source and binary forms, with or\nwithout modification,\
+    \ notices.,This module contains a collection of generally useful derived\nYANG\
+    \ data types for Internet addresses and related things.\n\nCopyright (c) 2013\
+    \ IETF Trust and the persons identified as\nauthors of the code.  All rights reserved.\n\
+    \nRedistribution and use in source and binary forms, with or\nwithout modification,\
     \ is permitted pursuant to, and subject\nto the license terms contained in, the\
     \ Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\n\
     Relating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version\
     \ of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal\
     \ notices."
   version: "1.2.0-SNAPSHOT"
-  title: "ietf-inet-types,SLI-API,ietf-yang-types API"
+  title: "SLI-API,ietf-yang-types,ietf-inet-types API"
 consumes:
 - "application/json"
 - "application/xml"
@@ -38,10 +38,10 @@ paths:
           description: "Internal error"
         200:
           description: "sli.api.TestResults"
-          responseSchema:
+          schema:
             originalRef: "#/definitions/sli.api.TestResults"
             $ref: "#/definitions/sli.api.TestResults"
-          schema:
+          responseSchema:
             originalRef: "#/definitions/sli.api.TestResults"
             $ref: "#/definitions/sli.api.TestResults"
     post:
@@ -126,10 +126,10 @@ paths:
           description: "Internal error"
         200:
           description: "sli.api.testresults.TestResult"
-          responseSchema:
+          schema:
             originalRef: "#/definitions/sli.api.testresults.TestResult"
             $ref: "#/definitions/sli.api.testresults.TestResult"
-          schema:
+          responseSchema:
             originalRef: "#/definitions/sli.api.testresults.TestResult"
             $ref: "#/definitions/sli.api.testresults.TestResult"
     post:
@@ -206,10 +206,10 @@ paths:
           description: "Internal error"
         200:
           description: "sli.api.TestResults"
-          responseSchema:
+          schema:
             originalRef: "#/definitions/sli.api.TestResults"
             $ref: "#/definitions/sli.api.TestResults"
-          schema:
+          responseSchema:
             originalRef: "#/definitions/sli.api.TestResults"
             $ref: "#/definitions/sli.api.TestResults"
   /operational/SLI-API:test-results/SLI-API:test-result/{test-identifier}/:
@@ -228,10 +228,10 @@ paths:
           description: "Internal error"
         200:
           description: "sli.api.testresults.TestResult"
-          responseSchema:
+          schema:
             originalRef: "#/definitions/sli.api.testresults.TestResult"
             $ref: "#/definitions/sli.api.testresults.TestResult"
-          schema:
+          responseSchema:
             originalRef: "#/definitions/sli.api.testresults.TestResult"
             $ref: "#/definitions/sli.api.testresults.TestResult"
   /operations/SLI-API:execute-graph/:
@@ -252,10 +252,10 @@ paths:
           description: "Internal error"
         200:
           description: "Correct response"
-          responseSchema:
+          schema:
             originalRef: "#/definitions/sli.api.ExecuteGraph"
             $ref: "#/definitions/sli.api.ExecuteGraph"
-          schema:
+          responseSchema:
             originalRef: "#/definitions/sli.api.ExecuteGraph"
             $ref: "#/definitions/sli.api.ExecuteGraph"
         201:
@@ -270,10 +270,10 @@ paths:
           description: "Internal error"
         200:
           description: "Correct response"
-          responseSchema:
+          schema:
             originalRef: "#/definitions/sli.api.Healthcheck"
             $ref: "#/definitions/sli.api.Healthcheck"
-          schema:
+          responseSchema:
             originalRef: "#/definitions/sli.api.Healthcheck"
             $ref: "#/definitions/sli.api.Healthcheck"
         201:
@@ -288,10 +288,10 @@ paths:
           description: "Internal error"
         200:
           description: "Correct response"
-          responseSchema:
+          schema:
             originalRef: "#/definitions/sli.api.Vlbcheck"
             $ref: "#/definitions/sli.api.Vlbcheck"
-          schema:
+          responseSchema:
             originalRef: "#/definitions/sli.api.Vlbcheck"
             $ref: "#/definitions/sli.api.Vlbcheck"
         201:
index 5bccec9..d22ec58 100755 (executable)
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <environmentVariables>
+                        <MYSQL_USER>dummyUser</MYSQL_USER>
+                        <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+                        <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+                    </environmentVariables>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
index b731423..cd7dd20 100644 (file)
@@ -62,6 +62,7 @@ import org.onap.ccsdk.sli.core.sli.provider.base.SetNodeExecutor;
 import org.onap.ccsdk.sli.core.sli.provider.base.SwitchNodeExecutor;
 import org.onap.ccsdk.sli.core.sli.provider.base.UpdateNodeExecutor;
 import org.onap.ccsdk.sli.core.sli.provider.base.WhileNodeExecutor;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.mdsal.dom.api.DOMDataBroker;
@@ -123,7 +124,7 @@ public class TestSliapiProvider {
 
         // Load svclogic.properties and get a SvcLogicStore
         InputStream propStr = TestSliapiProvider.class.getResourceAsStream("/svclogic.properties");
-        Properties svcprops = new Properties();
+        Properties svcprops = new EnvProperties();
         svcprops.load(propStr);
 
         SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops);
index 426960f..85818d7 100644 (file)
@@ -20,8 +20,8 @@
 ###
 
 org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:${MYSQL_DATABASE};create=true
 org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
-org.onap.ccsdk.sli.jdbc.database = sdnctl
-org.onap.ccsdk.sli.jdbc.user = test
-org.onap.ccsdk.sli.jdbc.password = test
+org.onap.ccsdk.sli.jdbc.database = ${MYSQL_DATABASE}
+org.onap.ccsdk.sli.jdbc.user = ${MYSQL_USER}
+org.onap.ccsdk.sli.jdbc.password = ${MYSQL_PASSWORD}
index e3a805f..a941834 100644 (file)
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <environmentVariables>
+                        <MYSQL_USER>dummyUser</MYSQL_USER>
+                        <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+                        <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+                    </environmentVariables>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/core/utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/common/EnvProperties.java b/core/utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/common/EnvProperties.java
new file mode 100644 (file)
index 0000000..2e9f267
--- /dev/null
@@ -0,0 +1,61 @@
+package org.onap.ccsdk.sli.core.utils.common;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.util.Enumeration;
+import java.util.Properties;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class EnvProperties extends Properties {
+
+    @Override
+    public synchronized void load(Reader reader) throws IOException {
+        super.load(reader);
+        resolveAllValues();
+    }
+
+    @Override
+    public synchronized void load(InputStream inStream) throws IOException {
+        super.load(inStream);
+        resolveAllValues();
+    }
+
+       @Override
+       public synchronized Object setProperty(String key, String value) {
+               return super.setProperty(key, EnvProperties.resolveValue(value));
+       }
+
+    private void resolveAllValues() {
+       Enumeration<?> propNames = propertyNames();
+
+       while (propNames.hasMoreElements()) {
+           String propName = (String) propNames.nextElement();
+           super.setProperty(propName, EnvProperties.resolveValue(getProperty(propName)));
+       }
+       
+    }
+
+    public static String resolveValue(String value) {
+        if (value == null) {
+            return null;
+        }
+
+        Pattern p = Pattern.compile("\\$\\{(\\w+)((?:\\:\\-)([^\\}]*))?\\}");
+        Matcher m = p.matcher(value);
+
+        StringBuffer sb = new StringBuffer();
+        while (m.find()) {
+            String envVarName = null == m.group(1) ? m.group(2) : m.group(1);
+            String envVarDefault = null == m.group(3) ? "" : m.group(3);
+            String envVarValue = System.getenv(envVarName);
+
+            m.appendReplacement(sb,
+                null == envVarValue ? Matcher.quoteReplacement(envVarDefault) : Matcher.quoteReplacement(envVarValue));
+         }
+        m.appendTail(sb);
+        return sb.toString();
+        
+    }
+}
diff --git a/core/utils/provider/src/test/java/org/onap/ccsdk/sli/core/utils/common/EnvPropertiesTest.java b/core/utils/provider/src/test/java/org/onap/ccsdk/sli/core/utils/common/EnvPropertiesTest.java
new file mode 100644 (file)
index 0000000..bee4325
--- /dev/null
@@ -0,0 +1,59 @@
+package org.onap.ccsdk.sli.core.utils.common;
+
+import static org.junit.Assert.*;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Properties;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class EnvPropertiesTest {
+
+    @Test
+    public void loadStreamTest() throws IOException {
+        InputStream testStr = getClass().getResourceAsStream("/svclogic.properties");
+
+        Properties props = new EnvProperties();
+        props.load(testStr);
+        
+        assertEquals("jdbc", props.getProperty("org.onap.ccsdk.sli.dbtype"));
+        String dbUrl = "jdbc:derby:memory:"+System.getenv("MYSQL_DATABASE")+";create=true";
+        assertEquals(dbUrl, props.getProperty("org.onap.ccsdk.sli.jdbc.url"));
+        assertEquals("org.apache.derby.jdbc.EmbeddedDriver", props.getProperty("org.onap.ccsdk.sli.jdbc.driver"));
+        assertEquals(System.getenv("MYSQL_DATABASE"), props.getProperty("org.onap.ccsdk.sli.jdbc.database"));
+        assertEquals(System.getenv("MYSQL_USER"), props.getProperty("org.onap.ccsdk.sli.jdbc.user") );
+        assertEquals(System.getenv("MYSQL_PASSWORD"), props.getProperty("org.onap.ccsdk.sli.jdbc.password"));
+    }
+
+    @Test
+    public void loadReaderTest() throws IOException {
+        InputStream testStr = getClass().getResourceAsStream("/svclogic.properties");
+        BufferedReader testReader = new BufferedReader(new InputStreamReader(testStr));
+
+        Properties props = new EnvProperties();
+        props.load(testReader);
+        
+        assertEquals("jdbc", props.getProperty("org.onap.ccsdk.sli.dbtype"));
+        String dbUrl = "jdbc:derby:memory:"+System.getenv("MYSQL_DATABASE")+";create=true";
+        assertEquals(dbUrl, props.getProperty("org.onap.ccsdk.sli.jdbc.url"));
+        assertEquals("org.apache.derby.jdbc.EmbeddedDriver", props.getProperty("org.onap.ccsdk.sli.jdbc.driver"));
+        assertEquals(System.getenv("MYSQL_DATABASE"), props.getProperty("org.onap.ccsdk.sli.jdbc.database"));
+        assertEquals(System.getenv("MYSQL_USER"), props.getProperty("org.onap.ccsdk.sli.jdbc.user"));
+        assertEquals(System.getenv("MYSQL_PASSWORD"), props.getProperty("org.onap.ccsdk.sli.jdbc.password"));
+    }
+
+    @Test
+    public void setPropertyTest() {
+        Properties props = new EnvProperties();
+
+        props.setProperty("path", "${PATH}");
+        props.setProperty("dummy", "${UNSET_DUMMY:-dummyvalue}");
+        assertEquals(System.getenv("PATH"), props.getProperty("path"));
+        assertEquals("dummyvalue", props.getProperty("dummy"));
+    }
+    
+}
diff --git a/core/utils/provider/src/test/resources/svclogic.properties b/core/utils/provider/src/test/resources/svclogic.properties
new file mode 100644 (file)
index 0000000..0d62389
--- /dev/null
@@ -0,0 +1,27 @@
+###
+# ============LICENSE_START=======================================================
+# ONAP : CCSDK
+# ================================================================================
+# Copyright (C) 2017 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.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+###
+
+org.onap.ccsdk.sli.dbtype = jdbc
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:${MYSQL_DATABASE};create=true
+org.onap.ccsdk.sli.jdbc.driver=${MYSQL_DRIVER:-org.apache.derby.jdbc.EmbeddedDriver}
+org.onap.ccsdk.sli.jdbc.database = ${MYSQL_DATABASE}
+org.onap.ccsdk.sli.jdbc.user = ${MYSQL_USER}
+org.onap.ccsdk.sli.jdbc.password = ${MYSQL_PASSWORD}
index 7ee2a91..3d32c7d 100755 (executable)
@@ -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.");
index 7adb2fa..d53d2fc 100755 (executable)
@@ -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 {
index 51efc1f..3a0ce35 100755 (executable)
@@ -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
index b690279..bb1f28a 100755 (executable)
@@ -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
index 702ad36..0d245a3 100755 (executable)
                     </execution>
                 </executions>
             </plugin>
-
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <environmentVariables>
+                        <DMAAP_USER>test</DMAAP_USER>
+                        <DMAAP_PASSWORD>test</DMAAP_PASSWORD>
+                        <DMAAP_AUTHKEY>ABC123</DMAAP_AUTHKEY>
+                        <ODL_USER>admin</ODL_USER>
+                        <ODL_PASSWORD>admin</ODL_PASSWORD>
+                    </environmentVariables>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 </project>
index 18c00d5..1c10b68 100755 (executable)
@@ -26,6 +26,8 @@ import java.io.FileInputStream;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Properties;
+
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -38,7 +40,7 @@ public class DmaapListener {
 
     public static void main(String[] args) {
 
-        Properties properties = new Properties();
+        Properties properties = new EnvProperties(); // Use EnvProperties to resolve env variables in values
         String propFileName = DMAAP_LISTENER_PROPERTIES;
         String propPath = null;
         String propDir = System.getProperty(SDNC_CONFIG_DIR);
index 943ef02..48eaa69 100644 (file)
@@ -8,6 +8,7 @@ import java.util.Properties;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -24,7 +25,7 @@ public class TestDmaapListener {
 
        @Test
        public void test() {
-               Properties properties = new Properties();
+               Properties properties = new EnvProperties();
                String propFileName = DMAAP_LISTENER_PROPERTIES;
                String propPath = null;
                String propDir = DMAAP_LISTENER_PROPERTIES_DIR;
index ae83ef8..5ec838f 100755 (executable)
@@ -8,10 +8,10 @@ Partner =
 SubContextPath =/
 Protocol =http
 MethodType =GET
-username =test
-password =test
+username =${DMAAP_USER}
+password =${DMAAP_PASSWORD}
 contenttype =application/json
-authKey=ABC123
+authKey=${DMAAP_AUTHKEY}
 authDate=2016-05-10T13:13:50-0700
 host=localhost:3904
 topic=ccsdk-topic
@@ -29,7 +29,7 @@ AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000
 AFT_DME2_EP_READ_TIMEOUT_MS=50000
 sessionstickinessrequired=NO
 DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt
-sdnc.odl.user=admin
-sdnc.odl.password=admin
+sdnc.odl.user=${ODL_USER}
+sdnc.odl.password=${ODL_PASSWORD}
 sdnc.odl.url-base=http://localhost:8282/restconf/operations
 
index edb7c45..63bc442 100644 (file)
@@ -9,10 +9,10 @@ routeOffer=MR1
 SubContextPath =/
 Protocol =http
 MethodType =GET
-username =admin
-password =admin
+username =${DMAAP_USER}
+password =${DMAAP_PASSWORD}
 contenttype =application/json
-authKey=fs20cKwalJ6ry4kX:7Hqm6BDZK47IKxGRkOPFk33qMYs=
+authKey=${DMAAP_AUTHKEY}
 authDate=2019-04-09T04:28:40-05:00
 host=message-router.onap:3904
 topic=A1-P
@@ -30,6 +30,6 @@ AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000
 AFT_DME2_EP_READ_TIMEOUT_MS=50000
 sessionstickinessrequired=NO
 DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt
-sdnc.odl.user=admin
-sdnc.odl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
+sdnc.odl.user=${ODL_USER}
+sdnc.odl.password=${ODL_PASSWORD}
 sdnc.odl.url-base=http://sdnc.onap:8282/restconf/operations
index aae34a2..b399d27 100644 (file)
@@ -9,10 +9,10 @@ routeOffer=MR1
 SubContextPath =/
 Protocol =http
 MethodType =GET
-username =admin
-password =admin
+username =${DMAAP_USER}
+password =${DMAAP_PASSWORD}
 contenttype =application/json
-authKey=fs20cKwalJ6ry4kX:7Hqm6BDZK47IKxGRkOPFk33qMYs=
+authKey=${DMAAP_AUTHKEY}
 authDate=2019-04-09T04:28:40-05:00
 host=message-router.onap:3904
 topic=CM-NOTIFICATION
@@ -30,6 +30,6 @@ AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000
 AFT_DME2_EP_READ_TIMEOUT_MS=50000
 sessionstickinessrequired=NO
 DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt
-sdnc.odl.user=admin
-sdnc.odl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
+sdnc.odl.user=${ODL_USER}
+sdnc.odl.password=${ODL_PASSWORD}
 sdnc.odl.url-base=http://sdnc.onap:8282/restconf/operations
index 9f5cfe7..785d636 100644 (file)
@@ -8,10 +8,10 @@ Partner =
 SubContextPath =/
 Protocol =https
 MethodType =GET
-username =test
-password =test
+username =${DMAAP_USER}
+password =${DMAAP_PASSWORD}
 contenttype =application/json
-authKey=ABC123
+authKey=${DMAAP_AUTHKEY}
 authDate=2016-05-10T13:13:50-0700
 host=localhost:3904
 topic=AAI-EVENT
@@ -29,6 +29,6 @@ AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000
 AFT_DME2_EP_READ_TIMEOUT_MS=50000
 sessionstickinessrequired=NO
 DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt
-sdnc.odl.user=admin
-sdnc.odl.password=admin
+sdnc.odl.user=${ODL_USER}
+sdnc.odl.password=${ODL_PASSWORD}
 sdnc.odl.url-base=http://localhost:8181/restconf/operations
\ No newline at end of file
index 710a7c7..d0e187d 100644 (file)
@@ -8,10 +8,10 @@ Partner =
 SubContextPath =/
 Protocol =https
 MethodType =GET
-username =test
-password =test
+username =${DMAAP_USER}
+password =${DMAAP_PASSWORD}
 contenttype =application/json
-authKey=ABC123
+authKey=${DMAAP_AUTHKEY}
 authDate=2016-05-10T13:13:50-0700
 host=localhost:3904
 topic=AAI-EVENT
@@ -29,6 +29,6 @@ AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000
 AFT_DME2_EP_READ_TIMEOUT_MS=50000
 sessionstickinessrequired=NO
 DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt
-sdnc.odl.user=admin
-sdnc.odl.password=admin
-sdnc.odl.url-base=http://localhost:8181/restconf/operations
\ No newline at end of file
+sdnc.odl.user=${ODL_USER}
+sdnc.odl.password=${ODL_PASSWORD}
+sdnc.odl.url-base=http://localhost:8181/restconf/operations
index 9f5cfe7..2fb525e 100644 (file)
@@ -8,10 +8,10 @@ Partner =
 SubContextPath =/
 Protocol =https
 MethodType =GET
-username =test
-password =test
+username =${DMAAP_USER}
+password =${DMAAP_PASSWORD}
 contenttype =application/json
-authKey=ABC123
+authKey=${DMAAP_AUTHKEY}
 authDate=2016-05-10T13:13:50-0700
 host=localhost:3904
 topic=AAI-EVENT
@@ -29,6 +29,6 @@ AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000
 AFT_DME2_EP_READ_TIMEOUT_MS=50000
 sessionstickinessrequired=NO
 DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt
-sdnc.odl.user=admin
-sdnc.odl.password=admin
-sdnc.odl.url-base=http://localhost:8181/restconf/operations
\ No newline at end of file
+sdnc.odl.user=${ODL_USER}
+sdnc.odl.password=${ODL_PASSWORD}
+sdnc.odl.url-base=http://localhost:8181/restconf/operations
index bd6f762..57c75fe 100755 (executable)
                        <scope>test</scope>
                </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-surefire-plugin</artifactId>
+                               <configuration>
+                                       <environmentVariables>
+                                               <MYSQL_USER>dummyUser</MYSQL_USER>
+                                               <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+                                               <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+                                       </environmentVariables>
+                               </configuration>
+                       </plugin>
+                       <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <configuration>
+                    <environmentVariables>
+                        <MYSQL_USER>dummyUser</MYSQL_USER>
+                        <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+                        <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+                    </environmentVariables>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
index 85325cb..09cf97c 100644 (file)
@@ -20,6 +20,7 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory;
 import org.onap.ccsdk.sli.core.sli.provider.SvcLogicClassResolver;
 import org.onap.ccsdk.sli.core.sli.provider.SvcLogicPropertiesProviderImpl;
 import org.onap.ccsdk.sli.core.sli.provider.SvcLogicServiceImpl;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.mdsal.dom.api.DOMDataBroker;
@@ -134,7 +135,7 @@ public class TestLcmProvider {
 
         // Load svclogic.properties and get a SvcLogicStore
         InputStream propStr = TestLcmProvider.class.getResourceAsStream("/svclogic.properties");
-        Properties svcprops = new Properties();
+        Properties svcprops = new EnvProperties();
         svcprops.load(propStr);
 
         SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops);
index 426960f..85818d7 100644 (file)
@@ -20,8 +20,8 @@
 ###
 
 org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:${MYSQL_DATABASE};create=true
 org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
-org.onap.ccsdk.sli.jdbc.database = sdnctl
-org.onap.ccsdk.sli.jdbc.user = test
-org.onap.ccsdk.sli.jdbc.password = test
+org.onap.ccsdk.sli.jdbc.database = ${MYSQL_DATABASE}
+org.onap.ccsdk.sli.jdbc.user = ${MYSQL_USER}
+org.onap.ccsdk.sli.jdbc.password = ${MYSQL_PASSWORD}
index 0088a14..4efc29b 100644 (file)
@@ -30,6 +30,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Properties;
 
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.onap.sdc.api.consumer.IConfiguration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -119,7 +120,7 @@ public class SdncUebConfiguration implements IConfiguration{
                                                        + propFile);
                }
 
-               Properties props = new Properties();
+               Properties props = new EnvProperties();
                props.load(new FileInputStream(propFile));
 
                asdcAddress = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.asdc-address");
index c017cbd..9cce1a7 100755 (executable)
@@ -2,10 +2,10 @@ org.onap.ccsdk.sli.northbound.uebclient.asdc-address=localhost:1234
 org.onap.ccsdk.sli.northbound.uebclient.consumer-group=ccsdk1
 org.onap.ccsdk.sli.northbound.uebclient.consumer-id=localhost_ccsdk1
 org.onap.ccsdk.sli.northbound.uebclient.environment-name=UNITTEST
-org.onap.ccsdk.sli.northbound.uebclient.password=123456
-org.onap.ccsdk.sli.northbound.uebclient.user=test
-org.onap.ccsdk.sli.northbound.uebclient.sdnc-user=test
-org.onap.ccsdk.sli.northbound.uebclient.sdnc-passwd=test
+org.onap.ccsdk.sli.northbound.uebclient.password=${ASDC_PASSWORD}
+org.onap.ccsdk.sli.northbound.uebclient.user=${ASDC_USER}
+org.onap.ccsdk.sli.northbound.uebclient.sdnc-user=${ODL_USER}
+org.onap.ccsdk.sli.northbound.uebclient.sdnc-passwd=${ODL_PASSWORD}
 org.onap.ccsdk.sli.northbound.uebclient.asdc-api-base-url=http://localhost:8282/restconf/operations/
 org.onap.ccsdk.sli.northbound.uebclient.asdc-api-namespace=org:onap:ccsdk
 org.onap.ccsdk.sli.northbound.uebclient.spool.incoming=src/test/resources/incoming
index 5c77331..b444366 100755 (executable)
                     </instructions>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <environmentVariables>
+                        <ODL_USER>admin</ODL_USER>
+                        <ODL_PASSWORD>admin</ODL_PASSWORD>
+                    </environmentVariables>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <configuration>
+                    <environmentVariables>
+                        <ODL_USER>admin</ODL_USER>
+                        <ODL_PASSWORD>admin</ODL_PASSWORD>
+                    </environmentVariables>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 </project>
index 5a8730b..8da2f09 100755 (executable)
@@ -45,6 +45,7 @@ import org.apache.commons.lang.StringUtils;
 import org.json.JSONArray;
 import org.json.JSONObject;
 import org.onap.ccsdk.sli.core.dblib.DbLibService;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.onap.ccsdk.sli.plugins.grtoolkit.connection.ConnectionManager;
 import org.onap.ccsdk.sli.plugins.grtoolkit.connection.ConnectionResponse;
 import org.onap.ccsdk.sli.plugins.grtoolkit.data.AdminHealth;
@@ -183,7 +184,7 @@ public class GrToolkitProvider implements AutoCloseable, GrToolkitService, DataT
      */
     private void setProperties() {
         log.info("Loading properties from {}", PROPERTIES_FILE);
-        properties = new Properties();
+        properties = new EnvProperties();
         File propertiesFile = new File(PROPERTIES_FILE);
         if(!propertiesFile.exists()) {
             log.warn("setProperties(): Properties file not found.");
index e3463df..bce4062 100755 (executable)
@@ -24,7 +24,7 @@ adm.fqdn=
 adm.healthcheck=/healthcheck
 adm.port.http=8181
 adm.port.ssl=8443
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODL_PASSWORD}
 controller.useSsl=true
 controller.port.http=8181
 controller.port.ssl=8443
index 52b19bf..d3b15e7 100755 (executable)
@@ -24,7 +24,7 @@ adm.fqdn=localhost
 adm.healthcheck=/adm/healthcheck
 adm.port.http=9999
 adm.port.ssl=19999
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODL_PASSWORD}
 controller.useSsl=false
 controller.port.http=9999
 controller.port.ssl=19999
index cc7820e..040f082 100755 (executable)
@@ -23,7 +23,7 @@ adm.fqdn=localhost
 adm.healthcheck=/adm/healthcheck
 adm.port.http=9999
 adm.port.ssl=19999
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODL_PASSWORD}
 controller.useSsl=false
 controller.port.http=9999
 controller.port.ssl=19999
index 54c9af7..f078634 100755 (executable)
@@ -23,7 +23,7 @@ adm.fqdn=localhost
 adm.healthcheck=/adm/healthcheck
 adm.port.http=9999
 adm.port.ssl=19999
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODK_PASSWORD}
 controller.useSsl=false
 controller.port.http=9999
 controller.port.ssl=19999
index cc7820e..040f082 100755 (executable)
@@ -23,7 +23,7 @@ adm.fqdn=localhost
 adm.healthcheck=/adm/healthcheck
 adm.port.http=9999
 adm.port.ssl=19999
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODL_PASSWORD}
 controller.useSsl=false
 controller.port.http=9999
 controller.port.ssl=19999
index b4bc847..d5bf4d1 100644 (file)
@@ -32,6 +32,7 @@ import java.util.Set;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -41,7 +42,7 @@ public class PropertiesNode implements SvcLogicJavaPlugin {
 
     public void readProperties(Map<String, String> paramMap, SvcLogicContext ctx) throws SvcLogicException {
         Parameters param = getParameters(paramMap);
-        Properties prop = new Properties();
+        Properties prop = new EnvProperties();
         try {
             File file = new File(param.fileName);
             try (InputStream in = new FileInputStream(file)) {
@@ -63,14 +64,14 @@ public class PropertiesNode implements SvcLogicJavaPlugin {
                             String name = (String) key;
                             String value = prop.getProperty(name);
                             if (value != null && value.trim().length() > 0) {
-                                ctx.setAttribute(pfx + name, getObfuscatedVal(value.trim()));
+                                ctx.setAttribute(pfx + name, EnvProperties.resolveValue(value.trim()));
                                 log.info("+++ " + pfx + name + ": [" + maskPassword(pfx + name, value) + "]");
                             }
                         }
                     }
                     if (mm != null) {
                         for (Map.Entry<String, String> entry : mm.entrySet()) {
-                            ctx.setAttribute(pfx + entry.getKey(), getObfuscatedVal(entry.getValue()));
+                            ctx.setAttribute(pfx + entry.getKey(), EnvProperties.resolveValue(entry.getValue()));
                             log.info("+++ " + pfx + entry.getKey() + ": ["
                                     + maskPassword(pfx + entry.getKey(), entry.getValue()) + "]");
                         }
@@ -81,7 +82,7 @@ public class PropertiesNode implements SvcLogicJavaPlugin {
                         String name = (String) key;
                         String value = prop.getProperty(name);
                         if (value != null && value.trim().length() > 0) {
-                            ctx.setAttribute(pfx + name, getObfuscatedVal(value.trim()));
+                            ctx.setAttribute(pfx + name, EnvProperties.resolveValue(value.trim()));
                             log.info("+++ " + pfx + name + ": [" + maskPassword(pfx + name, value) + "]");
                         }
                     }
@@ -92,7 +93,8 @@ public class PropertiesNode implements SvcLogicJavaPlugin {
         }
     }
 
-    /* Unobfuscate param value */ 
+    /* Unobfuscate param value 
+     * No longer needed - use EnvProperties.resolveValue instead
     private static String getObfuscatedVal(String paramValue) {
         String resValue = paramValue;
         if (paramValue != null && paramValue.startsWith("${") && paramValue.endsWith("}"))
@@ -110,6 +112,7 @@ public class PropertiesNode implements SvcLogicJavaPlugin {
         }
         return resValue;
     }
+    */
 
     /*
      * Getting extension has to do the following "" --> "" "name" --> "" "name.txt" --> "txt"
index 3d70424..e42dfa4 100755 (executable)
@@ -81,6 +81,7 @@ import org.glassfish.jersey.media.multipart.file.FileDataBodyPart;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
 import org.onap.logging.filter.base.HttpURLConnectionMetricUtil;
 import org.onap.logging.filter.base.MetricLogClientFilter;
 import org.onap.logging.filter.base.ONAPComponents;
@@ -129,7 +130,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
         }
 
         try (FileInputStream in = new FileInputStream(configDir + "/" + UEB_PROPERTIES_FILE_NAME)) {
-            Properties props = new Properties();
+            Properties props = new EnvProperties();
             props.load(in);
             uebServers = props.getProperty("servers");
             log.info("UEB support enabled");