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
Modifier and TypeInterfaceDescriptionstatic interface
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends TransportRequest>
TransportRequestHandler<T>interceptHandler
(String action, 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
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(String action, 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.
-