summaryrefslogtreecommitdiffstats
path: root/cadi/core/src
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-02-20 17:14:20 -0600
committerInstrumental <jonathan.gathman@att.com>2019-02-20 17:43:50 -0600
commitdd097a4b411cd78ced737548a43e019b1f3172f1 (patch)
treec6c3457ce4e3debef29f4a98b14abbaf7dc01eb1 /cadi/core/src
parent2b46f76d9a688acf326424659ec9672a2614fdcf (diff)
Locator Service link correction
Issue-ID: AAF-667 Change-Id: Ie7443f985c6d8dfb6955419695c58ae3be116afc Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'cadi/core/src')
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java35
1 files changed, 28 insertions, 7 deletions
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java
index 599bb984..461ef43c 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java
@@ -93,10 +93,20 @@ public class PropAccess implements Access {
int eq;
for (String arg : args) {
if ((eq=arg.indexOf('='))>0) {
- nprops.setProperty(arg.substring(0, eq),arg.substring(eq+1));
+ String key = arg.substring(0, eq);
+ if(Config.CADI_PROP_FILES.equals(key)) {
+ nprops.setProperty(key,arg.substring(eq+1));
+ }
}
}
init(nprops);
+
+ // Re-overlay Args
+ for (String arg : args) {
+ if ((eq=arg.indexOf('='))>0) {
+ props.setProperty(arg.substring(0, eq),arg.substring(eq+1));
+ }
+ }
}
protected void init(Properties p) {
@@ -105,15 +115,16 @@ public class PropAccess implements Access {
level=DEFAULT.maskOf();
props = new Properties();
- // First, load related System Properties
+
+ // Find the "cadi_prop_files"
+ // First in VM Args
for (Entry<Object,Object> es : System.getProperties().entrySet()) {
String key = es.getKey().toString();
- for (String start : new String[] {"HOSTNAME","cadi_","aaf_","cm_"}) {
- if (key.startsWith(start)) {
- props.put(key, es.getValue());
- }
- }
+ if(Config.CADI_PROP_FILES.equals(key)) {
+ props.put(key,es.getValue().toString());
+ }
}
+
// Second, overlay or fill in with Passed in Props
if (p!=null) {
props.putAll(p);
@@ -122,6 +133,16 @@ public class PropAccess implements Access {
// Third, load any Chained Property Files
load(props.getProperty(Config.CADI_PROP_FILES));
+ // Fourth, System.getProperties takes precedence over Files
+ for (Entry<Object,Object> es : System.getProperties().entrySet()) {
+ String key = es.getKey().toString();
+ for (String start : new String[] {"HOSTNAME","cadi_","aaf_","cm_"}) {
+ if (key.startsWith(start)) {
+ props.put(key, es.getValue());
+ }
+ }
+ }
+
String sLevel = props.getProperty(Config.CADI_LOGLEVEL);
if (sLevel!=null) {
level=Level.valueOf(sLevel).maskOf();