public final class DnsNameResolverBuilder extends Object
DnsNameResolver builder.| Constructor and Description |
|---|
DnsNameResolverBuilder(io.netty.channel.EventLoop eventLoop)
Creates a new builder.
|
| Modifier and Type | Method and Description |
|---|---|
DnsNameResolver |
build()
Returns a new
DnsNameResolver instance. |
DnsNameResolverBuilder |
channelFactory(io.netty.bootstrap.ChannelFactory<? extends io.netty.channel.socket.DatagramChannel> channelFactory)
Sets the
ChannelFactory that will create a DatagramChannel. |
DnsNameResolverBuilder |
channelType(Class<? extends io.netty.channel.socket.DatagramChannel> channelType)
Sets the
ChannelFactory as a ReflectiveChannelFactory of this type. |
DnsNameResolverBuilder |
hostsFileEntriesResolver(HostsFileEntriesResolver hostsFileEntriesResolver) |
DnsNameResolverBuilder |
localAddress(InetSocketAddress localAddress)
Sets the local address of the
DatagramChannel |
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 |
nameServerAddresses(DnsServerAddresses nameServerAddresses)
Sets the addresses of the DNS server.
|
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(io.netty.channel.socket.InternetProtocolFamily... resolvedAddressTypes)
Sets the list of the protocol families of the address resolved.
|
DnsNameResolverBuilder |
resolvedAddressTypes(Iterable<io.netty.channel.socket.InternetProtocolFamily> resolvedAddressTypes)
Sets the list of the protocol families of the address resolved.
|
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(io.netty.channel.EventLoop eventLoop)
eventLoop - the EventLoop the EventLoop which will perform the communication with the DNS
servers.public DnsNameResolverBuilder channelFactory(io.netty.bootstrap.ChannelFactory<? extends io.netty.channel.socket.DatagramChannel> channelFactory)
ChannelFactory that will create a DatagramChannel.channelFactory - the ChannelFactorythispublic DnsNameResolverBuilder channelType(Class<? extends io.netty.channel.socket.DatagramChannel> channelType)
ChannelFactory as a ReflectiveChannelFactory of this type.
Use as an alternative to channelFactory(ChannelFactory).channelType - the typethispublic DnsNameResolverBuilder localAddress(InetSocketAddress localAddress)
DatagramChannellocalAddress - the local addressthispublic DnsNameResolverBuilder nameServerAddresses(DnsServerAddresses nameServerAddresses)
nameServerAddresses - the DNS server addressesthispublic DnsNameResolverBuilder resolveCache(DnsCache resolveCache)
resolveCache - the DNS resolution results 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 DnsNameResolverBuilder resolvedAddressTypes(io.netty.channel.socket.InternetProtocolFamily... resolvedAddressTypes)
InternetProtocolFamily.IPv4 and InternetProtocolFamily.IPv6 are specified in
the order of preference. To enforce the resolve to retrieve the address of a specific protocol family,
specify only a single InternetProtocolFamily.resolvedAddressTypes - the address typesthispublic DnsNameResolverBuilder resolvedAddressTypes(Iterable<io.netty.channel.socket.InternetProtocolFamily> resolvedAddressTypes)
InternetProtocolFamily.IPv4 and InternetProtocolFamily.IPv6 are specified in
the order of preference. To enforce the resolve to retrieve the address of a specific protocol family,
specify only a single InternetProtocolFamily.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.thispublic DnsNameResolver build()
DnsNameResolver instance.DnsNameResolverCopyright © 2016. All Rights Reserved.