X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=cadi%2Faaf%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fcadi%2Fregister%2FRegistrationCreator.java;h=5221d8eacc141c2363ca86b99aec8baf8a49f963;hb=ff1417ff60baee231a28272f9a16ef2c9c8ea0a2;hp=ac715163b86608fc92f04852b7eb1c5277a1e66f;hpb=a47bd51641efcb84e19d68a6383f0947df826636;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 ac715163..5221d8ea 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 @@ -98,15 +98,25 @@ public class RegistrationCreator { String protocol = access.getProperty(Config.AAF_LOCATOR_PROTOCOL + dot_le, null); if (protocol!=null) { locate.setProtocol(protocol); - String subprotocols = access.getProperty(Config.AAF_LOCATOR_SUBPROTOCOL + dot_le, null); - if(subprotocols!=null) { - List ls = locate.getSubprotocol(); - for (String s : Split.split(',', subprotocols)) { - ls.add(s); - } - } + List ls = locate.getSubprotocol(); + if(ls==null || ls.isEmpty()) { + String subprotocols = access.getProperty(Config.AAF_LOCATOR_SUBPROTOCOL + dot_le, null); + if(subprotocols==null) { + subprotocols = access.getProperty(Config.CADI_PROTOCOLS, null); + } + if(subprotocols!=null) { + for (String s : Split.split(',', subprotocols)) { + ls.add(s); + } + } else { + access.printf(Level.ERROR, "%s is required for Locator Registration of %s", + Config.AAF_LOCATOR_SUBPROTOCOL,Config.AAF_LOCATOR_PROTOCOL); + } + } + lme.add(locate); + } else { + access.printf(Level.ERROR, "%s is required for Locator Registration",Config.AAF_LOCATOR_PROTOCOL); } - lme.add(locate); } } } catch (NumberFormatException | UnknownHostException e) {