public class SniffOnFailureListener
extends org.elasticsearch.client.RestClient.FailureListener
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 and Description |
|---|
SniffOnFailureListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
onFailure(org.apache.http.HttpHost host) |
void |
setSniffer(Sniffer sniffer)
Sets the
Sniffer instance used to perform sniffing |
public void setSniffer(Sniffer sniffer)
Sniffer instance used to perform sniffingjava.lang.IllegalStateException - if the sniffer was already set, as it can only be set oncepublic void onFailure(org.apache.http.HttpHost host)
onFailure in class org.elasticsearch.client.RestClient.FailureListener