Skip to content

Commit

Permalink
Java api: add name setter to delete index template request and make d…
Browse files Browse the repository at this point in the history
…efault constructor public for AnalyzeRequest and DeleteIndexTemplateRequest

Closes elastic#8122
Closes elastic#8123
  • Loading branch information
javanna committed May 27, 2015
1 parent fc28bc7 commit ee26ab8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
*/
package org.elasticsearch.action.admin.indices.analyze;

import org.elasticsearch.Version;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.single.custom.SingleCustomOperationRequest;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand All @@ -48,8 +46,7 @@ public class AnalyzeRequest extends SingleCustomOperationRequest<AnalyzeRequest>

private String field;

AnalyzeRequest() {

public AnalyzeRequest() {
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class DeleteIndexTemplateRequest extends MasterNodeRequest<DeleteIndexTem

private String name;

DeleteIndexTemplateRequest() {
public DeleteIndexTemplateRequest() {
}

/**
Expand All @@ -44,6 +44,14 @@ public DeleteIndexTemplateRequest(String name) {
this.name = name;
}

/**
* Set the index template name to delete.
*/
public DeleteIndexTemplateRequest name(String name) {
this.name = name;
return this;
}

@Override
public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,12 @@ public DeleteIndexTemplateRequestBuilder(ElasticsearchClient client, DeleteIndex
public DeleteIndexTemplateRequestBuilder(ElasticsearchClient client, DeleteIndexTemplateAction action, String name) {
super(client, action, new DeleteIndexTemplateRequest(name));
}

/**
* Sets the name of the index template to delete.
*/
public DeleteIndexTemplateRequestBuilder setName(String name) {
request.name(name);
return this;
}
}

0 comments on commit ee26ab8

Please sign in to comment.