Package org.elasticsearch.client.sniff
Class SniffOnFailureListener
java.lang.Object
org.elasticsearch.client.RestClient.FailureListener
org.elasticsearch.client.sniff.SniffOnFailureListener
RestClient.FailureListener implementation that allows to perform
sniffing on failure. Gets notified whenever a failure happens and uses a Sniffer instance
to manually reload hosts and sets them back to the RestClient. The Sniffer instance
needs to be lazily set through setSniffer(Sniffer).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidsetSniffer(Sniffer sniffer) Sets theSnifferinstance used to perform sniffing
-
Constructor Details
-
SniffOnFailureListener
public SniffOnFailureListener()
-
-
Method Details
-
setSniffer
Sets theSnifferinstance used to perform sniffing- Throws:
IllegalStateException- if the sniffer was already set, as it can only be set once
-
onFailure
- Overrides:
onFailurein classRestClient.FailureListener
-