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) int
add
(InetSocketAddress nameServerAddr, DnsQueryContext qCtx) AddDnsQueryContext
to the context manager and return the ID that should be used for the query.(package private) DnsQueryContext
get
(InetSocketAddress nameServerAddr, int id) getContextMap
(InetSocketAddress nameServerAddr) getOrCreateContextMap
(InetSocketAddress nameServerAddr) (package private) DnsQueryContext
remove
(InetSocketAddress nameServerAddr, int id) private static Inet6Address
private 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
AddDnsQueryContext
to the context manager and return the ID that should be used for the query. This method will return-1
if an ID could not be generated and the context was not stored.- Parameters:
nameServerAddr
- TheInetSocketAddress
of the nameserver to query.qCtx
- Theinvalid @link
{@link {@link
- Returns:
- the ID that should be used or
-1
if none could be generated.
-
get
- Parameters:
nameServerAddr
- TheInetSocketAddress
of the nameserver.id
- The id that identifies theDnsQueryContext
and was used for the query.- Returns:
- The context or
null
if none could be found.
-
remove
- Parameters:
nameServerAddr
- TheInetSocketAddress
of the nameserver.id
- The id that identifies theDnsQueryContext
and was used for the query.- Returns:
- The context or
null
if none could be removed.
-
getContextMap
-
getOrCreateContextMap
private DnsQueryContextManager.DnsQueryContextMap getOrCreateContextMap(InetSocketAddress nameServerAddr) -
toCompactAddress
-
toIPv4Address
-