- java.lang.Object
-
- io.netty5.resolver.dns.DnsServerAddresses
-
public abstract class DnsServerAddresses extends Object
Provides an infinite sequence of DNS server addresses toDnsNameResolver
.
-
-
Constructor Summary
Constructors Constructor Description DnsServerAddresses()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DnsServerAddresses
defaultAddresses()
Deprecated.static List<InetSocketAddress>
defaultAddressList()
Deprecated.static DnsServerAddresses
rotational(Iterable<? extends InetSocketAddress> addresses)
Returns theDnsServerAddresses
that yields the specifiedaddresses
in a rotational sequential order.static DnsServerAddresses
rotational(InetSocketAddress... addresses)
Returns theDnsServerAddresses
that yields the specifiedaddresses
in a rotational sequential order.static DnsServerAddresses
sequential(Iterable<? extends InetSocketAddress> addresses)
Returns theDnsServerAddresses
that yields the specifiedaddresses
sequentially.static DnsServerAddresses
sequential(InetSocketAddress... addresses)
Returns theDnsServerAddresses
that yields the specifiedaddresses
sequentially.static DnsServerAddresses
shuffled(Iterable<? extends InetSocketAddress> addresses)
Returns theDnsServerAddresses
that yields the specifiedaddress
in a shuffled order.static DnsServerAddresses
shuffled(InetSocketAddress... addresses)
Returns theDnsServerAddresses
that yields the specifiedaddresses
in a shuffled order.static DnsServerAddresses
singleton(InetSocketAddress address)
Returns theDnsServerAddresses
that yields only a singleaddress
.abstract DnsServerAddressStream
stream()
Starts a new infinite stream of DNS server addresses.
-
-
-
Method Detail
-
defaultAddressList
@Deprecated public static List<InetSocketAddress> defaultAddressList()
Deprecated.UseDefaultDnsServerAddressStreamProvider.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.
-
defaultAddresses
@Deprecated public static DnsServerAddresses defaultAddresses()
Deprecated.UseDefaultDnsServerAddressStreamProvider.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());
-
sequential
public static DnsServerAddresses sequential(Iterable<? extends InetSocketAddress> addresses)
Returns theDnsServerAddresses
that yields the specifiedaddresses
sequentially. Once the last address is yielded, it will start again from the first address.
-
sequential
public static DnsServerAddresses sequential(InetSocketAddress... addresses)
Returns theDnsServerAddresses
that yields the specifiedaddresses
sequentially. Once the last address is yielded, it will start again from the first address.
-
shuffled
public static DnsServerAddresses shuffled(Iterable<? extends InetSocketAddress> addresses)
Returns theDnsServerAddresses
that yields the specifiedaddress
in a shuffled order. Once all addresses are yielded, the addresses are shuffled again.
-
shuffled
public static DnsServerAddresses shuffled(InetSocketAddress... addresses)
Returns theDnsServerAddresses
that yields the specifiedaddresses
in a shuffled order. Once all addresses are yielded, the addresses are shuffled again.
-
rotational
public static DnsServerAddresses rotational(Iterable<? extends InetSocketAddress> addresses)
Returns theDnsServerAddresses
that yields the specifiedaddresses
in a rotational sequential order. It is similar tosequential(Iterable)
, but eachDnsServerAddressStream
starts from a different starting point. For example, the firststream()
will start from the first address, the second one will start from the second address, and so on.
-
rotational
public static DnsServerAddresses rotational(InetSocketAddress... addresses)
Returns theDnsServerAddresses
that yields the specifiedaddresses
in a rotational sequential order. It is similar tosequential(Iterable)
, but eachDnsServerAddressStream
starts from a different starting point. For example, the firststream()
will start from the first address, the second one will start from the second address, and so on.
-
singleton
public static DnsServerAddresses singleton(InetSocketAddress address)
Returns theDnsServerAddresses
that yields only a singleaddress
.
-
stream
public abstract DnsServerAddressStream stream()
Starts a new infinite stream of DNS server addresses. This method is invoked byDnsNameResolver
on every uncachedSimpleNameResolver.resolve(String)
orSimpleNameResolver.resolveAll(String)
.
-
-