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
public abstract class RestBuilderListener<Response> extends RestResponseListener<Response>
A REST action listener that builds anXContentBuilder
based response.
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.rest.action.RestActionListener
channel
-
-
Constructor Summary
Constructors Constructor Description RestBuilderListener(RestChannel channel)
-
Method Summary
Modifier and Type Method Description RestResponse
buildResponse(Response response)
Builds the response to send back through the channel.abstract RestResponse
buildResponse(Response response, 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
onFailure, onResponse
-
-
-
-
Constructor Detail
-
RestBuilderListener
public RestBuilderListener(RestChannel channel)
-
-
Method Detail
-
buildResponse
public final RestResponse buildResponse(Response response) throws java.lang.Exception
Description copied from class:RestResponseListener
Builds the response to send back through the channel.- Specified by:
buildResponse
in classRestResponseListener<Response>
- Throws:
java.lang.Exception
-
buildResponse
public abstract RestResponse buildResponse(Response response, XContentBuilder builder) throws java.lang.Exception
Builds a response to send back over the channel. Implementors should ensure that they close the providedXContentBuilder
using theXContentBuilder.close()
method.- Throws:
java.lang.Exception
-
-