X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cadi%2Faaf%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fcadi%2Fregister%2FRemoteRegistrant.java;h=e9a80dda5bde31ec12f423d132dabf94f4438d06;hb=679f142a91b165a958b5739808d6409d6960b6f4;hp=6c1d6682ce264d914b57595c423beeb5950d4e8d;hpb=103d3ca78423b8c90be7ab3ce76c7144f31476d7;p=aaf%2Fauthz.git diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RemoteRegistrant.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RemoteRegistrant.java index 6c1d6682..e9a80dda 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RemoteRegistrant.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/RemoteRegistrant.java @@ -27,10 +27,10 @@ import java.net.URI; import java.net.UnknownHostException; import org.onap.aaf.cadi.Access; +import org.onap.aaf.cadi.Access.Level; import org.onap.aaf.cadi.CadiException; import org.onap.aaf.cadi.Locator; import org.onap.aaf.cadi.LocatorException; -import org.onap.aaf.cadi.Access.Level; import org.onap.aaf.cadi.aaf.v2_0.AAFCon; import org.onap.aaf.cadi.client.Future; import org.onap.aaf.cadi.client.Rcli; @@ -75,8 +75,17 @@ public class RemoteRegistrant implements Registrant { mep = new MgmtEndpoint(); mep.setName(name); mep.setPort(port); - + try { + String hostnameToRegister = access.getProperty(Config.CADI_REGISTRATION_HOSTNAME, null); + if(hostnameToRegister==null) { + hostnameToRegister = access.getProperty(Config.HOSTNAME, null); + } + if(hostnameToRegister==null) { + hostnameToRegister = Inet4Address.getLocalHost().getHostName(); + } + mep.setHostname(hostnameToRegister); + String latitude = access.getProperty(Config.CADI_LATITUDE, null); if(latitude==null) { latitude = access.getProperty("AFT_LATITUDE", null); @@ -97,7 +106,6 @@ public class RemoteRegistrant implements Registrant { mep.setMinor(split.length>1?Integer.parseInt(split[1]):0); mep.setMajor(split.length>0?Integer.parseInt(split[0]):0); - mep.setHostname(access.getProperty(Config.HOSTNAME, Inet4Address.getLocalHost().getHostName())); String subprotocols = access.getProperty(Config.CADI_PROTOCOLS, null); if(subprotocols==null) { mep.setProtocol("http");