Class DnsServerAddresses

    • Constructor Detail

      • DnsServerAddresses

        public DnsServerAddresses()
    • Method Detail

      • defaultAddressList

        @Deprecated
        public static java.util.List<java.net.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.

      • defaultAddresses

        @Deprecated
        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());
         

      • sequential

        public static DnsServerAddresses sequential​(java.lang.Iterable<? extends java.net.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.
      • sequential

        public static DnsServerAddresses sequential​(java.net.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.
      • sequential0

        private static DnsServerAddresses sequential0​(java.util.List<java.net.InetSocketAddress> addresses)
      • shuffled

        public static DnsServerAddresses shuffled​(java.lang.Iterable<? extends java.net.InetSocketAddress> addresses)
        Returns the DnsServerAddresses that yields the specified address in a shuffled order. Once all addresses are yielded, the addresses are shuffled again.
      • shuffled

        public static DnsServerAddresses shuffled​(java.net.InetSocketAddress... addresses)
        Returns the DnsServerAddresses that yields the specified addresses in a shuffled order. Once all addresses are yielded, the addresses are shuffled again.
      • shuffled0

        private static DnsServerAddresses shuffled0​(java.util.List<java.net.InetSocketAddress> addresses)
      • rotational

        public static DnsServerAddresses rotational​(java.lang.Iterable<? extends java.net.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.
      • rotational

        public static DnsServerAddresses rotational​(java.net.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.
      • rotational0

        private static DnsServerAddresses rotational0​(java.util.List<java.net.InetSocketAddress> addresses)
      • sanitize

        private static java.util.List<java.net.InetSocketAddress> sanitize​(java.lang.Iterable<? extends java.net.InetSocketAddress> addresses)
      • sanitize

        private static java.util.List<java.net.InetSocketAddress> sanitize​(java.net.InetSocketAddress[] addresses)