Package org.opensearch.rest
Class RestHandler.Wrapper
java.lang.Object
org.opensearch.rest.RestHandler.Wrapper
- All Implemented Interfaces:
RestHandler
- Enclosing interface:
- RestHandler
public static class RestHandler.Wrapper extends java.lang.Object implements RestHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opensearch.rest.RestHandler
RestHandler.DeprecatedRoute, RestHandler.ReplacedRoute, RestHandler.Route, RestHandler.Wrapper
-
Constructor Summary
Constructors Constructor Description Wrapper(RestHandler delegate)
-
Method Summary
Modifier and Type Method Description boolean
allowsUnsafeBuffers()
Indicates if the RestHandler supports working with pooled buffers.boolean
allowSystemIndexAccessByDefault()
Controls whether requests handled by this class are allowed to to access system indices by default.boolean
canTripCircuitBreaker()
java.util.List<RestHandler.DeprecatedRoute>
deprecatedRoutes()
A list of routes handled by this RestHandler that are deprecated and do not have a direct replacement.void
handleRequest(RestRequest request, RestChannel channel, NodeClient client)
Handles a rest request.java.util.List<RestHandler.ReplacedRoute>
replacedRoutes()
A list of routes handled by this RestHandler that have had theirpath
and/ormethod
changed.java.util.List<RestHandler.Route>
routes()
The list ofRestHandler.Route
s that this RestHandler is responsible for handling.boolean
supportsContentStream()
Indicates if the RestHandler supports content as a stream.java.lang.String
toString()
-
Constructor Details
-
Method Details
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
handleRequest
public void handleRequest(RestRequest request, RestChannel channel, NodeClient client) throws java.lang.ExceptionDescription copied from interface:RestHandler
Handles a rest request.- Specified by:
handleRequest
in interfaceRestHandler
- Parameters:
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 request- Throws:
java.lang.Exception
-
canTripCircuitBreaker
public boolean canTripCircuitBreaker()- Specified by:
canTripCircuitBreaker
in interfaceRestHandler
-
supportsContentStream
public boolean supportsContentStream()Description copied from interface:RestHandler
Indicates if the RestHandler supports content as a stream. A stream would be multiple objects delineated byXContent.streamSeparator()
. If a handler returns true this will affect the types of content that can be sent to this endpoint.- Specified by:
supportsContentStream
in interfaceRestHandler
-
allowsUnsafeBuffers
public boolean allowsUnsafeBuffers()Description copied from interface:RestHandler
Indicates if the RestHandler supports working with pooled buffers. If the request handler will not escape the returnRestRequest.content()
or any buffers extracted from it then there is no need to make a copies of any pooled buffers in theRestRequest
instance before passing a request to this handler. If this instance does not support pooled/unsafe buffersRestRequest.ensureSafeBuffers()
should be called on any request before passing it toRestHandler.handleRequest(org.opensearch.rest.RestRequest, org.opensearch.rest.RestChannel, org.opensearch.client.node.NodeClient)
.- Specified by:
allowsUnsafeBuffers
in interfaceRestHandler
- Returns:
- true iff the handler supports requests that make use of pooled buffers
-
routes
Description copied from interface:RestHandler
The list ofRestHandler.Route
s that this RestHandler is responsible for handling.- Specified by:
routes
in interfaceRestHandler
-
deprecatedRoutes
Description copied from interface:RestHandler
A list of routes handled by this RestHandler that are deprecated and do not have a direct replacement. If changing thepath
ormethod
of a route, useRestHandler.replacedRoutes()
.- Specified by:
deprecatedRoutes
in interfaceRestHandler
-
replacedRoutes
Description copied from interface:RestHandler
A list of routes handled by this RestHandler that have had theirpath
and/ormethod
changed. The pre-existingroute
will be registered as deprecated alongside the updatedroute
.- Specified by:
replacedRoutes
in interfaceRestHandler
-
allowSystemIndexAccessByDefault
public boolean allowSystemIndexAccessByDefault()Description copied from interface:RestHandler
Controls whether requests handled by this class are allowed to to access system indices by default.- Specified by:
allowSystemIndexAccessByDefault
in interfaceRestHandler
- Returns:
true
if requests handled by this class should be allowed to access system indices.
-