Class NettyResolverContext

  • All Implemented Interfaces:
    DnsResolver

    public class NettyResolverContext
    extends java.lang.Object
    implements DnsResolver
    Asynchronous resolution using Netty. Managed by the NettyDnsResolver.
    Author:
    jwhite
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()  
      void init()  
      java.util.concurrent.CompletableFuture<java.util.Optional<java.net.InetAddress>> lookup​(java.lang.String hostname)
      Perform a DNS lookup for the given hostname.
      java.util.concurrent.CompletableFuture<java.util.Optional<java.lang.String>> reverseLookup​(java.net.InetAddress inetAddress)
      Perform a reverse DNS lookup for the given IP address.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NettyResolverContext

        public NettyResolverContext​(NettyDnsResolver parent,
                                    ExtendedDnsCache cache,
                                    io.github.resilience4j.bulkhead.Bulkhead bulkhead,
                                    int idx)
    • Method Detail

      • init

        public void init()
      • destroy

        public void destroy()
      • lookup

        public java.util.concurrent.CompletableFuture<java.util.Optional<java.net.InetAddress>> lookup​(java.lang.String hostname)
        Description copied from interface: DnsResolver
        Perform a DNS lookup for the given hostname. Returns a future that contains the lookup results. If the optional is empty the lookup was completed but no result was found.
        Specified by:
        lookup in interface DnsResolver
        Parameters:
        hostname - hostname to lookup
        Returns:
        a future
      • reverseLookup

        public java.util.concurrent.CompletableFuture<java.util.Optional<java.lang.String>> reverseLookup​(java.net.InetAddress inetAddress)
        Description copied from interface: DnsResolver
        Perform a reverse DNS lookup for the given IP address. Returns a future that contains the lookup results. If the optional is empty the lookup was completed but no result was found.
        Specified by:
        reverseLookup in interface DnsResolver
        Parameters:
        inetAddress - IP address to lookup
        Returns:
        a future