public final class DefaultDnsServiceDiscovererBuilder
extends 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,InetSocketAddress,ServiceDiscovererEvent<InetSocketAddress>> |
buildARecordDiscoverer()
Build a new
ServiceDiscoverer which targets
host addresses (e.g. |
ServiceDiscoverer<String,InetSocketAddress,ServiceDiscovererEvent<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 |
missingRecordStatus(ServiceDiscovererEvent.Status status)
Sets which
ServiceDiscovererEvent.Status to use in ServiceDiscovererEvent.status() when a record
for a previously seen address is missing in the response. |
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(Duration queryTimeout)
Sets the timeout of each DNS query performed by this service discoverer.
|
DefaultDnsServiceDiscovererBuilder |
ttlJitter(Duration ttlJitter)
The jitter to apply to schedule the next query after TTL.
|
public DefaultDnsServiceDiscovererBuilder minTTL(int minTTLSeconds)
minTTLSeconds - The minimum amount of time a cache entry will be considered valid (in seconds).this.public DefaultDnsServiceDiscovererBuilder ttlJitter(Duration ttlJitter)
The jitter value will be added on top of the TTL value returned from the DNS server to help spread out subsequent DNS queries.
ttlJitter - The jitter to apply to schedule the next query after TTL.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(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 DefaultDnsServiceDiscovererBuilder missingRecordStatus(ServiceDiscovererEvent.Status status)
ServiceDiscovererEvent.Status to use in ServiceDiscovererEvent.status() when a record
for a previously seen address is missing in the response.status - a ServiceDiscovererEvent.Status for missing records.this.public ServiceDiscoverer<String,InetSocketAddress,ServiceDiscovererEvent<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,InetSocketAddress,ServiceDiscovererEvent<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.