X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=LogParser%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fxacml%2Fparser%2FParseLog.java;fp=LogParser%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fxacml%2Fparser%2FParseLog.java;h=77aafdf7a3c96ee27bbda4c4428f5db876d7bdb9;hp=f12522af67cfe9e2dd3b240cb4596bfc339be6ec;hb=e29f8129b7f012c1405f5be3bbb853116ce9df97;hpb=5fb8f6c0eb94e6bee6795f2dbdc33bce854f64bc diff --git a/LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java b/LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java index f12522af6..77aafdf7a 100644 --- a/LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java +++ b/LogParser/src/main/java/org/onap/xacml/parser/ParseLog.java @@ -884,11 +884,11 @@ public class ParseLog { setLogFileProperties(splitString); jdbcUrl = config.getProperty("JDBC_URL").replace("'", ""); - jdbcUser = config.getProperty("JDBC_USER"); + jdbcUser = getValue(config.getProperty("JDBC_USER")); jdbcDriver = config.getProperty("JDBC_DRIVER"); PeCryptoUtils.initAesKey(config.getProperty(PROP_AES_KEY)); - jdbcPassword = PeCryptoUtils.decrypt(config.getProperty("JDBC_PASSWORD")); + jdbcPassword = PeCryptoUtils.decrypt(getValue(config.getProperty("JDBC_PASSWORD"))); config.setProperty("javax.persistence.jdbc.password", jdbcPassword); return config; @@ -902,6 +902,13 @@ public class ParseLog { return null; } + private static String getValue(final String value) { + if (value != null && value.matches("[$][{].*[}]$")) { + return System.getenv(value.substring(2, value.length() - 1)); + } + return value; + } + public static Connection getDbConnection() { return dbConnection(jdbcDriver, jdbcUrl, jdbcUser, jdbcPassword); }