Package org.elasticsearch.client
Interface ResponseListener
-
public interface ResponseListener
Listener to be provided when calling async performRequest methods provided byRestClient
. 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onFailure(java.lang.Exception exception)
Method invoked if the request failed.void
onSuccess(Response response)
Method invoked if the request yielded a successful response
-
-
-
Method Detail
-
onSuccess
void onSuccess(Response response)
Method invoked if the request yielded a successful response
-
onFailure
void onFailure(java.lang.Exception exception)
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).
-
-