Package org.elasticsearch.client
Interface ResponseListener
public interface ResponseListener
Listener to be provided when calling async performRequest methods provided by
RestClient
.
Those methods that do accept a listener will return immediately, execute asynchronously, and notify
the listener whenever the request yielded a response, or failed with an exception.
Note that it is not safe to call RestClient.close()
from either of these
callbacks.
-
Method Summary
-
Method Details
-
onSuccess
Method invoked if the request yielded a successful response -
onFailure
Method invoked if the request failed. There are two main categories of failures: connection failures (usuallyIOException
s, or responses that were treated as errors based on their error response code (ResponseException
s).
-