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 thatRestStatus
from the response.
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.rest.action.RestActionListener
channel
-
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RestResponse
buildResponse(Response response, XContentBuilder builder)
-
Methods inherited from class org.elasticsearch.rest.action.RestToXContentListener
buildResponse, getStatus
-
Methods inherited from class org.elasticsearch.rest.action.RestResponseListener
processResponse
-
Methods inherited from class org.elasticsearch.rest.action.RestActionListener
onFailure, onResponse
-
-
-
-
Constructor Detail
-
RestStatusToXContentListener
public RestStatusToXContentListener(RestChannel channel)
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 Detail
-
buildResponse
public RestResponse buildResponse(Response response, XContentBuilder builder) throws java.lang.Exception
- Overrides:
buildResponse
in classRestToXContentListener<Response extends StatusToXContentObject>
- Throws:
java.lang.Exception
-
-