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.-
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
-
Method Summary
Modifier and TypeMethodDescriptionbuildResponse(Response response)
Builds the response to send back through the channel.abstract RestResponse
buildResponse(Response response, org.elasticsearch.common.xcontent.XContentBuilder builder)
Builds a response to send back over the channel.Methods inherited from class org.elasticsearch.rest.action.RestResponseListener
processResponse
Methods inherited from class org.elasticsearch.rest.action.RestActionListener
ensureOpen, onFailure, onResponse
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.action.ActionListener
delegateFailure, delegateResponse, map
-
Constructor Details
-
RestBuilderListener
-
-
Method Details
-
buildResponse
Description copied from class:RestResponseListener
Builds the response to send back through the channel.- Specified by:
buildResponse
in classRestResponseListener<Response>
- Throws:
Exception
-
buildResponse
public abstract RestResponse buildResponse(Response response, org.elasticsearch.common.xcontent.XContentBuilder builder) throws ExceptionBuilds a response to send back over the channel. Implementors should ensure that they close the providedXContentBuilder
using theXContentBuilder.close()
method.- Throws:
Exception
-