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.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.action.ActionListener
ActionListener.Delegating<Response,DelegateResponse>, ActionListener.DelegatingActionListener<T>, ActionListener.DelegatingFailureActionListener<T,R>, ActionListener.MappedActionListener<Response,MappedResponse>, ActionListener.RunAfterActionListener<T>, ActionListener.RunBeforeActionListener<T> -
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
Modifier and Type Method Description RestResponsebuildResponse(Response response, org.elasticsearch.common.xcontent.XContentBuilder builder)Methods inherited from class org.elasticsearch.rest.action.RestToXContentListener
buildResponse, getStatusMethods inherited from class org.elasticsearch.rest.action.RestResponseListener
processResponseMethods inherited from class org.elasticsearch.rest.action.RestActionListener
onFailure, onResponseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.action.ActionListener
delegateFailure, delegateResponse, map
-
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:
buildResponsein classRestToXContentListener<Response extends StatusToXContentObject>- Throws:
java.lang.Exception
-