Package org.opensearch.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.- Parameters:
response- success response
-
onFailure
Method invoked if the request failed. There are two main categories of failures: connection failures (usuallyIOExceptions, or responses that were treated as errors based on their error response code (ResponseExceptions).- Parameters:
exception- the failure exception
-