JettyStartups to improve new Filters
[aaf/authz.git] / cadi / core / src / main / java / org / onap / aaf / cadi / config / Config.java
index d7c7526..c79c5cc 100644 (file)
@@ -143,6 +143,7 @@ public class Config {
        public static final String AAF_ENV = "aaf_env";
        public static final String AAF_URL = "aaf_url"; //URL for AAF... Use to trigger AAF configuration
        public static final String AAF_ROOT_NS = "aaf_root_ns";
+       public static final String AAF_ROOT_NS_DEF = "org.osaaf.aaf";
        public static final String AAF_ROOT_COMPANY = "aaf_root_company";
        public static final String AAF_LOCATE_URL = "aaf_locate_url"; //URL for AAF locator
        private static final String AAF_LOCATE_URL_TAG = "AAF_LOCATE_URL"; // Name of Above for use in Config Variables.
@@ -532,7 +533,11 @@ public class Config {
                                        access.log(Level.INIT,"AAF/OAuth LUR plugin is not available.");
                                }
                        } catch (NoSuchMethodException| SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-                               access.log(e,"AAF/OAuth LUR could not be constructed with given Constructors.");
+                               String msg = e.getMessage();
+                               if(msg==null && e.getCause()!=null) {
+                                       msg = e.getCause().getMessage();
+                               }
+                               access.log(Level.INIT,"AAF/OAuth LUR is not instantiated.",msg);
                        } 
                } else {
                        access.log(Level.INIT, "OAuth2 Lur disabled");
@@ -716,7 +721,12 @@ public class Config {
                        String url = _url, replacement;
                        int idxAAF_LOCATE_URL;
                        if((idxAAF_LOCATE_URL=_url.indexOf(AAF_LOCATE_URL_TAG))>0 && ((replacement=access.getProperty(AAF_LOCATE_URL, null))!=null)) {
-                               url = replacement + "/locate" + _url.substring(idxAAF_LOCATE_URL+AAF_LOCATE_URL_TAG.length());
+                               StringBuilder sb = new StringBuilder(replacement);
+                               if(!replacement.endsWith("/locate")) {
+                                       sb.append("/locate");
+                               } 
+                               sb.append(_url,idxAAF_LOCATE_URL+AAF_LOCATE_URL_TAG.length(),_url.length());
+                               url = sb.toString();
                        }
        
                        try {