summaryrefslogtreecommitdiffstats
path: root/cadi/core
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-05-29 04:58:50 -0500
committerInstrumental <jonathan.gathman@att.com>2019-05-29 07:34:28 -0500
commitff1417ff60baee231a28272f9a16ef2c9c8ea0a2 (patch)
treed9ca6c5f9661a3ffd6263d1380812e2430d9b230 /cadi/core
parenta47bd51641efcb84e19d68a6383f0947df826636 (diff)
Post Init Service Starter
minor fixes Remove JU generated garbage files Issue-ID: AAF-835 Change-Id: I476291f1f1140f0640ed49452f8a5dabb28d9c30 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'cadi/core')
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java49
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java8
2 files changed, 37 insertions, 20 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 2fe5f41c..d6b8d56d 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
@@ -28,6 +28,7 @@ import java.io.InputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
+import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@@ -149,6 +150,7 @@ public class PropAccess implements Access {
name = props.getProperty(Config.CADI_LOGNAME, name);
SecurityInfo.setHTTPProtocols(this);
+
}
@@ -260,27 +262,34 @@ public class PropAccess implements Access {
return buildMsg(name,iso8601,level,elements);
}
- public static StringBuilder buildMsg(final String name, final SimpleDateFormat sdf, Level level, Object[] elements) {
- StringBuilder sb = new StringBuilder(sdf.format(new Date()));
- sb.append(' ');
- sb.append(level.name());
- sb.append(" [");
- sb.append(name);
-
+ public static StringBuilder buildMsg(final String name, final DateFormat sdf, Level level, Object[] elements) {
+ final StringBuilder sb;
int end = elements.length;
- if (end<=0) {
- sb.append("] ");
- } else {
- int idx = 0;
- if(elements[idx]!=null &&
- elements[idx] instanceof Integer) {
- sb.append('-');
- sb.append(elements[idx]);
- ++idx;
- }
- sb.append("] ");
- write(true,sb,elements);
- }
+ if(sdf==null) {
+ sb = new StringBuilder();
+ write(true,sb,elements);
+ } else {
+ sb = new StringBuilder(
+ sdf.format(new Date())
+ );
+ sb.append(' ');
+ sb.append(level.name());
+ sb.append(" [");
+ sb.append(name);
+ if (end<=0) {
+ sb.append("] ");
+ } else {
+ int idx = 0;
+ if(elements[idx]!=null &&
+ elements[idx] instanceof Integer) {
+ sb.append('-');
+ sb.append(elements[idx]);
+ ++idx;
+ }
+ sb.append("] ");
+ write(true,sb,elements);
+ }
+ }
return sb;
}
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java
index ff1f3955..8cb1045b 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java
@@ -88,6 +88,9 @@ public class Config {
public static final String CADI_LOGDIR = "cadi_log_dir";
public static final String CADI_ETCDIR = "cadi_etc_dir";
public static final String CADI_LOGNAME = "cadi_logname";
+// public static final String CADI_LOGFMT="cad_logging_format";
+// public static final String CADI_LOGFMT_UTC="UTC";
+// public static final String CADI_LOGFMT_ISO8601="ISO-8601";
public static final String CADI_KEYFILE = "cadi_keyfile";
public static final String CADI_KEYSTORE = "cadi_keystore";
public static final String CADI_KEYSTORE_PASSWORD = "cadi_keystore_password";
@@ -174,6 +177,11 @@ public class Config {
public static final String AAF_LOCATOR_PUBLIC_PORT = "aaf_locator_public_port";
public static final String AAF_LOCATOR_PUBLIC_FQDN = "aaf_locator_public_fqdn";
public static final String AAF_LOCATOR_PUBLIC_NAME = "aaf_locator_public_name";
+
+ // AAF Service will write to the Audit Log if a past due AAF stored Password
+ // is being used within # of days specified.
+ public static final String AAF_CRED_WARN_DAYS="aaf_cred_warn_days";
+ public static final String AAF_CRED_WARN_DAYS_DFT="7";
public static final String AAF_APPID = "aaf_id";
public static final String AAF_APPPASS = "aaf_password";