// Path: src/main/java/org/xbib/elasticsearch/action/admin/indices/reconstruct/ReconstructIndexAction.java
// public class ReconstructIndexAction extends IndicesAction<ReconstructIndexRequest, ReconstructIndexResponse, ReconstructIndexRequestBuilder> {
// 
//     public static final ReconstructIndexAction INSTANCE = new ReconstructIndexAction();
//     public static final String NAME = "indices/reconstruct";
// 
//     private ReconstructIndexAction() {
//         super(NAME);
//     }
// 
//     @Override
//     public ReconstructIndexResponse newResponse() {
//         return new ReconstructIndexResponse();
//     }
// 
//     @Override
//     public ReconstructIndexRequestBuilder newRequestBuilder(IndicesAdminClient client) {
//         return new ReconstructIndexRequestBuilder(client);
//     }
// }
// 
// Path: src/main/java/org/xbib/elasticsearch/action/admin/indices/reconstruct/ReconstructIndexRequest.java
// public class ReconstructIndexRequest extends BroadcastOperationRequest<ReconstructIndexRequest> {
// 
//     private String index;
// 
//     ReconstructIndexRequest() {
//     }
// 
//     public ReconstructIndexRequest(String index) {
//         this.index = index;
//     }
// 
//     public String index() {
//         return index;
//     }
// 
//     @Override
//     public void readFrom(StreamInput in) throws IOException {
//         super.readFrom(in);
//         this.index = in.readString();
//     }
// 
//     @Override
//     public void writeTo(StreamOutput out) throws IOException {
//         super.writeTo(out);
//         out.writeString(index);
//     }
// }
// 
// Path: src/main/java/org/xbib/elasticsearch/action/admin/indices/reconstruct/ReconstructIndexResponse.java
// public class ReconstructIndexResponse extends BroadcastOperationResponse {
// 
//     protected List<ShardReconstructIndexResponse> shards;
// 
//     ReconstructIndexResponse() {
//     }
// 
//     ReconstructIndexResponse(List<ShardReconstructIndexResponse> shards, int totalShards, int successfulShards, int failedShards, List<ShardOperationFailedException> shardFailures) {
//         super(totalShards, successfulShards, failedShards, shardFailures);
//         this.shards = shards;
//     }
// 
//     public List<ShardReconstructIndexResponse> shards() {
//         return shards;
//     }
// 
//     @Override
//     public void readFrom(StreamInput in) throws IOException {
//         super.readFrom(in);
//         int n = in.readVInt();
//         shards = newArrayList();
//         for (int i = 0; i < n; i++) {
//             ShardReconstructIndexResponse r = new ShardReconstructIndexResponse();
//             r.readFrom(in);
//             shards.add(r);
//         }
//     }
// 
//     @Override
//     public void writeTo(StreamOutput out) throws IOException {
//         super.writeTo(out);
//         out.writeVInt(shards.size());
//         for (ShardReconstructIndexResponse r : shards) {
//             r.writeTo(out);
//         }
//     }
// }


import org.elasticsearch.client.Client;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.rest.*;
import org.elasticsearch.rest.action.support.RestResponseListener;
import org.xbib.elasticsearch.action.admin.indices.reconstruct.ReconstructIndexAction;
import org.xbib.elasticsearch.action.admin.indices.reconstruct.ReconstructIndexRequest;
import org.xbib.elasticsearch.action.admin.indices.reconstruct.ReconstructIndexResponse;
import org.xbib.elasticsearch.action.admin.indices.reconstruct.ShardReconstructIndexResponse;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestStatus.OK;

package org.xbib.elasticsearch.rest.action.skywalker;



/**
 *  REST action for reconstructing an index
 */
public class RestReconstructIndexAction extends BaseRestHandler {

    @Inject
    public RestReconstructIndexAction(Settings settings, Client client, RestController controller) {
        super(settings, client);
        controller.registerHandler(GET, "/{index}/_skywalker/reconstruct", this);
    }

