controller.registerHandler(HEAD, PATH, this);
}
@Override
public void handleRequest(final RestRequest request, final RestChannel channel, Client client) {
ClusterStateRequest clusterStateRequest = new ClusterStateRequest();
clusterStateRequest.listenerThreaded(false);
clusterStateRequest.masterNodeTimeout(TimeValue.timeValueMillis(0));
clusterStateRequest.local(true);
clusterStateRequest.clear().blocks(true);
client.admin().cluster().state(clusterStateRequest, new RestBuilderListener<ClusterStateResponse>(channel) {
@Override
public RestResponse buildResponse(ClusterStateResponse response, XContentBuilder builder) throws Exception {
RestStatus status = RestStatus.OK;