public final class DnsNameResolverBuilder extends 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(Class<? extends DatagramChannel> channelType)
Sets the
ChannelFactory as a ReflectiveChannelFactory of this type. |
DnsNameResolverBuilder |
cnameCache(DnsCnameCache cnameCache)
Sets the cache for
CNAME mappings. |
DnsNameResolverBuilder |
completeOncePreferredResolved(boolean completeOncePreferredResolved)
If
true SimpleNameResolver.resolveAll(String) will notify the returned Future as
soon as all queries for the preferred address-type are complete. |
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 |
localAddress(SocketAddress localAddress)
Configure the address that will be used to bind too.
|
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(Iterable<String> searchDomains)
Set the list of search domains of the resolver.
|
DnsNameResolverBuilder |
socketChannelFactory(ChannelFactory<? extends SocketChannel> channelFactory)
|
DnsNameResolverBuilder |
socketChannelType(Class<? extends SocketChannel> channelType)
|
DnsNameResolverBuilder |
traceEnabled(boolean traceEnabled)
Deprecated.
Prefer to configure
a
LoggingDnsQueryLifeCycleObserverFactory instead. |
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(Class<? extends DatagramChannel> channelType)
ChannelFactory as a ReflectiveChannelFactory of this type.
Use as an alternative to channelFactory(ChannelFactory).channelType - the typethispublic DnsNameResolverBuilder socketChannelFactory(ChannelFactory<? extends SocketChannel> channelFactory)
channelFactory - the ChannelFactory or null
if TCP fallback should not be supported.thispublic DnsNameResolverBuilder socketChannelType(Class<? extends SocketChannel> channelType)
ChannelFactory as a ReflectiveChannelFactory of this type for
TCP fallback if needed.
Use as an alternative to socketChannelFactory(ChannelFactory).channelType - the type or null if TCP fallback
should not be supported.thispublic 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 localAddress(SocketAddress localAddress)
localAddress - the bind addressthispublic 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 completeOncePreferredResolved(boolean completeOncePreferredResolved)
true SimpleNameResolver.resolveAll(String) will notify the returned Future as
soon as all queries for the preferred address-type are complete.completeOncePreferredResolved - true to enable, false to disable.thispublic DnsNameResolverBuilder recursionDesired(boolean recursionDesired)
recursionDesired - true if recursion is desiredthispublic DnsNameResolverBuilder maxQueriesPerResolve(int maxQueriesPerResolve)
maxQueriesPerResolve - the max number of queriesthis@Deprecated public DnsNameResolverBuilder traceEnabled(boolean traceEnabled)
LoggingDnsQueryLifeCycleObserverFactory instead.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(Iterable<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–2021 The Netty Project. All rights reserved.