public class DnsRecordIpAddressResolver extends Object implements AddressResolver
AddressResolver
that resolves DNS record IPs.
Uses InetAddress
internally.
The first returned address is used when automatic recovery is NOT enabled
at the ConnectionFactory
level.
When automatic recovery is enabled, a random address will be picked up
from the returned list of Address
es.Constructor and Description |
---|
DnsRecordIpAddressResolver() |
DnsRecordIpAddressResolver(Address address) |
DnsRecordIpAddressResolver(Address address,
boolean ssl) |
DnsRecordIpAddressResolver(String hostname) |
DnsRecordIpAddressResolver(String hostname,
int port) |
DnsRecordIpAddressResolver(String hostname,
int port,
boolean ssl) |
Modifier and Type | Method and Description |
---|---|
List<Address> |
getAddresses()
Get the IP addresses from a DNS query
|
protected InetAddress[] |
resolveIpAddresses(String hostName) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
maybeShuffle
public DnsRecordIpAddressResolver(String hostname, int port, boolean ssl)
public DnsRecordIpAddressResolver(String hostname, int port)
public DnsRecordIpAddressResolver()
public DnsRecordIpAddressResolver(String hostname)
public DnsRecordIpAddressResolver(Address address)
public DnsRecordIpAddressResolver(Address address, boolean ssl)
public List<Address> getAddresses() throws UnknownHostException
getAddresses
in interface AddressResolver
Address
esIOException
- if DNS resolution failsUnknownHostException
protected InetAddress[] resolveIpAddresses(String hostName) throws UnknownHostException
UnknownHostException
Copyright © 2022 VMware, Inc. or its affiliates.. All rights reserved.