com.catchpoint.trace.integrations.elasticsearch.intercept.ElasticsearchInterceptor Maven / Gradle / Ivy
package com.catchpoint.trace.integrations.elasticsearch.intercept;
/**
* Interface for interceptors to be invoked for Elasticsearch request events.
*
* @author serkan
*/
public interface ElasticsearchInterceptor {
/**
* Invoked before command is executed.
*
* @param uri the URI (path) to send the request
* @param method HTTP method to send the request
* @param body body the request
*/
void onBeforeRequest(String uri, String method, String body);
/**
* Invoked after request.
*
* @param uri the URI (path) to send the request
* @param method HTTP method to send the request
* @param body body the request
*/
void onAfterRequest(String uri, String method, String body);
/**
* Invoked when there is an error while request.
*
* @param uri the URI (path) to send the request
* @param method HTTP method to send the request
* @param body body the request
* @param error the {@link Throwable error} occurred while request
*/
void onErrorRequest(String uri, String method, String body, Throwable error);
}