diff options
author | Instrumental <jonathan.gathman@att.com> | 2019-04-10 13:01:30 -0500 |
---|---|---|
committer | Instrumental <jonathan.gathman@att.com> | 2019-04-10 13:13:33 -0500 |
commit | 4ac37bffd664bbc2d6d419d9420393193573320d (patch) | |
tree | 92f0f1e1903488ec0cf2a3ae9835690f085214ea /cadi/core/src | |
parent | dcd0cb51ce490f0d790713a2c1e9dc5fda36e70d (diff) |
switch Internal/External Locator Names for Dublin
Issue-ID: AAF-808
Change-Id: If7c600cddef0f7d0fce1a8f7b1518d9ffe0983fe
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.java | 17 | ||||
-rw-r--r-- | cadi/core/src/main/java/org/onap/aaf/cadi/config/RegistrationPropHolder.java | 35 |
2 files changed, 36 insertions, 16 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 07a791e8..ff1f3955 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 @@ -152,15 +152,7 @@ public class Config { public static final String AAF_LOCATE_URL_TAG = "AAF_LOCATE_URL"; // Name of Above for use in Config Variables. public static final String AAF_DEFAULT_API_VERSION = "2.1"; public static final String AAF_API_VERSION = "aaf_api_version"; - public static final String AAF_URL = "aaf_url"; //URL for AAF... Use to trigger AAF configuration - public static final String AAF_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.service:" + AAF_DEFAULT_API_VERSION; - public static final String GUI_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.gui:" + AAF_DEFAULT_API_VERSION; - public static final String CM_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.cm:" + AAF_DEFAULT_API_VERSION; - public static final String FS_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.fs:" + AAF_DEFAULT_API_VERSION; - public static final String HELLO_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.hello:" + AAF_DEFAULT_API_VERSION; - public static final String OAUTH2_TOKEN_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.token:" + AAF_DEFAULT_API_VERSION +"/token"; - public static final String OAUTH2_INTROSPECT_URL_DEF = "https://AAF_LOCATE_URL/%CNS.%AAF_NS.introspect:" + AAF_DEFAULT_API_VERSION +"/introspect";; - + public static final String AAF_URL = "aaf_url"; //URL for AAF... Use to trigger AAF configuration public static final String AAF_LOCATOR_CLASS = "aaf_locator_class"; // AAF Locator Entries are ADDITIONAL entries, which also gives the Property ability // to set these entries manually @@ -181,6 +173,7 @@ public class Config { public static final String AAF_LOCATOR_NAME = "aaf_locator_name"; 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"; public static final String AAF_APPID = "aaf_id"; public static final String AAF_APPPASS = "aaf_password"; @@ -217,8 +210,10 @@ public class Config { public static final String AAF_DATA_DIR = "aaf_data_dir"; // AAF processes and Components only. public static final String AAF_RELEASE = "aaf_release"; - public static final String GW_URL = "gw_url"; - public static final String CM_URL = "cm_url"; + public static final String AAF_URL_GUI="aaf_url_gui"; + public static final String AAF_URL_FS="aaf_url_fs"; + public static final String AAF_URL_CM = "aaf_url_cm"; + public static final String AAF_URL_HELLO = "aaf_url_hello"; public static final String CM_TRUSTED_CAS = "cm_trusted_cas"; public static final String PATHFILTER_URLPATTERN = "pathfilter_urlpattern"; 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 997803bb..50f17e88 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 @@ -24,8 +24,8 @@ import java.net.Inet4Address; import java.net.UnknownHostException; import org.onap.aaf.cadi.Access; -import org.onap.aaf.cadi.CadiException; import org.onap.aaf.cadi.Access.Level; +import org.onap.aaf.cadi.CadiException; import org.onap.aaf.cadi.util.Split; public class RegistrationPropHolder { @@ -89,8 +89,17 @@ public class RegistrationPropHolder { if(firstlog) { access.printf(Level.INIT, REGI,"public_fqdn",public_fqdn); } - - default_name = access.getProperty(Config.AAF_LOCATOR_NAME, PUBLIC_NAME); + + // Allow Container to reset the standard name for public + String container_public_name = access.getProperty(Config.AAF_LOCATOR_PUBLIC_NAME+'.'+default_container, null); + if(container_public_name==null) { + container_public_name = access.getProperty(Config.AAF_LOCATOR_PUBLIC_NAME, null); + if(container_public_name==null) { + container_public_name = access.getProperty(Config.AAF_LOCATOR_NAME, PUBLIC_NAME); + } + } + default_name = container_public_name; + if(firstlog) { access.printf(Level.INIT, REGI,"default_name",default_name); } @@ -171,12 +180,23 @@ public class RegistrationPropHolder { return replacements("RegistrationPropHolder.getEntryName",str,entry,dot_le); } + public String getPublicEntryName(final String entry, final String dot_le) { + String str = access.getProperty(Config.AAF_LOCATOR_PUBLIC_NAME+dot_le, null); + if(str==null) { + str = access.getProperty(Config.AAF_LOCATOR_PUBLIC_NAME,null); + } + if(str==null) { + str = default_name; + } + return replacements("RegistrationPropHolder.getEntryName",str,entry,dot_le); + } + private String getNS(String dot_le) { String ns; ns = access.getProperty(Config.AAF_LOCATOR_APP_NS+dot_le,null); if(ns==null) { - ns = access.getProperty(Config.AAF_LOCATOR_APP_NS, ""); + ns = access.getProperty(Config.AAF_LOCATOR_APP_NS, "AAF_NS"); } return ns; } @@ -214,7 +234,12 @@ public class RegistrationPropHolder { if(!str.endsWith("/locate/")) { str+="locate/"; } - value = value.replace("https://AAF_LOCATE_URL/", str); + if(value.startsWith("http:")) { + value = value.replace("http://AAF_LOCATE_URL/", str); + } else { + value = value.replace("https://AAF_LOCATE_URL/", str); + + } } } } |