public class RestController extends AbstractLifecycleComponent<RestController>
lifecycle
deprecationLogger, logger, settings
Constructor and Description |
---|
RestController(Settings settings) |
Modifier and Type | Method and Description |
---|---|
boolean |
canTripCircuitBreaker(RestRequest request) |
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 executed 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). |
void |
sendErrorResponse(RestRequest request,
RestChannel channel,
Throwable e) |
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop
logDeprecatedSetting, logRemovedSetting, nodeName
protected void doStart()
doStart
in class AbstractLifecycleComponent<RestController>
protected void doStop()
doStop
in class AbstractLifecycleComponent<RestController>
protected void doClose()
doClose
in class AbstractLifecycleComponent<RestController>
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 boolean canTripCircuitBreaker(RestRequest request)
request
- The current request. Must not be null.public void dispatchRequest(RestRequest request, RestChannel channel) throws Exception
Exception
public void sendErrorResponse(RestRequest request, RestChannel channel, Throwable e)
Copyright © 2009–2016. All rights reserved.