Class MacOSDnsServerAddressStreamProvider

java.lang.Object
io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider
All Implemented Interfaces:
DnsServerAddressStreamProvider

public final class MacOSDnsServerAddressStreamProvider extends java.lang.Object implements DnsServerAddressStreamProvider
DnsServerAddressStreamProvider implementation which makes use of the same mechanism as Apple's open source mDNSResponder to retrieve the current nameserver configuration of the system.
  • Field Details

    • RESOLVER_COMPARATOR

      private static final java.util.Comparator<DnsResolver> RESOLVER_COMPARATOR
    • UNAVAILABILITY_CAUSE

      private static final java.lang.Throwable UNAVAILABILITY_CAUSE
    • logger

      private static final InternalLogger logger
    • REFRESH_INTERVAL

      private static final long REFRESH_INTERVAL
    • currentMappings

      private volatile java.util.Map<java.lang.String, DnsServerAddresses> currentMappings
    • lastRefresh

      private final java.util.concurrent.atomic.AtomicLong lastRefresh
  • Constructor Details

    • MacOSDnsServerAddressStreamProvider

      public MacOSDnsServerAddressStreamProvider()
  • Method Details

    • loadNativeLibrary

      private static void loadNativeLibrary()
    • isAvailable

      public static boolean isAvailable()
    • ensureAvailability

      public static void ensureAvailability()
    • unavailabilityCause

      public static java.lang.Throwable unavailabilityCause()
    • retrieveCurrentMappings

      private static java.util.Map<java.lang.String, DnsServerAddresses> retrieveCurrentMappings()
    • nameServerAddressStream

      public DnsServerAddressStream nameServerAddressStream(java.lang.String hostname)
      Description copied from interface: DnsServerAddressStreamProvider
      Ask this provider for the name servers to query for hostname.
      Specified by:
      nameServerAddressStream in interface DnsServerAddressStreamProvider
      Parameters:
      hostname - The hostname for which to lookup the DNS server addressed to use. If this is the final DnsServerAddressStreamProvider to be queried then generally empty string or '.' correspond to the default DnsServerAddressStream.
      Returns:
      The DnsServerAddressStream which should be used to resolve hostname.
    • resolvers

      private static DnsResolver[] resolvers()