Package io.netty.resolver.dns
Class DnsQueryContextManager
java.lang.Object
io.netty.resolver.dns.DnsQueryContextManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<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(InetSocketAddress nameServerAddr, DnsQueryContext qCtx) AddDnsQueryContextto the context manager and return the ID that should be used for the query.(package private) DnsQueryContextget(InetSocketAddress nameServerAddr, int id) getContextMap(InetSocketAddress nameServerAddr) getOrCreateContextMap(InetSocketAddress nameServerAddr) (package private) DnsQueryContextremove(InetSocketAddress nameServerAddr, int id) private static Inet6Addressprivate static Inet4Address
-
Field Details
-
map
A 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
-
getOrCreateContextMap
private DnsQueryContextManager.DnsQueryContextMap getOrCreateContextMap(InetSocketAddress nameServerAddr) -
toCompactAddress
-
toIPv4Address
-