Package org.elasticsearch.transport
Interface TransportInterceptor
-
public interface TransportInterceptorThis interface allows plugins to intercept requests on both the sender and the receiver side.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceTransportInterceptor.AsyncSender
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default <T extends TransportRequest>
TransportRequestHandler<T>interceptHandler(java.lang.String action, java.lang.String executor, boolean forceExecution, TransportRequestHandler<T> actualHandler)This is called for each handler that is registered viaTransportService.registerRequestHandler(String, Supplier, String, boolean, boolean, TransportRequestHandler)orTransportService.registerRequestHandler(String, Supplier, String, TransportRequestHandler).default TransportInterceptor.AsyncSenderinterceptSender(TransportInterceptor.AsyncSender sender)This is called up-front providing the actual low levelTransportInterceptor.AsyncSenderthat performs the low level send request.
-
-
-
Method Detail
-
interceptHandler
default <T extends TransportRequest> TransportRequestHandler<T> interceptHandler(java.lang.String action, java.lang.String executor, boolean forceExecution, TransportRequestHandler<T> actualHandler)
This is called for each handler that is registered viaTransportService.registerRequestHandler(String, Supplier, String, boolean, boolean, TransportRequestHandler)orTransportService.registerRequestHandler(String, Supplier, String, TransportRequestHandler). The returned handler is used instead of the passed in handler. By default the provided handler is returned.
-
interceptSender
default TransportInterceptor.AsyncSender interceptSender(TransportInterceptor.AsyncSender sender)
This is called up-front providing the actual low levelTransportInterceptor.AsyncSenderthat performs the low level send request. The returned sender is used to send all requests that come in viaTransportService.sendRequest(DiscoveryNode, String, TransportRequest, TransportResponseHandler)orTransportService.sendRequest(DiscoveryNode, String, TransportRequest, TransportRequestOptions, TransportResponseHandler). This allows plugins to perform actions on each send request including modifying the request context etc.
-
-