Top Description Constructors Methods
io.netty.resolver.dns

public abstract Class DnsServerAddresses

extends Object
Class Inheritance
Known Direct Subclasses
io.netty.resolver.dns.DefaultDnsServerAddresses, io.netty.resolver.dns.SingletonDnsServerAddresses
Annotations
@SuppressWarnings:IteratorNextCanNotThrowNoSuchElementException
Static Imports
io.netty.util.internal.ObjectUtil.checkNotNull, .ObjectUtil.checkNonEmpty

Provides an infinite sequence of DNS server addresses to DnsNameResolver.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static DnsServerAddresses
public static List<InetSocketAddress>
public static DnsServerAddresses
rotational(Iterable<? extends InetSocketAddress> addresses)

Returns the DnsServerAddresses that yields the specified addresses in a rotational sequential order.

public static DnsServerAddresses
rotational(InetSocketAddress... addresses)

Returns the DnsServerAddresses that yields the specified addresses in a rotational sequential order.

private static DnsServerAddresses
private static List<InetSocketAddress>
sanitize(Iterable<? extends InetSocketAddress> addresses)

private static List<InetSocketAddress>
public static DnsServerAddresses
sequential(Iterable<? extends InetSocketAddress> addresses)

Returns the DnsServerAddresses that yields the specified addresses sequentially.

public static DnsServerAddresses
sequential(InetSocketAddress... addresses)

Returns the DnsServerAddresses that yields the specified addresses sequentially.

private static DnsServerAddresses
public static DnsServerAddresses
shuffled(Iterable<? extends InetSocketAddress> addresses)

Returns the DnsServerAddresses that yields the specified address in a shuffled order.

public static DnsServerAddresses
shuffled(InetSocketAddress... addresses)

Returns the DnsServerAddresses that yields the specified addresses in a shuffled order.

private static DnsServerAddresses
public static DnsServerAddresses
singleton(final InetSocketAddress address)

Returns the DnsServerAddresses that yields only a single address.

public abstract DnsServerAddressStream
stream()

Starts a new infinite stream of DNS server addresses.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DnsServerAddressesback to summary
public DnsServerAddresses()

Method Detail

defaultAddressesback to summary
public static DnsServerAddresses defaultAddresses()

Deprecated

Use 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());

Annotations
@Deprecated
defaultAddressListback to summary
public static List<InetSocketAddress> defaultAddressList()

Deprecated

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 "8.8.8.8" and "8.8.4.4", the addresses of the Google public DNS servers.

Annotations
@Deprecated
rotationalback to summary
public static DnsServerAddresses rotational(Iterable<? extends InetSocketAddress> addresses)

Returns the 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.

rotationalback to summary
public static DnsServerAddresses rotational(InetSocketAddress... addresses)

Returns the 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.

rotational0back to summary
private static DnsServerAddresses rotational0(List<InetSocketAddress> addresses)
sanitizeback to summary
private static List<InetSocketAddress> sanitize(Iterable<? extends InetSocketAddress> addresses)
sanitizeback to summary
private static List<InetSocketAddress> sanitize(InetSocketAddress[] addresses)
sequentialback to summary
public static DnsServerAddresses sequential(Iterable<? extends InetSocketAddress> addresses)

Returns the DnsServerAddresses that yields the specified addresses sequentially. Once the last address is yielded, it will start again from the first address.

sequentialback to summary
public static DnsServerAddresses sequential(InetSocketAddress... addresses)

Returns the DnsServerAddresses that yields the specified addresses sequentially. Once the last address is yielded, it will start again from the first address.

sequential0back to summary
private static DnsServerAddresses sequential0(final List<InetSocketAddress> addresses)
shuffledback to summary
public static DnsServerAddresses shuffled(Iterable<? extends InetSocketAddress> addresses)

Returns the DnsServerAddresses that yields the specified address in a shuffled order. Once all addresses are yielded, the addresses are shuffled again.

shuffledback to summary
public static DnsServerAddresses shuffled(InetSocketAddress... addresses)

Returns the DnsServerAddresses that yields the specified addresses in a shuffled order. Once all addresses are yielded, the addresses are shuffled again.

shuffled0back to summary
private static DnsServerAddresses shuffled0(List<InetSocketAddress> addresses)
singletonback to summary
public static DnsServerAddresses singleton(final InetSocketAddress address)

Returns the DnsServerAddresses that yields only a single address.

streamback to summary
public abstract DnsServerAddressStream stream()

Starts a new infinite stream of DNS server addresses. This method is invoked by DnsNameResolver on every uncached DnsNameResolver#resolve(String)or DnsNameResolver#resolveAll(String).