public class RestController extends AbstractLifecycleComponent<RestController>
Modifier and Type | Field and Description |
---|---|
static String |
HTTP_JSON_ENABLE |
lifecycle
componentSettings, logger, settings
Constructor and Description |
---|
RestController(Settings settings) |
Modifier and Type | Method and Description |
---|---|
void |
dispatchRequest(RestRequest request,
RestChannel channel) |
protected void |
doClose() |
protected void |
doStart() |
protected void |
doStop() |
RestFilterChain |
filterChain(RestFilter executionFilter)
Returns a filter chain with the final filter being the provided filter.
|
RestFilterChain |
filterChainOrNull(RestFilter executionFilter)
Returns a filter chain (if needed) to execute.
|
void |
registerFilter(RestFilter preProcessor)
Registers a pre processor to be executed before the rest request is actually handled.
|
void |
registerHandler(RestRequest.Method method,
String path,
RestHandler handler)
Registers a rest handler to be execute when the provided method and path match the request.
|
void |
registerRelevantHeaders(String... headers)
Controls which REST headers get copied over from a
RestRequest to
its corresponding TransportRequest (s). |
com.google.common.collect.ImmutableSet<String> |
relevantHeaders()
Returns the REST headers that get copied over from a
RestRequest to
its corresponding TransportRequest (s). |
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop
nodeName
public static final String HTTP_JSON_ENABLE
protected void doStart() throws ElasticsearchException
doStart
in class AbstractLifecycleComponent<RestController>
ElasticsearchException
protected void doStop() throws ElasticsearchException
doStop
in class AbstractLifecycleComponent<RestController>
ElasticsearchException
protected void doClose() throws ElasticsearchException
doClose
in class AbstractLifecycleComponent<RestController>
ElasticsearchException
public void registerRelevantHeaders(String... headers)
RestRequest
to
its corresponding TransportRequest
(s).
By default no headers get copied but it is possible to extend this behaviour via plugins by calling this method.public com.google.common.collect.ImmutableSet<String> relevantHeaders()
RestRequest
to
its corresponding TransportRequest
(s).
By default no headers get copied but it is possible to extend this behaviour via plugins by calling registerRelevantHeaders(String...)
.public void registerFilter(RestFilter preProcessor)
public void registerHandler(RestRequest.Method method, String path, RestHandler handler)
@Nullable public RestFilterChain filterChainOrNull(RestFilter executionFilter)
public RestFilterChain filterChain(RestFilter executionFilter)
public void dispatchRequest(RestRequest request, RestChannel channel)
Copyright © 2009–2015. All rights reserved.