Module org.elasticsearch.server
Package org.elasticsearch.rest.action
Class RestBuilderListener<Response>
java.lang.Object
org.elasticsearch.rest.action.RestActionListener<Response>
org.elasticsearch.rest.action.RestResponseListener<Response>
org.elasticsearch.rest.action.RestBuilderListener<Response>
- All Implemented Interfaces:
ActionListener<Response>
- Direct Known Subclasses:
RestActions.NodesResponseRestListener,RestToXContentListener
A REST action listener that builds an
XContentBuilder based response.-
Field Summary
Fields inherited from class org.elasticsearch.rest.action.RestActionListener
channel -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal RestResponsebuildResponse(Response response) Builds the response to send back through the channel.abstract RestResponsebuildResponse(Response response, XContentBuilder builder) Builds a response to send back over the channel.Methods inherited from class org.elasticsearch.rest.action.RestResponseListener
processResponseMethods inherited from class org.elasticsearch.rest.action.RestActionListener
ensureOpen, 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, delegateFailureAndWrap, delegateFailureIgnoreResponseAndWrap, delegateResponse, map, safeMap
-
Constructor Details
-
RestBuilderListener
-
-
Method Details
-
buildResponse
Description copied from class:RestResponseListenerBuilds the response to send back through the channel.- Specified by:
buildResponsein classRestResponseListener<Response>- Throws:
Exception
-
buildResponse
public abstract RestResponse buildResponse(Response response, XContentBuilder builder) throws Exception Builds a response to send back over the channel. Implementors should ensure that they close the providedXContentBuilderusing theXContentBuilder.close()method.- Throws:
Exception
-