Top Inners Fields Constructors Methods
io.netty.resolver.dns

pack-priv final Class DnsQueryContextManager

extends Object
Class Inheritance
Imports
io.netty.util.NetUtil, io.netty.util.collection.IntObjectHashMap, .IntObjectMap, java.net.Inet4Address, .Inet6Address, .InetAddress, .InetSocketAddress, .UnknownHostException, java.util.HashMap, .Map

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final Map<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 corresponding DnsQueryContext.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv int

Returns:

the ID that should be used or -1 if none could be generated.
add
(InetSocketAddress
The InetSocketAddress of the nameserver to query.
nameServerAddr
,
DnsQueryContext
The {@link DnsQueryContext to store.
qCtx
)

Add DnsQueryContext to the context manager and return the ID that should be used for the query.

pack-priv DnsQueryContext

Returns:

The context or null if none could be found.
get
(InetSocketAddress
The InetSocketAddress of the nameserver.
nameServerAddr
,
int
The id that identifies the DnsQueryContext and was used for the query.
id
)

Return the DnsQueryContext for the given InetSocketAddress and id or null if none could be found.

private DnsQueryContextManager.DnsQueryContextMap
private DnsQueryContextManager.DnsQueryContextMap
pack-priv DnsQueryContext

Returns:

The context or null if none could be removed.
remove
(InetSocketAddress
The InetSocketAddress of the nameserver.
nameServerAddr
,
int
The id that identifies the DnsQueryContext and was used for the query.
id
)

Remove the DnsQueryContext for the given InetSocketAddress and id or null if none could be found.

private static Inet6Address
private static Inet4Address
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mapback to summary
private final Map<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 corresponding DnsQueryContext.

Constructor Detail

DnsQueryContextManagerback to summary
pack-priv DnsQueryContextManager()

Method Detail

addback to summary
pack-priv int add(InetSocketAddress nameServerAddr, DnsQueryContext qCtx)

Add DnsQueryContext 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:InetSocketAddress

The InetSocketAddress of the nameserver to query.

qCtx:DnsQueryContext

The {@link DnsQueryContext to store.

Returns:int

the ID that should be used or -1 if none could be generated.

getback to summary
pack-priv DnsQueryContext get(InetSocketAddress nameServerAddr, int id)

Return the DnsQueryContext for the given InetSocketAddress and id or null if none could be found.

Parameters
nameServerAddr:InetSocketAddress

The InetSocketAddress of the nameserver.

id:int

The id that identifies the DnsQueryContext and was used for the query.

Returns:DnsQueryContext

The context or null if none could be found.

getContextMapback to summary
private DnsQueryContextManager.DnsQueryContextMap getContextMap(InetSocketAddress nameServerAddr)
getOrCreateContextMapback to summary
private DnsQueryContextManager.DnsQueryContextMap getOrCreateContextMap(InetSocketAddress nameServerAddr)
removeback to summary
pack-priv DnsQueryContext remove(InetSocketAddress nameServerAddr, int id)

Remove the DnsQueryContext for the given InetSocketAddress and id or null if none could be found.

Parameters
nameServerAddr:InetSocketAddress

The InetSocketAddress of the nameserver.

id:int

The id that identifies the DnsQueryContext and was used for the query.

Returns:DnsQueryContext

The context or null if none could be removed.

toCompactAddressback to summary
private static Inet6Address toCompactAddress(Inet4Address a4)
toIPv4Addressback to summary
private static Inet4Address toIPv4Address(Inet6Address a6)
io.netty.resolver.dns back to summary

private final Class DnsQueryContextManager.DnsQueryContextMap

extends Object
Class Inheritance
  • java.lang.Object
  • io.netty.resolver.dns.DnsQueryContextManager.DnsQueryContextMap

Field Summary

Modifier and TypeField and Description
private final DnsQueryIdSpace
private final IntObjectMap<DnsQueryContext>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv synchronized int
pack-priv synchronized DnsQueryContext
get(int id)

pack-priv synchronized DnsQueryContext
remove(int id)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

idSpaceback to summary
private final DnsQueryIdSpace idSpace
mapback to summary
private final IntObjectMap<DnsQueryContext> map

Constructor Detail

DnsQueryContextMapback to summary
private DnsQueryContextMap()

Method Detail

addback to summary
pack-priv synchronized int add(DnsQueryContext ctx)
getback to summary
pack-priv synchronized DnsQueryContext get(int id)
removeback to summary
pack-priv synchronized DnsQueryContext remove(int id)