public final class DefaultDnsServiceDiscovererBuilder
extends java.lang.Object
DefaultDnsServiceDiscoverer
.Constructor and Description |
---|
DefaultDnsServiceDiscovererBuilder() |
Modifier and Type | Method and Description |
---|---|
DefaultDnsServiceDiscovererBuilder |
appendFilter(ServiceDiscovererFilterFactory<java.lang.String,java.net.InetAddress,ServiceDiscovererEvent<java.net.InetAddress>> factory)
Append the filter to the chain of filters used to decorate the
ServiceDiscoverer created by this
builder. |
ServiceDiscoverer<HostAndPort,java.net.InetSocketAddress,ServiceDiscovererEvent<java.net.InetSocketAddress>> |
build()
Build a new instance of
ServiceDiscoverer<HostAndPort, InetSocketAddress> . |
ServiceDiscoverer<java.lang.String,java.net.InetAddress,ServiceDiscovererEvent<java.net.InetAddress>> |
buildInetDiscoverer()
Build a new instance of
ServiceDiscoverer<String, InetAddress> . |
java.util.function.Predicate<java.lang.Throwable> |
defaultInvalidateHostsOnDnsFailurePredicate()
Returns a default value for
invalidateHostsOnDnsFailure(Predicate) . |
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 |
invalidateHostsOnDnsFailure(java.util.function.Predicate<java.lang.Throwable> invalidateHostsOnDnsFailure)
Allows sending 'unavailable' events for all current active hosts for particular DNS errors.
|
DefaultDnsServiceDiscovererBuilder |
ioExecutor(IoExecutor ioExecutor)
Sets the
IoExecutor . |
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 |
noRetriesOnDnsFailures()
Do not perform retries if DNS lookup fails.
|
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 ndots(int ndots)
ndots
- the ndots value.this
.public DefaultDnsServiceDiscovererBuilder queryTimeout(java.time.Duration queryTimeout)
queryTimeout
- the query timeout valuethis
.public DefaultDnsServiceDiscovererBuilder invalidateHostsOnDnsFailure(java.util.function.Predicate<java.lang.Throwable> invalidateHostsOnDnsFailure)
Note: The default does not send 'unavailable' events when a DNS lookup times out.
invalidateHostsOnDnsFailure
- determines whether or not to send 'unavailable' events.this
.public java.util.function.Predicate<java.lang.Throwable> defaultInvalidateHostsOnDnsFailurePredicate()
invalidateHostsOnDnsFailure(Predicate)
.invalidateHostsOnDnsFailure(Predicate)
public DefaultDnsServiceDiscovererBuilder dnsResolverAddressTypes(@Nullable DnsResolverAddressTypes dnsResolverAddressTypes)
dnsResolverAddressTypes
- the address types.this
.public DefaultDnsServiceDiscovererBuilder noRetriesOnDnsFailures()
Publisher
with the error.this
.public DefaultDnsServiceDiscovererBuilder appendFilter(ServiceDiscovererFilterFactory<java.lang.String,java.net.InetAddress,ServiceDiscovererEvent<java.net.InetAddress>> factory)
ServiceDiscoverer
created by this
builder.
Note this method will be used to decorate the result of build()
/buildInetDiscoverer()
before
it is returned to the user.
The order of execution of these filters are in order of append. If 3 filters are added as follows:
builder.append(filter1).append(filter2).append(filter3)making a request to a service discoverer wrapped by this filter chain the order of invocation of these filters will be:
filter1 => filter2 => filter3 => service discoverer
factory
- ServiceDiscovererFilterFactory
to decorate a ServiceDiscoverer
for the purpose of
filtering.this
public DefaultDnsServiceDiscovererBuilder ioExecutor(IoExecutor ioExecutor)
IoExecutor
.ioExecutor
- IoExecutor
to use.this
.public ServiceDiscoverer<java.lang.String,java.net.InetAddress,ServiceDiscovererEvent<java.net.InetAddress>> buildInetDiscoverer()
ServiceDiscoverer<String, InetAddress>
.ServiceDiscoverer<String, InetAddress>
.public ServiceDiscoverer<HostAndPort,java.net.InetSocketAddress,ServiceDiscovererEvent<java.net.InetSocketAddress>> build()
ServiceDiscoverer<HostAndPort, InetSocketAddress>
.ServiceDiscoverer<HostAndPort, InetSocketAddress>
.HostAndPort