public final class NameResolverProvider extends Object
NameResolverProvider
will produce DnsAddressResolverGroup
.Modifier and Type | Class and Description |
---|---|
static interface |
NameResolverProvider.NameResolverSpec |
Modifier and Type | Method and Description |
---|---|
Supplier<? extends SocketAddress> |
bindAddressSupplier()
Returns the configured supplier of local address to bind to or null.
|
static NameResolverProvider.NameResolverSpec |
builder()
Creates a builder for
NameResolverProvider . |
Duration |
cacheMaxTimeToLive()
Returns the configured max time to live of the cached DNS resource records.
|
Duration |
cacheMinTimeToLive()
Returns the configured min time to live of the cached DNS resource records.
|
Duration |
cacheNegativeTimeToLive()
Returns the configured time to live of the cache for the failed DNS queries.
|
boolean |
equals(Object o) |
int |
hashCode() |
HostsFileEntriesResolver |
hostsFileEntriesResolver()
Returns the configured custom
HostsFileEntriesResolver to be used for hosts file entries or null. |
boolean |
isCompleteOncePreferredResolved()
Returns
true if the resolver notifies the returned Future as
soon as all queries for the preferred address type are complete. |
boolean |
isDisableOptionalRecord()
Returns
true if an optional record inclusion is disabled. |
boolean |
isDisableRecursionDesired()
Returns
true if recursion desired is disabled. |
boolean |
isPreferNative()
Returns
true if prefer native event loop and channel factory (e.g. |
boolean |
isRoundRobinSelection()
Returns true if
RoundRobinDnsAddressResolverGroup is in use. |
LoopResources |
loopResources()
Returns the configured
LoopResources or null. |
int |
maxPayloadSize()
Returns the configured capacity of the datagram packet buffer.
|
int |
maxQueriesPerResolve()
Returns the configured maximum allowed number of DNS queries to send when resolving a host name.
|
int |
ndots()
Returns the number of dots which must appear in a name before an initial absolute query is made.
|
DnsAddressResolverGroup |
newNameResolverGroup(LoopResources defaultLoopResources,
boolean defaultPreferNative)
Provides a new
DnsAddressResolverGroup . |
Duration |
queryTimeout()
Returns the configured timeout of each DNS query performed by this resolver.
|
DnsCache |
resolveCache()
Returns the configured DNS resolver cache or null.
|
ResolvedAddressTypes |
resolvedAddressTypes()
Returns the configured list of the protocol families of the address resolved or null.
|
Iterable<String> |
searchDomains()
Returns the configured list of search domains of the resolver or null.
|
public static NameResolverProvider.NameResolverSpec builder()
NameResolverProvider
.NameResolverProvider.NameResolverSpec
public Duration cacheMaxTimeToLive()
public Duration cacheMinTimeToLive()
public Duration cacheNegativeTimeToLive()
@Nullable public HostsFileEntriesResolver hostsFileEntriesResolver()
HostsFileEntriesResolver
to be used for hosts file entries or null.HostsFileEntriesResolver
to be used for hosts file entries or nullpublic boolean isCompleteOncePreferredResolved()
true
if the resolver notifies the returned Future
as
soon as all queries for the preferred address type are complete.true
if the resolver notifies the returned Future
as
soon as all queries for the preferred address type are completepublic boolean isDisableOptionalRecord()
true
if an optional record inclusion is disabled.true
if an optional record inclusion is disabledpublic boolean isDisableRecursionDesired()
true
if recursion desired is disabled.true
if recursion desired is disabledpublic boolean isPreferNative()
true
if prefer native event loop and channel factory (e.g. epoll or kqueue).true
if prefer native event loop and channel factory (e.g. epoll or kqueue)public boolean isRoundRobinSelection()
RoundRobinDnsAddressResolverGroup
is in use.RoundRobinDnsAddressResolverGroup
is in use@Nullable public LoopResources loopResources()
LoopResources
or null.LoopResources
or nullpublic int maxPayloadSize()
public int maxQueriesPerResolve()
public int ndots()
public Duration queryTimeout()
@Nullable public ResolvedAddressTypes resolvedAddressTypes()
@Nullable public DnsCache resolveCache()
@Nullable public Supplier<? extends SocketAddress> bindAddressSupplier()
@Nullable public Iterable<String> searchDomains()
public DnsAddressResolverGroup newNameResolverGroup(LoopResources defaultLoopResources, boolean defaultPreferNative)
DnsAddressResolverGroup
.defaultLoopResources
- the default LoopResources
when LoopResources
is not specifiedDnsAddressResolverGroup