Package org.elasticsearch.rest.action
Class RestStatusToXContentListener<Response extends StatusToXContentObject>
java.lang.Object
org.elasticsearch.rest.action.RestActionListener<Response>
org.elasticsearch.rest.action.RestResponseListener<Response>
org.elasticsearch.rest.action.RestToXContentListener<Response>
org.elasticsearch.rest.action.RestStatusToXContentListener<Response>
- All Implemented Interfaces:
ActionListener<Response>
public class RestStatusToXContentListener<Response extends StatusToXContentObject> extends RestToXContentListener<Response>
Content listener that extracts that
RestStatus
from the response.-
Field Summary
-
Constructor Summary
Constructors Constructor Description RestStatusToXContentListener(RestChannel channel)
Build an instance that doesn't support responses with the status201 CREATED
.RestStatusToXContentListener(RestChannel channel, java.util.function.Function<Response,java.lang.String> extractLocation)
Build an instance that does support responses with the status201 CREATED
. -
Method Summary
Modifier and Type Method Description RestResponse
buildResponse(Response response, org.elasticsearch.common.xcontent.XContentBuilder builder)
Methods inherited from class org.elasticsearch.rest.action.RestToXContentListener
buildResponse, getStatus
-
Constructor Details
-
RestStatusToXContentListener
Build an instance that doesn't support responses with the status201 CREATED
. -
RestStatusToXContentListener
public RestStatusToXContentListener(RestChannel channel, java.util.function.Function<Response,java.lang.String> extractLocation)Build an instance that does support responses with the status201 CREATED
.
-
-
Method Details
-
buildResponse
public RestResponse buildResponse(Response response, org.elasticsearch.common.xcontent.XContentBuilder builder) throws java.lang.Exception- Overrides:
buildResponse
in classRestToXContentListener<Response extends StatusToXContentObject>
- Throws:
java.lang.Exception
-