DnsServiceDiscovererBuilder
instead.@Deprecated public final class DefaultDnsServiceDiscovererBuilder extends Object implements DnsServiceDiscovererBuilder
ServiceDiscoverer which will attempt to
resolve A, AAAA, CNAME, and SRV type queries.| Constructor and Description |
|---|
DefaultDnsServiceDiscovererBuilder()
Deprecated.
use
DnsServiceDiscoverers.builder(String) instead. |
| Modifier and Type | Method and Description |
|---|---|
ServiceDiscoverer<HostAndPort,InetSocketAddress,ServiceDiscovererEvent<InetSocketAddress>> |
buildARecordDiscoverer()
Deprecated.
Build a new
ServiceDiscoverer which targets
host addresses (e.g. |
ServiceDiscoverer<String,InetSocketAddress,ServiceDiscovererEvent<InetSocketAddress>> |
buildSrvDiscoverer()
Deprecated.
|
DefaultDnsServiceDiscovererBuilder |
consolidateCacheSize(int consolidateCacheSize)
Deprecated.
Set the maximum size of the cache that is used to consolidate concurrent lookups for different hostnames.
|
DefaultDnsServiceDiscovererBuilder |
dnsResolverAddressTypes(DnsResolverAddressTypes dnsResolverAddressTypes)
Deprecated.
Sets the list of the protocol families of the address resolved.
|
DefaultDnsServiceDiscovererBuilder |
dnsServerAddressStreamProvider(DnsServerAddressStreamProvider dnsServerAddressStreamProvider)
Deprecated.
Set the
DnsServerAddressStreamProvider which determines which DNS server should be used per query. |
DefaultDnsServiceDiscovererBuilder |
ioExecutor(IoExecutor ioExecutor)
Deprecated.
Sets the
IoExecutor. |
DefaultDnsServiceDiscovererBuilder |
localAddress(SocketAddress localAddress)
Deprecated.
Set the local
SocketAddress to bind to. |
DefaultDnsServiceDiscovererBuilder |
maxUdpPayloadSize(int maxUdpPayloadSize)
Deprecated.
Set the maximum size of the receiving UDP datagram (in bytes).
|
DefaultDnsServiceDiscovererBuilder |
minTTL(int minTTLSeconds)
Deprecated.
Use
ttl(int, int). |
DefaultDnsServiceDiscovererBuilder |
missingRecordStatus(ServiceDiscovererEvent.Status status)
Deprecated.
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)
Deprecated.
Set the number of dots which must appear in a name before an initial absolute query is made.
|
DefaultDnsServiceDiscovererBuilder |
observer(DnsServiceDiscovererObserver observer)
Deprecated.
Sets a
DnsServiceDiscovererObserver that provides visibility into
DNS ServiceDiscoverer built by this builder. |
DefaultDnsServiceDiscovererBuilder |
optResourceEnabled(boolean optResourceEnabled)
Deprecated.
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)
Deprecated.
Sets the timeout of each DNS query performed by this service discoverer.
|
DefaultDnsServiceDiscovererBuilder |
ttl(int minSeconds,
int maxSeconds)
Deprecated.
Controls min/max TTL values that will influence polling intervals.
|
DefaultDnsServiceDiscovererBuilder |
ttl(int minSeconds,
int maxSeconds,
int minCacheSeconds,
int maxCacheSeconds)
Deprecated.
Controls min/max TTL values that will affect polling intervals and local caching.
|
DefaultDnsServiceDiscovererBuilder |
ttl(int minSeconds,
int maxSeconds,
int minCacheSeconds,
int maxCacheSeconds,
int negativeTTLCacheSeconds)
Deprecated.
Controls min/max TTL values that will affect polling intervals, local caching, and caching negative results.
|
DefaultDnsServiceDiscovererBuilder |
ttlJitter(Duration ttlJitter)
Deprecated.
The jitter to apply for scheduling the next query after TTL to help spread out subsequent DNS queries.
|
@Deprecated public DefaultDnsServiceDiscovererBuilder()
DnsServiceDiscoverers.builder(String) instead.DefaultDnsServiceDiscovererBuilder.public DefaultDnsServiceDiscovererBuilder consolidateCacheSize(int consolidateCacheSize)
DnsServiceDiscovererBuilderThis means if multiple lookups are done for the same hostname and still in-flight, only one actual query will be made and the result will be cascaded to the others.
consolidateCacheSize in interface DnsServiceDiscovererBuilderconsolidateCacheSize - The maximum number of different hostnames for consolidation of concurrent lookups, or
0 if no consolidation should be performed.this.@Deprecated public DefaultDnsServiceDiscovererBuilder minTTL(int minTTLSeconds)
ttl(int, int).minTTLSeconds - The minimum amount of time a cache entry will be considered valid (in seconds).this.public DefaultDnsServiceDiscovererBuilder ttl(int minSeconds, int maxSeconds)
DnsServiceDiscovererBuilder
The created ServiceDiscoverer polls DNS server based on TTL value of the resolved records. Min/max values
help to make sure polling stays within reasonable boundaries. Too frequent DNS queries may generate too much load
for the DNS server, too rare DNS queries may lead to incorrect state if the remote servers changed IPs before
original TTL expired.
With this overload, there will be no local caching for resolved records.
ttl in interface DnsServiceDiscovererBuilderminSeconds - The minimum about of time the result will be considered valid (in seconds), must be greater
than 0.maxSeconds - The maximum about of time the result will be considered valid (in seconds), must be greater
than or equal to minSeconds.this.DnsServiceDiscovererBuilder.ttl(int, int, int, int),
DnsServiceDiscovererBuilder.ttl(int, int, int, int, int)public DefaultDnsServiceDiscovererBuilder ttl(int minSeconds, int maxSeconds, int minCacheSeconds, int maxCacheSeconds)
DnsServiceDiscovererBuilder
The created ServiceDiscoverer polls DNS server based on TTL value of the resolved records. Min/max values
help to make sure polling stays within reasonable boundaries. Too frequent DNS queries may generate too much load
for the DNS server, too rare DNS queries may lead to incorrect state if the remote servers changed IPs before
original TTL expired.
The second min/max pair controls for how long the resolved records should be cached locally. Cache is helpful in scenarios when multiple concurrent resolutions are possible for the same address: either an application runs multiple client instances for the same hostname or clients perform DNS resolutions per new connection instead of background polling.
ttl in interface DnsServiceDiscovererBuilderminSeconds - The minimum about of time the result will be considered valid (in seconds), must be greater
than 0.maxSeconds - The maximum about of time the result will be considered valid (in seconds), must be greater
than or equal to minSeconds.minCacheSeconds - The minimum about of time the result will be cached locally (in seconds), must be greater
than or equal to 0, and less than or equal to minSeconds.maxCacheSeconds - The maximum about of time the result will be cached locally (in seconds), must be greater
than or equal to minCacheSeconds, and less than or equal to maxSeconds.this.DnsServiceDiscovererBuilder.ttl(int, int),
DnsServiceDiscovererBuilder.ttl(int, int, int, int, int)public DefaultDnsServiceDiscovererBuilder ttl(int minSeconds, int maxSeconds, int minCacheSeconds, int maxCacheSeconds, int negativeTTLCacheSeconds)
DnsServiceDiscovererBuilder
The created ServiceDiscoverer polls DNS server based on TTL value of the resolved records. Min/max values
help to make sure polling stays within reasonable boundaries. Too frequent DNS queries may generate too much load
for the DNS server, too rare DNS queries may lead to incorrect state if the remote servers changed IPs before
original TTL expired.
The second min/max pair controls for how long the resolved records should be cached locally. Cache is helpful in scenarios when multiple concurrent resolutions are possible for the same address: either an application runs multiple client instances for the same hostname or clients perform DNS resolutions per new connection instead of background polling.
ttl in interface DnsServiceDiscovererBuilderminSeconds - The minimum about of time the result will be considered valid (in seconds), must be greater
than 0.maxSeconds - The maximum about of time the result will be considered valid (in seconds), must be greater
than or equal to minSeconds.minCacheSeconds - The minimum about of time the result will be cached locally (in seconds), must be greater
than or equal to 0, and less than or equal to minSeconds.maxCacheSeconds - The maximum about of time the result will be cached locally (in seconds), must be greater
than or equal to minCacheSeconds, and less than or equal to maxSeconds.negativeTTLCacheSeconds - The amount of time an unsuccessful (failed) result will be cached locally (in
seconds), must be greater than or equal to 0. If other overloads are used, the default value will
recognize the standard Java system property networkaddress.cache.negative.ttl,
like InetAddress does.this.DnsServiceDiscovererBuilder.ttl(int, int),
DnsServiceDiscovererBuilder.ttl(int, int, int, int)public DefaultDnsServiceDiscovererBuilder ttlJitter(Duration ttlJitter)
DnsServiceDiscovererBuilderThe jitter value will be added on top of the TTL value returned from the DNS server to avoid hitting the cache.
ttlJitter in interface DnsServiceDiscovererBuilderttlJitter - The jitter to apply to schedule the next query after TTL.this.public DefaultDnsServiceDiscovererBuilder localAddress(@Nullable SocketAddress localAddress)
DnsServiceDiscovererBuilderSocketAddress to bind to.localAddress in interface DnsServiceDiscovererBuilderlocalAddress - the local SocketAddress to bind to or null to skip binding. When specified,
all DNS queries will be sent from the specified address. When skipped, OS will automatically bind before sending
frames but address won't be available in logs.this.public DefaultDnsServiceDiscovererBuilder dnsServerAddressStreamProvider(@Nullable DnsServerAddressStreamProvider dnsServerAddressStreamProvider)
DnsServiceDiscovererBuilderDnsServerAddressStreamProvider which determines which DNS server should be used per query.dnsServerAddressStreamProvider in interface DnsServiceDiscovererBuilderdnsServerAddressStreamProvider - the DnsServerAddressStreamProvider which determines which DNS
server should be used per query.this.public DefaultDnsServiceDiscovererBuilder optResourceEnabled(boolean optResourceEnabled)
DnsServiceDiscovererBuilderoptResourceEnabled in interface DnsServiceDiscovererBuilderoptResourceEnabled - if optional records inclusion is enabled.this.public DefaultDnsServiceDiscovererBuilder maxUdpPayloadSize(int maxUdpPayloadSize)
DnsServiceDiscovererBuilderIf the DNS response exceeds this amount the request will be automatically retried via TCP.
maxUdpPayloadSize in interface DnsServiceDiscovererBuildermaxUdpPayloadSize - the maximum size of the receiving UDP datagram (in bytes)this.public DefaultDnsServiceDiscovererBuilder ndots(int ndots)
DnsServiceDiscovererBuilderndots in interface DnsServiceDiscovererBuilderndots - the ndots value.this.public DefaultDnsServiceDiscovererBuilder queryTimeout(Duration queryTimeout)
DnsServiceDiscovererBuilderqueryTimeout in interface DnsServiceDiscovererBuilderqueryTimeout - the query timeout valuethis.public DefaultDnsServiceDiscovererBuilder dnsResolverAddressTypes(@Nullable DnsResolverAddressTypes dnsResolverAddressTypes)
DnsServiceDiscovererBuilderdnsResolverAddressTypes in interface DnsServiceDiscovererBuilderdnsResolverAddressTypes - the address types or null to use the default value, based on "java.net"
system properties: java.net.preferIPv4Stack and java.net.preferIPv6Stack.this.public DefaultDnsServiceDiscovererBuilder ioExecutor(IoExecutor ioExecutor)
DnsServiceDiscovererBuilderIoExecutor.ioExecutor in interface DnsServiceDiscovererBuilderioExecutor - IoExecutor to use.this.public DefaultDnsServiceDiscovererBuilder observer(DnsServiceDiscovererObserver observer)
DnsServiceDiscovererBuilderDnsServiceDiscovererObserver that provides visibility into
DNS ServiceDiscoverer built by this builder.observer in interface DnsServiceDiscovererBuilderobserver - a DnsServiceDiscovererObserver that provides visibility into
DNS ServiceDiscoverer built by this builderthis.public DefaultDnsServiceDiscovererBuilder missingRecordStatus(ServiceDiscovererEvent.Status status)
DnsServiceDiscovererBuilderServiceDiscovererEvent.Status to use in ServiceDiscovererEvent.status() when a record
for a previously seen address is missing in the response.missingRecordStatus in interface DnsServiceDiscovererBuilderstatus - a ServiceDiscovererEvent.Status for missing records.this.public ServiceDiscoverer<String,InetSocketAddress,ServiceDiscovererEvent<InetSocketAddress>> buildSrvDiscoverer()
DnsServiceDiscovererBuilderServiceDiscoverer which queries
SRV Resource Records corresponding to serviceName. For
each SRV answer capture the Port and resolve the Target.buildSrvDiscoverer in interface DnsServiceDiscovererBuilderServiceDiscoverer 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()
DnsServiceDiscovererBuilderServiceDiscoverer which targets
host addresses (e.g. A or AAAA records) and uses
a fixed port derived from the HostAndPort.buildARecordDiscoverer in interface DnsServiceDiscovererBuilderServiceDiscoverer which targets
host addresses (e.g. A or AAAA records) and uses
a fixed port derived from the HostAndPort.