Package org.elasticsearch.http
Class ResponseInjectingHttpHandler.FixedRequestHandler
java.lang.Object
org.elasticsearch.http.ResponseInjectingHttpHandler.FixedRequestHandler
- All Implemented Interfaces:
ResponseInjectingHttpHandler.RequestHandler
- Enclosing class:
ResponseInjectingHttpHandler
public static class ResponseInjectingHttpHandler.FixedRequestHandler
extends Object
implements ResponseInjectingHttpHandler.RequestHandler
-
Constructor Summary
ConstructorsConstructorDescriptionFixedRequestHandler
(RestStatus status) FixedRequestHandler
(RestStatus status, String responseBody, Predicate<HttpExchange> requestMatcher) Create a handler that only gets executed for requests that match the supplied predicate. -
Method Summary
Modifier and TypeMethodDescriptionboolean
matchesRequest
(HttpExchange exchange) void
writeResponse
(HttpExchange exchange, HttpHandler delegateHandler)
-
Constructor Details
-
FixedRequestHandler
-
FixedRequestHandler
public FixedRequestHandler(RestStatus status, String responseBody, Predicate<HttpExchange> requestMatcher) Create a handler that only gets executed for requests that match the supplied predicate. Note that because the errors are stored in a queue this will prevent any subsequently queued errors from being returned until after it returns.
-
-
Method Details
-
matchesRequest
- Specified by:
matchesRequest
in interfaceResponseInjectingHttpHandler.RequestHandler
-
writeResponse
- Specified by:
writeResponse
in interfaceResponseInjectingHttpHandler.RequestHandler
- Throws:
IOException
-