public interface TransportInterceptor
Modifier and Type | Interface and Description |
---|---|
static interface |
TransportInterceptor.AsyncSender
|
Modifier and Type | Method and Description |
---|---|
default <T extends TransportRequest> |
interceptHandler(java.lang.String action,
java.lang.String executor,
boolean forceExecution,
TransportRequestHandler<T> actualHandler)
This is called for each handler that is registered via
TransportService.registerRequestHandler(String, Supplier, String, boolean, boolean, TransportRequestHandler) or
TransportService.registerRequestHandler(String, Supplier, String, TransportRequestHandler) . |
default TransportInterceptor.AsyncSender |
interceptSender(TransportInterceptor.AsyncSender sender)
This is called up-front providing the actual low level
TransportInterceptor.AsyncSender that performs the low level send request. |
default <T extends TransportRequest> TransportRequestHandler<T> interceptHandler(java.lang.String action, java.lang.String executor, boolean forceExecution, TransportRequestHandler<T> actualHandler)
TransportService.registerRequestHandler(String, Supplier, String, boolean, boolean, TransportRequestHandler)
or
TransportService.registerRequestHandler(String, Supplier, String, TransportRequestHandler)
. The returned handler is
used instead of the passed in handler. By default the provided handler is returned.default TransportInterceptor.AsyncSender interceptSender(TransportInterceptor.AsyncSender sender)
TransportInterceptor.AsyncSender
that performs the low level send request.
The returned sender is used to send all requests that come in via
TransportService.sendRequest(DiscoveryNode, String, TransportRequest, TransportResponseHandler)
or
TransportService.sendRequest(DiscoveryNode, String, TransportRequest, TransportRequestOptions, TransportResponseHandler)
.
This allows plugins to perform actions on each send request including modifying the request context etc.