    @Override
// Path: src/main/java/org/xbib/elasticsearch/action/admin/indices/reconstruct/ReconstructIndexAction.java
// public class ReconstructIndexAction extends IndicesAction<ReconstructIndexRequest, ReconstructIndexResponse, ReconstructIndexRequestBuilder> {
// 
//     public static final ReconstructIndexAction INSTANCE = new ReconstructIndexAction();
//     public static final String NAME = "indices/reconstruct";
// 
//     private ReconstructIndexAction() {
//         super(NAME);
//     }
// 
//     @Override
//     public ReconstructIndexResponse newResponse() {
//         return new ReconstructIndexResponse();
//     }
// 
//     @Override
//     public ReconstructIndexRequestBuilder newRequestBuilder(IndicesAdminClient client) {
//         return new ReconstructIndexRequestBuilder(client);
//     }
// }
// 
// Path: src/main/java/org/xbib/elasticsearch/action/admin/indices/reconstruct/ReconstructIndexRequest.java
// public class ReconstructIndexRequest extends BroadcastOperationRequest<ReconstructIndexRequest> {
// 
//     private String index;
// 
//     ReconstructIndexRequest() {
//     }
// 
//     public ReconstructIndexRequest(String index) {
//         this.index = index;
//     }
// 
//     public String index() {
//         return index;
//     }
// 
//     @Override
//     public void readFrom(StreamInput in) throws IOException {
//         super.readFrom(in);
//         this.index = in.readString();
//     }
// 
//     @Override
//     public void writeTo(StreamOutput out) throws IOException {
//         super.writeTo(out);
//         out.writeString(index);
//     }
// }
// 
// Path: src/main/java/org/xbib/elasticsearch/action/admin/indices/reconstruct/ReconstructIndexResponse.java
// public class ReconstructIndexResponse extends BroadcastOperationResponse {
// 
//     protected List<ShardReconstructIndexResponse> shards;
// 
//     ReconstructIndexResponse() {
//     }
// 
//     ReconstructIndexResponse(List<ShardReconstructIndexResponse> shards, int totalShards, int successfulShards, int failedShards, List<ShardOperationFailedException> shardFailures) {
//         super(totalShards, successfulShards, failedShards, shardFailures);
//         this.shards = shards;
//     }
// 
//     public List<ShardReconstructIndexResponse> shards() {
//         return shards;
//     }
// 
//     @Override
//     public void readFrom(StreamInput in) throws IOException {
//         super.readFrom(in);
//         int n = in.readVInt();
//         shards = newArrayList();
//         for (int i = 0; i < n; i++) {
//             ShardReconstructIndexResponse r = new ShardReconstructIndexResponse();
//             r.readFrom(in);
//             shards.add(r);
//         }
//     }
// 
//     @Override
//     public void writeTo(StreamOutput out) throws IOException {
//         super.writeTo(out);
//         out.writeVInt(shards.size());
//         for (ShardReconstructIndexResponse r : shards) {
//             r.writeTo(out);
//         }
//     }
// }


// Path: src/main/java/org/xbib/elasticsearch/rest/action/skywalker/RestReconstructIndexAction.java
import org.elasticsearch.client.Client;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.rest.*;
import org.elasticsearch.rest.action.support.RestResponseListener;
import org.xbib.elasticsearch.action.admin.indices.reconstruct.ReconstructIndexAction;
import org.xbib.elasticsearch.action.admin.indices.reconstruct.ReconstructIndexRequest;
import org.xbib.elasticsearch.action.admin.indices.reconstruct.ReconstructIndexResponse;
import org.xbib.elasticsearch.action.admin.indices.reconstruct.ShardReconstructIndexResponse;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestStatus.OK;


package org.xbib.elasticsearch.rest.action.skywalker;



/**
 *  REST action for reconstructing an index
 */
public class RestReconstructIndexAction extends BaseRestHandler {

    @Inject
    public RestReconstructIndexAction(Settings settings, Client client, RestController controller) {
        super(settings, client);
        controller.registerHandler(GET, "/{index}/_skywalker/reconstruct", this);
    }

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {