Class RestActions.NodesResponseRestListener<NodesResponse extends BaseNodesResponse & org.elasticsearch.common.xcontent.ToXContent>

java.lang.Object
org.elasticsearch.rest.action.RestActionListener<Response>
org.elasticsearch.rest.action.RestResponseListener<Response>
org.elasticsearch.rest.action.RestBuilderListener<NodesResponse>
org.elasticsearch.rest.action.RestActions.NodesResponseRestListener<NodesResponse>
All Implemented Interfaces:
ActionListener<NodesResponse>
Enclosing class:
RestActions

public static class RestActions.NodesResponseRestListener<NodesResponse extends BaseNodesResponse & org.elasticsearch.common.xcontent.ToXContent> extends RestBuilderListener<NodesResponse>
NodesResponseRestBuilderListener automatically translates any BaseNodesResponse (multi-node) response that is ToXContent-compatible into a RestResponse with the necessary header info (e.g., "cluster_name").

This is meant to avoid a slew of anonymous classes doing (or worse): client.admin().cluster().request(nodesRequest, new RestBuilderListener<NodesResponse>(channel) { public RestResponse buildResponse(NodesResponse response, XContentBuilder builder) throws Exception { return RestActions.nodesResponse(builder, ToXContent.EMPTY_PARAMS, response); } });