summaryrefslogtreecommitdiffstats
path: root/cadi/core/src
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-06-28 17:16:33 -0500
committerInstrumental <jonathan.gathman@att.com>2019-06-28 17:16:37 -0500
commit84fc74efbdd3b8343aaeba13df42accefe5493db (patch)
treeef6d002960324ddc6d4676b8284f6e0c7e9261b9 /cadi/core/src
parentf6f44f558ce4f04605269f71a10d6df054295f6a (diff)
Updates for DirectLocator
Issue-ID: AAF-857 Change-Id: I55cdedad9dfaf4be8c785aa5f503f71fe4504070 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/config/Config.java21
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/config/RegistrationPropHolder.java5
2 files changed, 21 insertions, 5 deletions
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 adb69184..2655b4ce 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
@@ -855,15 +855,30 @@ public class Config {
Method aalMth = aalCls.getMethod("create", String.class,String.class);
int colon = _url.lastIndexOf(':');
if(colon>=0) {
- String version = _url.substring(colon+1);
- int slash = _url.lastIndexOf('/',colon);
+ int slash = _url.indexOf('/',colon);
+ String version;
+ if(slash<0) {
+ version = _url.substring(colon+1);
+ } else {
+ version = _url.substring(colon+1,slash);
+ }
+ slash = _url.lastIndexOf('/',colon);
if(slash>=0) {
Object aal = aalMth.invoke(null/*static*/, _url.substring(slash+1, colon),version);
return (Locator<URI>)aal;
}
}
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- access.log(Level.DEBUG, "Configured AbsAAFLocator not found. Continuing Locator creation");
+ String msg;
+ char quote;
+ if(e.getCause()!=null) {
+ msg=e.getCause().getMessage();
+ quote='"';
+ } else {
+ msg = "-";
+ quote=' ';
+ }
+ access.printf(Level.DEBUG, "Configured AbsAAFLocator not found%c%s%cContinuing Locator creation ",quote,msg,quote);
}
// String url = _url.replace("/AAF_NS.", "/%C%CID%AAF_NS.");
// String root_ns = access.getProperty(Config.AAF_ROOT_NS, null);
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/RegistrationPropHolder.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/RegistrationPropHolder.java
index 50f17e88..2a8760f4 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/RegistrationPropHolder.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/RegistrationPropHolder.java
@@ -263,9 +263,10 @@ public class RegistrationPropHolder {
if(value.indexOf("%NS")>=0) {
str = getNS(dot_le);
if(str==null || str.isEmpty()) {
- value = value.replace("%NS"+'.', str);
+ value = value.replace("%NS"+'.', "");
+ } else {
+ value = value.replace("%NS", str);
}
- value = value.replace("%NS", str);
}
// aaf_root_ns