X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cadi%2Faaf%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fcadi%2Fregister%2FRegistrationCreator.java;h=fc3c18b0a09f021e9815e34515d06767a3bf78d7;hb=b3a6814af9ab63fa59d0233f5d2ebb032f0b1597;hp=8b879e4f6171a8ad7d82a9cc8f2d884cd99175ea;hpb=9f1388eb5ac3f9aab5fe617eae55b08fd2a57059;p=aaf%2Fauthz.git 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 8b879e4f..fc3c18b0 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 @@ -55,6 +55,7 @@ public class RegistrationCreator { RegistrationPropHolder ph = new RegistrationPropHolder(access, port); + String firstPrivateHostname = null; // Now, loop through by Container for(String le : Split.splitTrim(',', ph.lcontainer)) { if(le.isEmpty()) { @@ -81,7 +82,23 @@ public class RegistrationCreator { } locate.setName(ph.getEntryName(entry,dot_le)); - locate.setHostname(ph.getEntryFQDN(entry,dot_le)); + /* Cover the situation where there is a Container, and multiple locator Entries, + * the first of which is the only real private FQDN + * example: oauth + * aaf_locator_entries=oauth,token,introspect + * + * Entries for token and introspect, but they point to oauth service. + */ + String locateHostname; + if(le.isEmpty()) { + locateHostname=ph.getEntryFQDN(entry, dot_le); + } else if(firstPrivateHostname==null) { + firstPrivateHostname=locateHostname=ph.getEntryFQDN(entry, dot_le); + } else { + locateHostname=firstPrivateHostname; + } + + locate.setHostname(locateHostname); locate.setPort(ph.getEntryPort(dot_le)); String specificVersion = access.getProperty(Config.AAF_LOCATOR_VERSION + dot_le,null);