@UnstableApi
public final class DnsNameResolverBuilder
extends java.lang.Object
DnsNameResolver builder.| Constructor and Description |
|---|
DnsNameResolverBuilder()
Creates a new builder.
|
DnsNameResolverBuilder(EventLoop eventLoop)
Creates a new builder.
|
| Modifier and Type | Method and Description |
|---|---|
DnsNameResolverBuilder |
authoritativeDnsServerCache(AuthoritativeDnsServerCache authoritativeDnsServerCache)
Sets the cache for authoritative NS servers
|
DnsNameResolverBuilder |
authoritativeDnsServerCache(DnsCache authoritativeDnsServerCache)
Deprecated.
|
DnsNameResolver |
build()
Returns a new
DnsNameResolver instance. |
protected ChannelFactory<? extends DatagramChannel> |
channelFactory() |
DnsNameResolverBuilder |
channelFactory(ChannelFactory<? extends DatagramChannel> channelFactory)
Sets the
ChannelFactory that will create a DatagramChannel. |
DnsNameResolverBuilder |
channelType(java.lang.Class<? extends DatagramChannel> channelType)
Sets the
ChannelFactory as a ReflectiveChannelFactory of this type. |
DnsNameResolverBuilder |
cnameCache(DnsCnameCache cnameCache)
Sets the cache for
CNAME mappings. |
static ResolvedAddressTypes |
computeResolvedAddressTypes(InternetProtocolFamily... internetProtocolFamilies)
Compute a
ResolvedAddressTypes from some InternetProtocolFamilys. |
DnsNameResolverBuilder |
copy()
Creates a copy of this
DnsNameResolverBuilder |
DnsNameResolverBuilder |
decodeIdn(boolean decodeIdn)
Set if domain / host names should be decoded to unicode when received.
|
DnsNameResolverBuilder |
dnsQueryLifecycleObserverFactory(DnsQueryLifecycleObserverFactory lifecycleObserverFactory)
Set the factory used to generate objects which can observe individual DNS queries.
|
DnsNameResolverBuilder |
eventLoop(EventLoop eventLoop)
Sets the
EventLoop which will perform the communication with the DNS servers. |
DnsNameResolverBuilder |
hostsFileEntriesResolver(HostsFileEntriesResolver hostsFileEntriesResolver) |
DnsNameResolverBuilder |
maxPayloadSize(int maxPayloadSize)
Sets the capacity of the datagram packet buffer (in bytes).
|
DnsNameResolverBuilder |
maxQueriesPerResolve(int maxQueriesPerResolve)
Sets the maximum allowed number of DNS queries to send when resolving a host name.
|
protected DnsServerAddressStreamProvider |
nameServerProvider() |
DnsNameResolverBuilder |
nameServerProvider(DnsServerAddressStreamProvider dnsServerAddressStreamProvider)
Set the
DnsServerAddressStreamProvider which is used to determine which DNS server is used to resolve
each hostname. |
DnsNameResolverBuilder |
ndots(int ndots)
Set the number of dots which must appear in a name before an initial absolute query is made.
|
DnsNameResolverBuilder |
negativeTtl(int negativeTtl)
Sets the TTL of the cache for the failed DNS queries (in seconds).
|
DnsNameResolverBuilder |
optResourceEnabled(boolean optResourceEnabled)
Enable the automatic inclusion of a optional records that tries to give the remote DNS server a hint about
how much data the resolver can read per response.
|
DnsNameResolverBuilder |
queryTimeoutMillis(long queryTimeoutMillis)
Sets the timeout of each DNS query performed by this resolver (in milliseconds).
|
DnsNameResolverBuilder |
recursionDesired(boolean recursionDesired)
Sets if this resolver has to send a DNS query with the RD (recursion desired) flag set.
|
DnsNameResolverBuilder |
resolveCache(DnsCache resolveCache)
Sets the cache for resolution results.
|
DnsNameResolverBuilder |
resolvedAddressTypes(ResolvedAddressTypes resolvedAddressTypes)
Sets the list of the protocol families of the address resolved.
|
DnsNameResolverBuilder |
searchDomains(java.lang.Iterable<java.lang.String> searchDomains)
Set the list of search domains of the resolver.
|
DnsNameResolverBuilder |
traceEnabled(boolean traceEnabled)
Sets if this resolver should generate the detailed trace information in an exception message so that
it is easier to understand the cause of resolution failure.
|
DnsNameResolverBuilder |
ttl(int minTtl,
int maxTtl)
Sets the minimum and maximum TTL of the cached DNS resource records (in seconds).
|
public DnsNameResolverBuilder eventLoop(EventLoop eventLoop)
EventLoop which will perform the communication with the DNS servers.eventLoop - the EventLoopthisprotected ChannelFactory<? extends DatagramChannel> channelFactory()
public DnsNameResolverBuilder channelFactory(ChannelFactory<? extends DatagramChannel> channelFactory)
ChannelFactory that will create a DatagramChannel.channelFactory - the ChannelFactorythispublic DnsNameResolverBuilder channelType(java.lang.Class<? extends DatagramChannel> channelType)
ChannelFactory as a ReflectiveChannelFactory of this type.
Use as an alternative to channelFactory(ChannelFactory).channelType - the typethispublic DnsNameResolverBuilder resolveCache(DnsCache resolveCache)
resolveCache - the DNS resolution results cachethispublic DnsNameResolverBuilder cnameCache(DnsCnameCache cnameCache)
CNAME mappings.cnameCache - the cache used to cache CNAME mappings for a domain.thispublic DnsNameResolverBuilder dnsQueryLifecycleObserverFactory(DnsQueryLifecycleObserverFactory lifecycleObserverFactory)
lifecycleObserverFactory - the factory used to generate objects which can observe individual DNS queries.this@Deprecated public DnsNameResolverBuilder authoritativeDnsServerCache(DnsCache authoritativeDnsServerCache)
authoritativeDnsServerCache(AuthoritativeDnsServerCache)authoritativeDnsServerCache - the authoritative NS servers cachethispublic DnsNameResolverBuilder authoritativeDnsServerCache(AuthoritativeDnsServerCache authoritativeDnsServerCache)
authoritativeDnsServerCache - the authoritative NS servers cachethispublic DnsNameResolverBuilder ttl(int minTtl, int maxTtl)
0 and Integer.MAX_VALUE, which practically tells this resolver to
respect the TTL from the DNS server.minTtl - the minimum TTLmaxTtl - the maximum TTLthispublic DnsNameResolverBuilder negativeTtl(int negativeTtl)
negativeTtl - the TTL for failed cached queriesthispublic DnsNameResolverBuilder queryTimeoutMillis(long queryTimeoutMillis)
queryTimeoutMillis - the query timeoutthispublic static ResolvedAddressTypes computeResolvedAddressTypes(InternetProtocolFamily... internetProtocolFamilies)
ResolvedAddressTypes from some InternetProtocolFamilys.
An empty input will return the default value, based on "java.net" System properties.
Valid inputs are (), (IPv4), (IPv6), (Ipv4, IPv6) and (IPv6, IPv4).internetProtocolFamilies - a valid sequence of InternetProtocolFamilysResolvedAddressTypespublic DnsNameResolverBuilder resolvedAddressTypes(ResolvedAddressTypes resolvedAddressTypes)
computeResolvedAddressTypes(InternetProtocolFamily...)
to get a ResolvedAddressTypes out of some InternetProtocolFamilys.resolvedAddressTypes - the address typesthispublic DnsNameResolverBuilder recursionDesired(boolean recursionDesired)
recursionDesired - true if recursion is desiredthispublic DnsNameResolverBuilder maxQueriesPerResolve(int maxQueriesPerResolve)
maxQueriesPerResolve - the max number of queriesthispublic DnsNameResolverBuilder traceEnabled(boolean traceEnabled)
traceEnabled - true if trace is enabledthispublic DnsNameResolverBuilder maxPayloadSize(int maxPayloadSize)
4096 bytes.maxPayloadSize - the capacity of the datagram packet bufferthispublic DnsNameResolverBuilder optResourceEnabled(boolean optResourceEnabled)
optResourceEnabled - if optional records inclusion is enabledthispublic DnsNameResolverBuilder hostsFileEntriesResolver(HostsFileEntriesResolver hostsFileEntriesResolver)
hostsFileEntriesResolver - the HostsFileEntriesResolver used to first check
if the hostname is locally aliased.thisprotected DnsServerAddressStreamProvider nameServerProvider()
public DnsNameResolverBuilder nameServerProvider(DnsServerAddressStreamProvider dnsServerAddressStreamProvider)
DnsServerAddressStreamProvider which is used to determine which DNS server is used to resolve
each hostname.this.public DnsNameResolverBuilder searchDomains(java.lang.Iterable<java.lang.String> searchDomains)
searchDomains - the search domainsthispublic DnsNameResolverBuilder ndots(int ndots)
1.ndots - the ndots valuethispublic DnsNameResolverBuilder decodeIdn(boolean decodeIdn)
decodeIdn - if should get decodedthispublic DnsNameResolver build()
DnsNameResolver instance.DnsNameResolverpublic DnsNameResolverBuilder copy()
DnsNameResolverBuilderDnsNameResolverBuilderCopyright © 2008–2019 The Netty Project. All rights reserved.