public class RestToXContentListener<Response extends ToXContent> extends RestResponseListener<Response>
ToXContent and automatically
builds an XContent based response (wrapping the toXContent in startObject/endObject).channel| Constructor and Description |
|---|
RestToXContentListener(RestChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
RestResponse |
buildResponse(Response response)
Builds the response to send back through the channel.
|
RestResponse |
buildResponse(Response response,
XContentBuilder builder) |
protected RestStatus |
getStatus(Response response) |
processResponseonFailure, onResponsepublic RestToXContentListener(RestChannel channel)
public final RestResponse buildResponse(Response response) throws Exception
RestResponseListenerbuildResponse in class RestResponseListener<Response extends ToXContent>Exceptionpublic final RestResponse buildResponse(Response response, XContentBuilder builder) throws Exception
Exceptionprotected RestStatus getStatus(Response response)
Copyright © 2009–2017. All rights reserved.