Class NettyResolverContext
- java.lang.Object
-
- org.opennms.netmgt.dnsresolver.netty.NettyResolverContext
-
- All Implemented Interfaces:
DnsResolver
public class NettyResolverContext extends java.lang.Object implements DnsResolver
Asynchronous resolution using Netty. Managed by theNettyDnsResolver
.- Author:
- jwhite
-
-
Constructor Summary
Constructors Constructor Description NettyResolverContext(NettyDnsResolver parent, ExtendedDnsCache cache, io.github.resilience4j.bulkhead.Bulkhead bulkhead, int idx)
-
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.
-
-
-
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 interfaceDnsResolver
- 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 interfaceDnsResolver
- Parameters:
inetAddress
- IP address to lookup- Returns:
- a future
-
-