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 TypeMethodDescriptionbooleanmatchesRequest(HttpExchange exchange) voidwriteResponse(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:
matchesRequestin interfaceResponseInjectingHttpHandler.RequestHandler
-
writeResponse
- Specified by:
writeResponsein interfaceResponseInjectingHttpHandler.RequestHandler- Throws:
IOException
-