Package io.netty.resolver.dns
Class DnsQueryContextManager
- java.lang.Object
-
- io.netty.resolver.dns.DnsQueryContextManager
-
final class DnsQueryContextManager extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classDnsQueryContextManager.DnsQueryContextMap
-
Field Summary
Fields Modifier and Type Field Description private 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 Summary
Constructors Constructor Description DnsQueryContextManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (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)private DnsQueryContextManager.DnsQueryContextMapgetContextMap(java.net.InetSocketAddress nameServerAddr)private DnsQueryContextManager.DnsQueryContextMapgetOrCreateContextMap(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)
-
-
-
Field Detail
-
map
private final java.util.Map<java.net.InetSocketAddress,DnsQueryContextManager.DnsQueryContextMap> map
A map whose key is the DNS server address and value is the map of the DNS query ID and its correspondingDnsQueryContext.
-
-
Method Detail
-
add
int add(java.net.InetSocketAddress nameServerAddr, DnsQueryContext qCtx)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- The {@link {@link DnsQueryContext} to store.- Returns:
- the ID that should be used or
-1if none could be generated.
-
get
DnsQueryContext get(java.net.InetSocketAddress nameServerAddr, int id)
- 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
DnsQueryContext remove(java.net.InetSocketAddress nameServerAddr, int id)
- 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)
-
-