X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cadi%2Faaf%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fcadi%2Faaf%2Fv2_0%2FAAFLocator.java;h=3611e481a414b9c5ccf01de7e16ef142eb24517c;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=38f6bcea3987d274fc7582064f4dcbfd88fe4f6b;hpb=2eccd7c892fd7166d70c84a710e8e6b58138893c;p=aaf%2Fauthz.git diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java index 38f6bcea..3611e481 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -67,7 +67,7 @@ public class AAFLocator extends AbsAAFLocator { env = new RosettaEnv(access.getProperties()); } } - + int connectTimeout = Integer.parseInt(si.access.getProperty(Config.AAF_CONN_TIMEOUT, Config.AAF_CONN_TIMEOUT_DEF)); try { String[] path = Split.split('/',locatorURI.getPath()); @@ -86,32 +86,32 @@ public class AAFLocator extends AbsAAFLocator { client = new HClient(si.defSS, locatorURI, connectTimeout); } epsDF = env.newDataFactory(Endpoints.class); - + } catch (APIException /*| URISyntaxException*/ e) { throw new LocatorException(e); } lclient = new HClient(si.defSS, locatorURI, connectTimeout); - + if(si.access.willLog(Access.Level.DEBUG)) { si.access.log(Access.Level.DEBUG, "Root URI:",client.getURI()); } - + String dnsString; if(locatorURI.getPort()<0) { - dnsString=locatorURI.getScheme() + "://" + locatorURI.getHost(); + dnsString=locatorURI.getScheme() + "://" + locatorURI.getHost(); } else { - dnsString=locatorURI.getScheme() + "://" +locatorURI.getHost()+':'+locatorURI.getPort(); + dnsString=locatorURI.getScheme() + "://" +locatorURI.getHost()+':'+locatorURI.getPort(); } if(dnsString.contains("null")) { // for Testing Purposes, mostly. - locatorLocator = null; + locatorLocator = null; } else { - locatorLocator = new DNSLocator(access, dnsString); - if(locatorLocator.hasItems()) { - locatorItem = locatorLocator.best(); - } else { - // For when DNS doesn't work, including some K8s Installations - locatorLocator = new SingleEndpointLocator(dnsString); - } + locatorLocator = new DNSLocator(access, dnsString); + if(locatorLocator.hasItems()) { + locatorItem = locatorLocator.best(); + } else { + // For when DNS doesn't work, including some K8s Installations + locatorLocator = new SingleEndpointLocator(dnsString); + } } } @@ -129,7 +129,7 @@ public class AAFLocator extends AbsAAFLocator { } protected final int maxIters() { - + return locatorLocator.size(); } @@ -166,7 +166,7 @@ public class AAFLocator extends AbsAAFLocator { for (Endpoint endpoint : fr.value.getEndpoint()) { epl.add(new EP(endpoint,latitude,longitude)); } - + Collections.sort(epl); replace(epl); return true; @@ -186,9 +186,9 @@ public class AAFLocator extends AbsAAFLocator { protected URI getURI() { return client.getURI(); } - + protected HClient createClient(SecuritySetter ss, URI uri, int connectTimeout) throws LocatorException { return new HClient(ss, uri, connectTimeout); } - + }