Package org.elasticsearch.transport
Interface TransportInterceptor
public interface TransportInterceptor
This 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 interface
TransportInterceptor.AsyncSender
-
Method Summary
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, String, boolean, boolean, Reader, TransportRequestHandler)
orTransportService.registerRequestHandler(String, String, Reader, TransportRequestHandler)
.default TransportInterceptor.AsyncSender
interceptSender(TransportInterceptor.AsyncSender sender)
This is called up-front providing the actual low levelTransportInterceptor.AsyncSender
that performs the low level send request.
-
Method Details
-
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, String, boolean, boolean, Reader, TransportRequestHandler)
orTransportService.registerRequestHandler(String, String, Reader, TransportRequestHandler)
. The returned handler is used instead of the passed in handler. By default the provided handler is returned. -
interceptSender
This is called up-front providing the actual low levelTransportInterceptor.AsyncSender
that 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.
-