Class SniffOnFailureListener
java.lang.Object
co.elastic.clients.transport.rest5_client.low_level.Rest5Client.FailureListener
co.elastic.clients.transport.rest5_client.low_level.sniffer.SniffOnFailureListener
Rest5Client.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 Rest5Client. The Sniffer instance
needs to be lazily set through setSniffer(Sniffer).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNotifies that the node provided as argument has just failedvoidsetSniffer(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
Description copied from class:Rest5Client.FailureListenerNotifies that the node provided as argument has just failed- Overrides:
onFailurein classRest5Client.FailureListener
-