public abstract class BaseRestHandler extends AbstractComponent implements RestHandler
This handler makes sure that the headers & context of the handled requests
are copied over to
the transport requests executed by the associated client. While the context is fully copied over, not all the headers
are copied, but a selected few. It is possible to control what headers are copied over by returning them in
ActionPlugin.getRestHeaders()
.
Modifier and Type | Class and Description |
---|---|
protected static interface |
BaseRestHandler.RestChannelConsumer
REST requests are handled by preparing a channel consumer that represents the execution of
the request against a channel.
|
Modifier and Type | Field and Description |
---|---|
static Setting<java.lang.Boolean> |
MULTI_ALLOW_EXPLICIT_INDEX |
protected ParseFieldMatcher |
parseFieldMatcher |
deprecationLogger, logger, settings
Modifier | Constructor and Description |
---|---|
protected |
BaseRestHandler(Settings settings) |
Modifier and Type | Method and Description |
---|---|
void |
handleRequest(RestRequest request,
RestChannel channel,
NodeClient client)
Handles a rest request.
|
protected abstract BaseRestHandler.RestChannelConsumer |
prepareRequest(RestRequest request,
NodeClient client)
Prepare the request for execution.
|
protected java.util.Set<java.lang.String> |
responseParams()
Parameters used for controlling the response and thus might not be consumed during
preparation of the request execution in
prepareRequest(RestRequest, NodeClient) . |
logDeprecatedSetting, logRemovedSetting, nodeName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canTripCircuitBreaker
public static final Setting<java.lang.Boolean> MULTI_ALLOW_EXPLICIT_INDEX
protected final ParseFieldMatcher parseFieldMatcher
protected BaseRestHandler(Settings settings)
public final void handleRequest(RestRequest request, RestChannel channel, NodeClient client) throws java.lang.Exception
RestHandler
handleRequest
in interface RestHandler
request
- The request to handlechannel
- The channel to write the request response toclient
- A client to use to make internal requests on behalf of the original requestjava.lang.Exception
protected abstract BaseRestHandler.RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws java.io.IOException
responseParams()
to indicate such
params.request
- the request to executeclient
- client for executing actions on the local nodejava.io.IOException
- if an I/O exception occurred parsing the request and preparing for
executionprotected java.util.Set<java.lang.String> responseParams()
prepareRequest(RestRequest, NodeClient)
.