summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-12-20 12:48:07 -0600
committerInstrumental <jonathan.gathman@att.com>2019-12-20 12:48:24 -0600
commit439d8cd4ad19585fb93d721041e21ec8b46e4f0e (patch)
tree185620e3712480228f9e93345ce3a26d64550549
parent3ca2e6964bf2aab93394cf542b6354ca735703c0 (diff)
Fix DNSLocator when Network Disconnect
Issue-ID: AAF-1060 Signed-off-by: Instrumental <jonathan.gathman@att.com> Change-Id: I88cdfc917470af8217273fe96db66604601345bf
-rw-r--r--cadi/client/src/main/java/org/onap/aaf/cadi/locator/DNSLocator.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/DNSLocator.java b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/DNSLocator.java
index 53782b34..f6edfd1d 100644
--- a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/DNSLocator.java
+++ b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/DNSLocator.java
@@ -103,10 +103,12 @@ public class DNSLocator implements SizedLocator<URI> {
@Override
public boolean hasItems() {
- for (Host h : hosts) {
+ if(hosts!=null) {
+ for (Host h : hosts) {
if (h.status==Status.OK) {
return true;
}
+ }
}
return false;
}
@@ -239,11 +241,11 @@ public class DNSLocator implements SizedLocator<URI> {
*
*/
public interface DNSLookup {
- InetAddress[] getAllByName(String host) throws UnknownHostException;
- public static final DNSLookup dflt = new DNSLookup() {
- public InetAddress[] getAllByName(String host) throws UnknownHostException {
- return InetAddress.getAllByName(host);
- }
+ InetAddress[] getAllByName(String host) throws UnknownHostException;
+ public static final DNSLookup dflt = new DNSLookup() {
+ public InetAddress[] getAllByName(String host) throws UnknownHostException {
+ return InetAddress.getAllByName(host);
+ }
};
}