@UnstableApi public final class DnsNameResolverBuilder extends Object
DnsNameResolver
builder.Constructor and Description |
---|
DnsNameResolverBuilder(EventLoop eventLoop)
Creates a new builder.
|
Modifier and Type | Method and Description |
---|---|
DnsNameResolverBuilder |
authoritativeDnsServerCache(DnsCache authoritativeDnsServerCache)
Sets the cache for authoritative NS servers
|
DnsNameResolver |
build()
Returns a new
DnsNameResolver instance. |
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. |
static ResolvedAddressTypes |
computeResolvedAddressTypes(InternetProtocolFamily... internetProtocolFamilies)
Compute a
ResolvedAddressTypes from some InternetProtocolFamily s. |
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 |
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.
|
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 |
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 channelFactory(ChannelFactory<? extends DatagramChannel> channelFactory)
ChannelFactory
that will create a DatagramChannel
.channelFactory
- the ChannelFactory
this
public DnsNameResolverBuilder channelType(Class<? extends DatagramChannel> channelType)
ChannelFactory
as a ReflectiveChannelFactory
of this type.
Use as an alternative to channelFactory(ChannelFactory)
.channelType
- the typethis
public DnsNameResolverBuilder resolveCache(DnsCache resolveCache)
resolveCache
- the DNS resolution results cachethis
public DnsNameResolverBuilder dnsQueryLifecycleObserverFactory(DnsQueryLifecycleObserverFactory lifecycleObserverFactory)
lifecycleObserverFactory
- the factory used to generate objects which can observe individual DNS queries.this
public DnsNameResolverBuilder authoritativeDnsServerCache(DnsCache authoritativeDnsServerCache)
authoritativeDnsServerCache
- the authoritative NS servers cachethis
public 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 TTLthis
public DnsNameResolverBuilder negativeTtl(int negativeTtl)
negativeTtl
- the TTL for failed cached queriesthis
public DnsNameResolverBuilder queryTimeoutMillis(long queryTimeoutMillis)
queryTimeoutMillis
- the query timeoutthis
public static ResolvedAddressTypes computeResolvedAddressTypes(InternetProtocolFamily... internetProtocolFamilies)
ResolvedAddressTypes
from some InternetProtocolFamily
s.
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 InternetProtocolFamily
sResolvedAddressTypes
public DnsNameResolverBuilder resolvedAddressTypes(ResolvedAddressTypes resolvedAddressTypes)
computeResolvedAddressTypes(InternetProtocolFamily...)
to get a ResolvedAddressTypes
out of some InternetProtocolFamily
s.resolvedAddressTypes
- the address typesthis
public DnsNameResolverBuilder recursionDesired(boolean recursionDesired)
recursionDesired
- true if recursion is desiredthis
public DnsNameResolverBuilder maxQueriesPerResolve(int maxQueriesPerResolve)
maxQueriesPerResolve
- the max number of queriesthis
public DnsNameResolverBuilder traceEnabled(boolean traceEnabled)
traceEnabled
- true if trace is enabledthis
public DnsNameResolverBuilder maxPayloadSize(int maxPayloadSize)
4096
bytes.maxPayloadSize
- the capacity of the datagram packet bufferthis
public DnsNameResolverBuilder optResourceEnabled(boolean optResourceEnabled)
optResourceEnabled
- if optional records inclusion is enabledthis
public DnsNameResolverBuilder hostsFileEntriesResolver(HostsFileEntriesResolver hostsFileEntriesResolver)
hostsFileEntriesResolver
- the HostsFileEntriesResolver
used to first check
if the hostname is locally aliased.this
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 domainsthis
public DnsNameResolverBuilder ndots(int ndots)
1
.ndots
- the ndots valuethis
public DnsNameResolverBuilder decodeIdn(boolean decodeIdn)
decodeIdn
- if should get decodedthis
public DnsNameResolver build()
DnsNameResolver
instance.DnsNameResolver
Copyright © 2008–2017 The Netty Project. All rights reserved.