public abstract class DnsServerAddresses
extends java.lang.Object
DnsNameResolver
.构造器和说明 |
---|
DnsServerAddresses() |
限定符和类型 | 方法和说明 |
---|---|
static DnsServerAddresses |
defaultAddresses()
已过时。
Use
DefaultDnsServerAddressStreamProvider.defaultAddresses() .
Returns the This method has the same effect with the following code: DnsServerAddresses.sequential(DnsServerAddresses.defaultAddressList()); |
static java.util.List<java.net.InetSocketAddress> |
defaultAddressList()
已过时。
Use
DefaultDnsServerAddressStreamProvider.defaultAddressList() .
Returns the list of the system DNS server addresses. If it failed to retrieve the list of the system DNS server
addresses from the environment, it will return |
static DnsServerAddresses |
rotational(java.net.InetSocketAddress... addresses)
Returns the
DnsServerAddresses that yields the specified addresses in a rotational sequential
order. |
static DnsServerAddresses |
rotational(java.lang.Iterable<? extends java.net.InetSocketAddress> addresses)
Returns the
DnsServerAddresses that yields the specified addresses in a rotational sequential
order. |
static DnsServerAddresses |
sequential(java.net.InetSocketAddress... addresses)
Returns the
DnsServerAddresses that yields the specified addresses sequentially. |
static DnsServerAddresses |
sequential(java.lang.Iterable<? extends java.net.InetSocketAddress> addresses)
Returns the
DnsServerAddresses that yields the specified addresses sequentially. |
static DnsServerAddresses |
shuffled(java.net.InetSocketAddress... addresses)
Returns the
DnsServerAddresses that yields the specified addresses in a shuffled order. |
static DnsServerAddresses |
shuffled(java.lang.Iterable<? extends java.net.InetSocketAddress> addresses)
Returns the
DnsServerAddresses that yields the specified address in a shuffled order. |
static DnsServerAddresses |
singleton(java.net.InetSocketAddress address)
Returns the
DnsServerAddresses that yields only a single address . |
abstract DnsServerAddressStream |
stream()
Starts a new infinite stream of DNS server addresses.
|
@Deprecated public static java.util.List<java.net.InetSocketAddress> defaultAddressList()
DefaultDnsServerAddressStreamProvider.defaultAddressList()
.
Returns the list of the system DNS server addresses. If it failed to retrieve the list of the system DNS server
addresses from the environment, it will return "8.8.8.8"
and "8.8.4.4"
, the addresses of the
Google public DNS servers.
@Deprecated public static DnsServerAddresses defaultAddresses()
DefaultDnsServerAddressStreamProvider.defaultAddresses()
.
Returns the DnsServerAddresses
that yields the system DNS server addresses sequentially. If it failed to
retrieve the list of the system DNS server addresses from the environment, it will use "8.8.8.8"
and
"8.8.4.4"
, the addresses of the Google public DNS servers.
This method has the same effect with the following code:
DnsServerAddresses.sequential(DnsServerAddresses.defaultAddressList());
public static DnsServerAddresses sequential(java.lang.Iterable<? extends java.net.InetSocketAddress> addresses)
DnsServerAddresses
that yields the specified addresses
sequentially. Once the
last address is yielded, it will start again from the first address.public static DnsServerAddresses sequential(java.net.InetSocketAddress... addresses)
DnsServerAddresses
that yields the specified addresses
sequentially. Once the
last address is yielded, it will start again from the first address.public static DnsServerAddresses shuffled(java.lang.Iterable<? extends java.net.InetSocketAddress> addresses)
DnsServerAddresses
that yields the specified address
in a shuffled order. Once all
addresses are yielded, the addresses are shuffled again.public static DnsServerAddresses shuffled(java.net.InetSocketAddress... addresses)
DnsServerAddresses
that yields the specified addresses
in a shuffled order. Once all
addresses are yielded, the addresses are shuffled again.public static DnsServerAddresses rotational(java.lang.Iterable<? extends java.net.InetSocketAddress> addresses)
DnsServerAddresses
that yields the specified addresses
in a rotational sequential
order. It is similar to sequential(Iterable)
, but each DnsServerAddressStream
starts from
a different starting point. For example, the first stream()
will start from the first address, the
second one will start from the second address, and so on.public static DnsServerAddresses rotational(java.net.InetSocketAddress... addresses)
DnsServerAddresses
that yields the specified addresses
in a rotational sequential
order. It is similar to sequential(Iterable)
, but each DnsServerAddressStream
starts from
a different starting point. For example, the first stream()
will start from the first address, the
second one will start from the second address, and so on.public static DnsServerAddresses singleton(java.net.InetSocketAddress address)
DnsServerAddresses
that yields only a single address
.public abstract DnsServerAddressStream stream()
DnsNameResolver
on every
uncached SimpleNameResolver.resolve(String)
or SimpleNameResolver.resolveAll(String)
.