Class DnsQueryContextManager
java.lang.Object
io.netty.resolver.dns.DnsQueryContextManager
final class DnsQueryContextManager
extends java.lang.Object
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final java.util.Map<java.net.InetSocketAddress, DnsQueryContextManager.DnsQueryContextMap> A map whose key is the DNS server address and value is the map of the DNS query ID and its correspondingDnsQueryContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) intadd(java.net.InetSocketAddress nameServerAddr, DnsQueryContext qCtx) AddDnsQueryContextto the context manager and return the ID that should be used for the query.(package private) DnsQueryContextget(java.net.InetSocketAddress nameServerAddr, int id) getContextMap(java.net.InetSocketAddress nameServerAddr) getOrCreateContextMap(java.net.InetSocketAddress nameServerAddr) (package private) DnsQueryContextremove(java.net.InetSocketAddress nameServerAddr, int id) private static java.net.Inet6AddresstoCompactAddress(java.net.Inet4Address a4) private static java.net.Inet4AddresstoIPv4Address(java.net.Inet6Address a6) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
map
private final java.util.Map<java.net.InetSocketAddress, DnsQueryContextManager.DnsQueryContextMap> mapA map whose key is the DNS server address and value is the map of the DNS query ID and its correspondingDnsQueryContext.
-
-
Constructor Details
-
DnsQueryContextManager
DnsQueryContextManager()
-
-
Method Details
-
add
AddDnsQueryContextto the context manager and return the ID that should be used for the query. This method will return-1if an ID could not be generated and the context was not stored.- Parameters:
nameServerAddr- TheInetSocketAddressof the nameserver to query.qCtx- TheDnsQueryContext} to store.invalid @link
{@link {@link- Returns:
- the ID that should be used or
-1if none could be generated.
-
get
- Parameters:
nameServerAddr- TheInetSocketAddressof the nameserver.id- The id that identifies theDnsQueryContextand was used for the query.- Returns:
- The context or
nullif none could be found.
-
remove
- Parameters:
nameServerAddr- TheInetSocketAddressof the nameserver.id- The id that identifies theDnsQueryContextand was used for the query.- Returns:
- The context or
nullif none could be removed.
-
getContextMap
private DnsQueryContextManager.DnsQueryContextMap getContextMap(java.net.InetSocketAddress nameServerAddr) -
getOrCreateContextMap
private DnsQueryContextManager.DnsQueryContextMap getOrCreateContextMap(java.net.InetSocketAddress nameServerAddr) -
toCompactAddress
private static java.net.Inet6Address toCompactAddress(java.net.Inet4Address a4) -
toIPv4Address
private static java.net.Inet4Address toIPv4Address(java.net.Inet6Address a6)
-