public final class SnifferBuilder
extends java.lang.Object
Sniffer
.Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_SNIFF_AFTER_FAILURE_DELAY |
static long |
DEFAULT_SNIFF_INTERVAL |
Modifier and Type | Method and Description |
---|---|
Sniffer |
build()
Creates the
Sniffer based on the provided configuration. |
SnifferBuilder |
setHostsSniffer(HostsSniffer hostsSniffer)
Sets the
HostsSniffer to be used to read hosts. |
SnifferBuilder |
setSniffAfterFailureDelayMillis(int sniffAfterFailureDelayMillis)
Sets the delay of a sniff execution scheduled after a failure (in milliseconds)
|
SnifferBuilder |
setSniffIntervalMillis(int sniffIntervalMillis)
Sets the interval between consecutive ordinary sniff executions in milliseconds.
|
public static final long DEFAULT_SNIFF_INTERVAL
public static final long DEFAULT_SNIFF_AFTER_FAILURE_DELAY
public SnifferBuilder setSniffIntervalMillis(int sniffIntervalMillis)
java.lang.IllegalArgumentException
- if sniffIntervalMillis is not greater than 0public SnifferBuilder setSniffAfterFailureDelayMillis(int sniffAfterFailureDelayMillis)
public SnifferBuilder setHostsSniffer(HostsSniffer hostsSniffer)
HostsSniffer
to be used to read hosts. A default instance of ElasticsearchHostsSniffer
is created when not provided. This method can be used to change the configuration of the ElasticsearchHostsSniffer
,
or to provide a different implementation (e.g. in case hosts need to taken from a different source).