public final class DefaultDnsServiceDiscovererBuilder
extends java.lang.Object
ServiceDiscoverer
which will attempt to
resolve A
, AAAA
, CNAME
, and SRV
type queries.Constructor and Description |
---|
DefaultDnsServiceDiscovererBuilder() |
Modifier and Type | Method and Description |
---|---|
ServiceDiscoverer<HostAndPort,java.net.InetSocketAddress,ServiceDiscovererEvent<java.net.InetSocketAddress>> |
buildARecordDiscoverer()
Build a new
ServiceDiscoverer which targets
host addresses (e.g. |
ServiceDiscoverer<java.lang.String,java.net.InetSocketAddress,ServiceDiscovererEvent<java.net.InetSocketAddress>> |
buildSrvDiscoverer()
|
DefaultDnsServiceDiscovererBuilder |
dnsResolverAddressTypes(DnsResolverAddressTypes dnsResolverAddressTypes)
Sets the list of the protocol families of the address resolved.
|
DefaultDnsServiceDiscovererBuilder |
dnsServerAddressStreamProvider(DnsServerAddressStreamProvider dnsServerAddressStreamProvider)
Set the
DnsServerAddressStreamProvider which determines which DNS server should be used per query. |
DefaultDnsServiceDiscovererBuilder |
ioExecutor(IoExecutor ioExecutor)
Sets the
IoExecutor . |
DefaultDnsServiceDiscovererBuilder |
maxUdpPayloadSize(int maxUdpPayloadSize)
Set the maximum size of the receiving UDP datagram (in bytes).
|
DefaultDnsServiceDiscovererBuilder |
minTTL(int minTTLSeconds)
The minimum allowed TTL.
|
DefaultDnsServiceDiscovererBuilder |
ndots(int ndots)
Set the number of dots which must appear in a name before an initial absolute query is made.
|
DefaultDnsServiceDiscovererBuilder |
observer(DnsServiceDiscovererObserver observer)
Sets a
DnsServiceDiscovererObserver that provides visibility into
DNS ServiceDiscoverer built by this builder. |
DefaultDnsServiceDiscovererBuilder |
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.
|
DefaultDnsServiceDiscovererBuilder |
queryTimeout(java.time.Duration queryTimeout)
Sets the timeout of each DNS query performed by this service discoverer.
|
public DefaultDnsServiceDiscovererBuilder minTTL(int minTTLSeconds)
minTTLSeconds
- The minimum amount of time a cache entry will be considered valid (in seconds).this
.public DefaultDnsServiceDiscovererBuilder dnsServerAddressStreamProvider(@Nullable DnsServerAddressStreamProvider dnsServerAddressStreamProvider)
DnsServerAddressStreamProvider
which determines which DNS server should be used per query.dnsServerAddressStreamProvider
- the DnsServerAddressStreamProvider
which determines which DNS
server should be used per query.this
.public DefaultDnsServiceDiscovererBuilder optResourceEnabled(boolean optResourceEnabled)
optResourceEnabled
- if optional records inclusion is enabled.this
.public DefaultDnsServiceDiscovererBuilder maxUdpPayloadSize(int maxUdpPayloadSize)
If the DNS response exceeds this amount the request will be automatically retried via TCP.
maxUdpPayloadSize
- the maximum size of the receiving UDP datagram (in bytes)this
.public DefaultDnsServiceDiscovererBuilder ndots(int ndots)
ndots
- the ndots value.this
.public DefaultDnsServiceDiscovererBuilder queryTimeout(java.time.Duration queryTimeout)
queryTimeout
- the query timeout valuethis
.public DefaultDnsServiceDiscovererBuilder dnsResolverAddressTypes(@Nullable DnsResolverAddressTypes dnsResolverAddressTypes)
dnsResolverAddressTypes
- the address types.this
.public DefaultDnsServiceDiscovererBuilder ioExecutor(IoExecutor ioExecutor)
IoExecutor
.ioExecutor
- IoExecutor
to use.this
.public DefaultDnsServiceDiscovererBuilder observer(DnsServiceDiscovererObserver observer)
DnsServiceDiscovererObserver
that provides visibility into
DNS ServiceDiscoverer
built by this builder.observer
- a DnsServiceDiscovererObserver
that provides visibility into
DNS ServiceDiscoverer
built by this builderthis
.public ServiceDiscoverer<java.lang.String,java.net.InetSocketAddress,ServiceDiscovererEvent<java.net.InetSocketAddress>> buildSrvDiscoverer()
ServiceDiscoverer
which queries
SRV Resource Records corresponding to serviceName
. For
each SRV answer capture the Port and resolve the Target.ServiceDiscoverer
which queries
SRV Resource Records corresponding to serviceName
. For
each SRV answer capture the Port and resolve the Target.public ServiceDiscoverer<HostAndPort,java.net.InetSocketAddress,ServiceDiscovererEvent<java.net.InetSocketAddress>> buildARecordDiscoverer()
ServiceDiscoverer
which targets
host addresses (e.g. A or AAAA records) and uses
a fixed port derived from the HostAndPort
.ServiceDiscoverer
which targets
host addresses (e.g. A or AAAA records) and uses
a fixed port derived from the HostAndPort
.