summaryrefslogtreecommitdiffstats
path: root/cadi
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
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')
-rw-r--r--cadi/aaf/src/main/java/org/onap/aaf/cadi/register/Registrar.java1
-rw-r--r--cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java26
-rw-r--r--cadi/aaf/src/main/java/org/onap/aaf/cadi/sso/AAFSSO.java2
-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
5 files changed, 57 insertions, 29 deletions
diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/Registrar.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/Registrar.java
index 4ae1b97f..c3dc4f6a 100644
--- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/Registrar.java
+++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/Registrar.java
@@ -71,6 +71,7 @@ public class Registrar<ENV extends BasicEnv> {
erroringTimer = null;
}
} else {
+ env.error().log(rv.toString());
// Account for different Registrations not being to same place
if (erroringTimer==null) {
erroringTimer = new Timer(REGISTRAR + " error re-check ",true);
diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java
index ac715163..5221d8ea 100644
--- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java
+++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RegistrationCreator.java
@@ -98,15 +98,25 @@ public class RegistrationCreator {
String protocol = access.getProperty(Config.AAF_LOCATOR_PROTOCOL + dot_le, null);
if (protocol!=null) {
locate.setProtocol(protocol);
- String subprotocols = access.getProperty(Config.AAF_LOCATOR_SUBPROTOCOL + dot_le, null);
- if(subprotocols!=null) {
- List<String> ls = locate.getSubprotocol();
- for (String s : Split.split(',', subprotocols)) {
- ls.add(s);
- }
- }
+ List<String> ls = locate.getSubprotocol();
+ if(ls==null || ls.isEmpty()) {
+ String subprotocols = access.getProperty(Config.AAF_LOCATOR_SUBPROTOCOL + dot_le, null);
+ if(subprotocols==null) {
+ subprotocols = access.getProperty(Config.CADI_PROTOCOLS, null);
+ }
+ if(subprotocols!=null) {
+ for (String s : Split.split(',', subprotocols)) {
+ ls.add(s);
+ }
+ } else {
+ access.printf(Level.ERROR, "%s is required for Locator Registration of %s",
+ Config.AAF_LOCATOR_SUBPROTOCOL,Config.AAF_LOCATOR_PROTOCOL);
+ }
+ }
+ lme.add(locate);
+ } else {
+ access.printf(Level.ERROR, "%s is required for Locator Registration",Config.AAF_LOCATOR_PROTOCOL);
}
- lme.add(locate);
}
}
} catch (NumberFormatException | UnknownHostException e) {
diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/sso/AAFSSO.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/sso/AAFSSO.java
index c9b8b4ee..7c589ae3 100644
--- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/sso/AAFSSO.java
+++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/sso/AAFSSO.java
@@ -319,7 +319,7 @@ public class AAFSSO {
if(aaf_root_ns==null) {
locateRoot=Defaults.AAF_ROOT;
} else {
- locateRoot = Defaults.AAF_LOCATE_CONST + "/%CNS.%" + aaf_root_ns;
+ locateRoot = Defaults.AAF_LOCATE_CONST + "/%CNS." + aaf_root_ns;
}
if(access.getProperty(Config.AAF_URL)==null) {
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";