diff --git a/client/benchmark/src/main/java/org/elasticsearch/client/benchmark/transport/TransportClientBenchmark.java b/client/benchmark/src/main/java/org/elasticsearch/client/benchmark/transport/TransportClientBenchmark.java index d2aee2251a67b..c9ab38fe35545 100644 --- a/client/benchmark/src/main/java/org/elasticsearch/client/benchmark/transport/TransportClientBenchmark.java +++ b/client/benchmark/src/main/java/org/elasticsearch/client/benchmark/transport/TransportClientBenchmark.java @@ -79,7 +79,7 @@ private static final class TransportBulkRequestExecutor implements BulkRequestEx @Override public boolean bulkIndex(List bulkData) { - NoopBulkRequestBuilder builder = NoopBulkAction.INSTANCE.newRequestBuilder(client); + NoopBulkRequestBuilder builder = new NoopBulkRequestBuilder(client,NoopBulkAction.INSTANCE); for (String bulkItem : bulkData) { builder.add(new IndexRequest(indexName, typeName).source(bulkItem.getBytes(StandardCharsets.UTF_8), XContentType.JSON)); } @@ -108,7 +108,7 @@ private TransportSearchRequestExecutor(TransportClient client, String indexName) @Override public boolean search(String source) { final SearchResponse response; - NoopSearchRequestBuilder builder = NoopSearchAction.INSTANCE.newRequestBuilder(client); + NoopSearchRequestBuilder builder = new NoopSearchRequestBuilder(client, NoopSearchAction.INSTANCE); try { builder.setIndices(indexName); builder.setQuery(QueryBuilders.wrapperQuery(source)); diff --git a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/NoopBulkAction.java b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/NoopBulkAction.java index 7f5ec6edd8e49..73678b2f5ea65 100644 --- a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/NoopBulkAction.java +++ b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/NoopBulkAction.java @@ -21,9 +21,8 @@ import org.elasticsearch.action.Action; import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.bulk.BulkResponse; -import org.elasticsearch.client.ElasticsearchClient; -public class NoopBulkAction extends Action { +public class NoopBulkAction extends Action { public static final String NAME = "mock:data/write/bulk"; public static final NoopBulkAction INSTANCE = new NoopBulkAction(); @@ -32,11 +31,6 @@ private NoopBulkAction() { super(NAME); } - @Override - public NoopBulkRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new NoopBulkRequestBuilder(client, this); - } - @Override public BulkResponse newResponse() { return new BulkResponse(null, 0); diff --git a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/NoopBulkRequestBuilder.java b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/NoopBulkRequestBuilder.java index 468152a88df3b..af97921bc6007 100644 --- a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/NoopBulkRequestBuilder.java +++ b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/NoopBulkRequestBuilder.java @@ -35,7 +35,7 @@ import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentType; -public class NoopBulkRequestBuilder extends ActionRequestBuilder +public class NoopBulkRequestBuilder extends ActionRequestBuilder implements WriteRequestBuilder { public NoopBulkRequestBuilder(ElasticsearchClient client, NoopBulkAction action) { diff --git a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/NoopSearchAction.java b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/NoopSearchAction.java index b24190b6946d0..ca2c3d9adfc41 100644 --- a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/NoopSearchAction.java +++ b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/NoopSearchAction.java @@ -21,9 +21,8 @@ import org.elasticsearch.action.Action; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.ElasticsearchClient; -public class NoopSearchAction extends Action { +public class NoopSearchAction extends Action { public static final NoopSearchAction INSTANCE = new NoopSearchAction(); public static final String NAME = "mock:data/read/search"; @@ -31,11 +30,6 @@ public NoopSearchAction() { super(NAME); } - @Override - public NoopSearchRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new NoopSearchRequestBuilder(client, this); - } - @Override public SearchResponse newResponse() { return new SearchResponse(); diff --git a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/NoopSearchRequestBuilder.java b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/NoopSearchRequestBuilder.java index acba314f926b8..e73edb143e0d0 100644 --- a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/NoopSearchRequestBuilder.java +++ b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/NoopSearchRequestBuilder.java @@ -42,7 +42,7 @@ import java.util.Arrays; import java.util.List; -public class NoopSearchRequestBuilder extends ActionRequestBuilder { +public class NoopSearchRequestBuilder extends ActionRequestBuilder { public NoopSearchRequestBuilder(ElasticsearchClient client, NoopSearchAction action) { super(client, action, new SearchRequest()); diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java index c68f498c0eaf1..5204a07b1c969 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java @@ -52,8 +52,7 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestStatus.OK; -public class GrokProcessorGetAction extends Action { +public class GrokProcessorGetAction extends Action { public static final GrokProcessorGetAction INSTANCE = new GrokProcessorGetAction(); public static final String NAME = "cluster:admin/ingest/processor/grok/get"; @@ -62,11 +61,6 @@ private GrokProcessorGetAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(null); @@ -79,7 +73,7 @@ public ActionRequestValidationException validate() { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client) { super(client, GrokProcessorGetAction.INSTANCE, new Request()); } diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateAction.java index 99eb9709f7333..21b9a11e1f214 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateAction.java @@ -20,10 +20,8 @@ package org.elasticsearch.script.mustache; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class MultiSearchTemplateAction - extends Action { +public class MultiSearchTemplateAction extends Action { public static final MultiSearchTemplateAction INSTANCE = new MultiSearchTemplateAction(); public static final String NAME = "indices:data/read/msearch/template"; @@ -36,9 +34,4 @@ private MultiSearchTemplateAction() { public MultiSearchTemplateResponse newResponse() { return new MultiSearchTemplateResponse(); } - - @Override - public MultiSearchTemplateRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new MultiSearchTemplateRequestBuilder(client, this); - } } diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequestBuilder.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequestBuilder.java index 4ef6c593d9a41..c4dac0dd88eb8 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequestBuilder.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequestBuilder.java @@ -24,7 +24,7 @@ import org.elasticsearch.client.ElasticsearchClient; public class MultiSearchTemplateRequestBuilder - extends ActionRequestBuilder { + extends ActionRequestBuilder { protected MultiSearchTemplateRequestBuilder(ElasticsearchClient client, MultiSearchTemplateAction action) { super(client, action, new MultiSearchTemplateRequest()); diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateAction.java index 2982fbd70c645..1246e8e8e9bf2 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.script.mustache; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class SearchTemplateAction extends Action { +public class SearchTemplateAction extends Action { public static final SearchTemplateAction INSTANCE = new SearchTemplateAction(); public static final String NAME = "indices:data/read/search/template"; @@ -31,11 +30,6 @@ private SearchTemplateAction() { super(NAME); } - @Override - public SearchTemplateRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SearchTemplateRequestBuilder(client, this); - } - @Override public SearchTemplateResponse newResponse() { return new SearchTemplateResponse(); diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateRequestBuilder.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateRequestBuilder.java index 02d27ac79fc3d..054acbc655768 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateRequestBuilder.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateRequestBuilder.java @@ -27,7 +27,7 @@ import java.util.Map; public class SearchTemplateRequestBuilder - extends ActionRequestBuilder { + extends ActionRequestBuilder { SearchTemplateRequestBuilder(ElasticsearchClient client, SearchTemplateAction action) { super(client, action, new SearchTemplateRequest()); diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessExecuteAction.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessExecuteAction.java index aa650a37c4fa2..f91d349f80657 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessExecuteAction.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessExecuteAction.java @@ -62,8 +62,7 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.rest.RestStatus.OK; -public class PainlessExecuteAction extends Action { +public class PainlessExecuteAction extends Action { static final PainlessExecuteAction INSTANCE = new PainlessExecuteAction(); private static final String NAME = "cluster:admin/scripts/painless/execute"; @@ -72,11 +71,6 @@ private PainlessExecuteAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(); @@ -201,7 +195,7 @@ public static SupportedContext fromId(byte id) { } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new Request()); diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalAction.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalAction.java index 8908fbdfbddd8..441cbb5fac108 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalAction.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.index.rankeval; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action for explaining evaluating search ranking results. */ -public class RankEvalAction extends Action { +public class RankEvalAction extends Action { public static final RankEvalAction INSTANCE = new RankEvalAction(); public static final String NAME = "indices:data/read/rank_eval"; @@ -34,11 +33,6 @@ private RankEvalAction() { super(NAME); } - @Override - public RankEvalRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RankEvalRequestBuilder(client, this, new RankEvalRequest()); - } - @Override public RankEvalResponse newResponse() { return new RankEvalResponse(); diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalRequestBuilder.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalRequestBuilder.java index 2df16ade5664d..146c987eff0ac 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalRequestBuilder.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalRequestBuilder.java @@ -23,9 +23,9 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -public class RankEvalRequestBuilder extends ActionRequestBuilder { +public class RankEvalRequestBuilder extends ActionRequestBuilder { - public RankEvalRequestBuilder(ElasticsearchClient client, Action action, + public RankEvalRequestBuilder(ElasticsearchClient client, Action action, RankEvalRequest request) { super(client, action, request); } diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/BulkByScrollParallelizationHelper.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/BulkByScrollParallelizationHelper.java index 2aff0d7a5c501..3cc0901c81e21 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/BulkByScrollParallelizationHelper.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/BulkByScrollParallelizationHelper.java @@ -61,7 +61,7 @@ private BulkByScrollParallelizationHelper() {} static > void startSlicedAction( Request request, BulkByScrollTask task, - Action action, + Action action, ActionListener listener, Client client, DiscoveryNode node, @@ -85,7 +85,7 @@ static > void startSlicedAc private static > void sliceConditionally( Request request, BulkByScrollTask task, - Action action, + Action action, ActionListener listener, Client client, DiscoveryNode node, @@ -118,7 +118,7 @@ private static int countSlicesBasedOnShards(ClusterSearchShardsResponse response private static > void sendSubRequests( Client client, - Action action, + Action action, String localNodeId, BulkByScrollTask task, Request request, diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RethrottleAction.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RethrottleAction.java index ffbcbbf1e37e7..ff0803c77425f 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RethrottleAction.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RethrottleAction.java @@ -21,9 +21,8 @@ import org.elasticsearch.action.Action; import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse; -import org.elasticsearch.client.ElasticsearchClient; -public class RethrottleAction extends Action { +public class RethrottleAction extends Action { public static final RethrottleAction INSTANCE = new RethrottleAction(); public static final String NAME = "cluster:admin/reindex/rethrottle"; @@ -31,11 +30,6 @@ private RethrottleAction() { super(NAME); } - @Override - public RethrottleRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RethrottleRequestBuilder(client, this); - } - @Override public ListTasksResponse newResponse() { return new ListTasksResponse(); diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RethrottleRequestBuilder.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RethrottleRequestBuilder.java index d5cc3d9c5d388..b70389b5c9f3e 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RethrottleRequestBuilder.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RethrottleRequestBuilder.java @@ -29,7 +29,7 @@ */ public class RethrottleRequestBuilder extends TasksRequestBuilder { public RethrottleRequestBuilder(ElasticsearchClient client, - Action action) { + Action action) { super(client, action, new RethrottleRequest()); } diff --git a/modules/reindex/src/test/java/org/elasticsearch/client/documentation/ReindexDocumentationIT.java b/modules/reindex/src/test/java/org/elasticsearch/client/documentation/ReindexDocumentationIT.java index 1f99f062d25af..8743ef255ba06 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/client/documentation/ReindexDocumentationIT.java +++ b/modules/reindex/src/test/java/org/elasticsearch/client/documentation/ReindexDocumentationIT.java @@ -27,10 +27,12 @@ import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.elasticsearch.index.reindex.BulkByScrollTask; import org.elasticsearch.index.reindex.DeleteByQueryAction; +import org.elasticsearch.index.reindex.DeleteByQueryRequestBuilder; import org.elasticsearch.index.reindex.ReindexAction; import org.elasticsearch.index.reindex.ReindexRequest; import org.elasticsearch.index.reindex.ReindexRequestBuilder; import org.elasticsearch.index.reindex.RethrottleAction; +import org.elasticsearch.index.reindex.RethrottleRequestBuilder; import org.elasticsearch.index.reindex.UpdateByQueryAction; import org.elasticsearch.index.reindex.UpdateByQueryRequestBuilder; import org.elasticsearch.script.Script; @@ -47,7 +49,7 @@ public class ReindexDocumentationIT extends ESIntegTestCase { public void reindex() { Client client = client(); // tag::reindex1 - BulkByScrollResponse response = ReindexAction.INSTANCE.newRequestBuilder(client) + BulkByScrollResponse response = new ReindexRequestBuilder(client, ReindexAction.INSTANCE) .destination("target_index") .filter(QueryBuilders.matchQuery("category", "xzy")) // <1> .get(); @@ -58,14 +60,14 @@ public void updateByQuery() { Client client = client(); { // tag::update-by-query - UpdateByQueryRequestBuilder updateByQuery = UpdateByQueryAction.INSTANCE.newRequestBuilder(client); + UpdateByQueryRequestBuilder updateByQuery = new UpdateByQueryRequestBuilder(client, UpdateByQueryAction.INSTANCE); updateByQuery.source("source_index").abortOnVersionConflict(false); BulkByScrollResponse response = updateByQuery.get(); // end::update-by-query } { // tag::update-by-query-filter - UpdateByQueryRequestBuilder updateByQuery = UpdateByQueryAction.INSTANCE.newRequestBuilder(client); + UpdateByQueryRequestBuilder updateByQuery = new UpdateByQueryRequestBuilder(client, UpdateByQueryAction.INSTANCE); updateByQuery.source("source_index") .filter(QueryBuilders.termQuery("level", "awesome")) .size(1000) @@ -75,7 +77,7 @@ public void updateByQuery() { } { // tag::update-by-query-size - UpdateByQueryRequestBuilder updateByQuery = UpdateByQueryAction.INSTANCE.newRequestBuilder(client); + UpdateByQueryRequestBuilder updateByQuery = new UpdateByQueryRequestBuilder(client, UpdateByQueryAction.INSTANCE); updateByQuery.source("source_index") .source().setSize(500); BulkByScrollResponse response = updateByQuery.get(); @@ -83,7 +85,7 @@ public void updateByQuery() { } { // tag::update-by-query-sort - UpdateByQueryRequestBuilder updateByQuery = UpdateByQueryAction.INSTANCE.newRequestBuilder(client); + UpdateByQueryRequestBuilder updateByQuery = new UpdateByQueryRequestBuilder(client, UpdateByQueryAction.INSTANCE); updateByQuery.source("source_index").size(100) .source().addSort("cat", SortOrder.DESC); BulkByScrollResponse response = updateByQuery.get(); @@ -91,7 +93,7 @@ public void updateByQuery() { } { // tag::update-by-query-script - UpdateByQueryRequestBuilder updateByQuery = UpdateByQueryAction.INSTANCE.newRequestBuilder(client); + UpdateByQueryRequestBuilder updateByQuery = new UpdateByQueryRequestBuilder(client, UpdateByQueryAction.INSTANCE); updateByQuery.source("source_index") .script(new Script( ScriptType.INLINE, @@ -108,21 +110,21 @@ public void updateByQuery() { } { // tag::update-by-query-multi-index - UpdateByQueryRequestBuilder updateByQuery = UpdateByQueryAction.INSTANCE.newRequestBuilder(client); + UpdateByQueryRequestBuilder updateByQuery = new UpdateByQueryRequestBuilder(client, UpdateByQueryAction.INSTANCE); updateByQuery.source("foo", "bar").source().setTypes("a", "b"); BulkByScrollResponse response = updateByQuery.get(); // end::update-by-query-multi-index } { // tag::update-by-query-routing - UpdateByQueryRequestBuilder updateByQuery = UpdateByQueryAction.INSTANCE.newRequestBuilder(client); + UpdateByQueryRequestBuilder updateByQuery = new UpdateByQueryRequestBuilder(client, UpdateByQueryAction.INSTANCE); updateByQuery.source().setRouting("cat"); BulkByScrollResponse response = updateByQuery.get(); // end::update-by-query-routing } { // tag::update-by-query-pipeline - UpdateByQueryRequestBuilder updateByQuery = UpdateByQueryAction.INSTANCE.newRequestBuilder(client); + UpdateByQueryRequestBuilder updateByQuery = new UpdateByQueryRequestBuilder(client, UpdateByQueryAction.INSTANCE); updateByQuery.setPipeline("hurray"); BulkByScrollResponse response = updateByQuery.get(); // end::update-by-query-pipeline @@ -156,7 +158,7 @@ public void updateByQuery() { { TaskId taskId = null; // tag::update-by-query-rethrottle - RethrottleAction.INSTANCE.newRequestBuilder(client) + new RethrottleRequestBuilder(client, RethrottleAction.INSTANCE) .setTaskId(taskId) .setRequestsPerSecond(2.0f) .get(); @@ -167,7 +169,7 @@ public void updateByQuery() { public void deleteByQuery() { Client client = client(); // tag::delete-by-query-sync - BulkByScrollResponse response = DeleteByQueryAction.INSTANCE.newRequestBuilder(client) + BulkByScrollResponse response = new DeleteByQueryRequestBuilder(client, DeleteByQueryAction.INSTANCE) .filter(QueryBuilders.matchQuery("gender", "male")) // <1> .source("persons") // <2> .get(); // <3> @@ -175,7 +177,7 @@ public void deleteByQuery() { // end::delete-by-query-sync // tag::delete-by-query-async - DeleteByQueryAction.INSTANCE.newRequestBuilder(client) + new DeleteByQueryRequestBuilder(client, DeleteByQueryAction.INSTANCE) .filter(QueryBuilders.matchQuery("gender", "male")) // <1> .source("persons") // <2> .execute(new ActionListener() { // <3> diff --git a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java index 17345f5c85b65..727710e8b6bdd 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java @@ -744,8 +744,8 @@ private class MyMockClient extends FilterClient { @Override @SuppressWarnings("unchecked") protected > void doExecute( - Action action, Request request, ActionListener listener) { + RequestBuilder extends ActionRequestBuilder> void doExecute( + Action action, Request request, ActionListener listener) { if (false == expectedHeaders.equals(threadPool().getThreadContext().getHeaders())) { listener.onFailure( new RuntimeException("Expected " + expectedHeaders + " but got " + threadPool().getThreadContext().getHeaders())); diff --git a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexFromRemoteWithAuthTests.java b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexFromRemoteWithAuthTests.java index f829c8f22d73c..72ba651dff9ae 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexFromRemoteWithAuthTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexFromRemoteWithAuthTests.java @@ -109,13 +109,13 @@ private RemoteInfo newRemoteInfo(String username, String password, Map request.get()); assertEquals(RestStatus.BAD_REQUEST, e.status()); @@ -123,7 +123,7 @@ public void testReindexSendsHeaders() throws Exception { } public void testReindexWithoutAuthenticationWhenRequired() throws Exception { - ReindexRequestBuilder request = ReindexAction.INSTANCE.newRequestBuilder(client()).source("source").destination("dest") + ReindexRequestBuilder request = new ReindexRequestBuilder(client(), ReindexAction.INSTANCE).source("source").destination("dest") .setRemoteInfo(newRemoteInfo(null, null, emptyMap())); ElasticsearchStatusException e = expectThrows(ElasticsearchStatusException.class, () -> request.get()); assertEquals(RestStatus.UNAUTHORIZED, e.status()); @@ -132,7 +132,7 @@ public void testReindexWithoutAuthenticationWhenRequired() throws Exception { } public void testReindexWithBadAuthentication() throws Exception { - ReindexRequestBuilder request = ReindexAction.INSTANCE.newRequestBuilder(client()).source("source").destination("dest") + ReindexRequestBuilder request = new ReindexRequestBuilder(client(), ReindexAction.INSTANCE).source("source").destination("dest") .setRemoteInfo(newRemoteInfo("junk", "auth", emptyMap())); ElasticsearchStatusException e = expectThrows(ElasticsearchStatusException.class, () -> request.get()); assertThat(e.getMessage(), containsString("\"reason\":\"Bad Authorization\"")); diff --git a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexTestCase.java b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexTestCase.java index 54854afb35ea4..01b5539a23c48 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexTestCase.java +++ b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexTestCase.java @@ -47,19 +47,19 @@ protected Collection> transportClientPlugins() { } protected ReindexRequestBuilder reindex() { - return ReindexAction.INSTANCE.newRequestBuilder(client()); + return new ReindexRequestBuilder(client(), ReindexAction.INSTANCE); } protected UpdateByQueryRequestBuilder updateByQuery() { - return UpdateByQueryAction.INSTANCE.newRequestBuilder(client()); + return new UpdateByQueryRequestBuilder(client(), UpdateByQueryAction.INSTANCE); } protected DeleteByQueryRequestBuilder deleteByQuery() { - return DeleteByQueryAction.INSTANCE.newRequestBuilder(client()); + return new DeleteByQueryRequestBuilder(client(), DeleteByQueryAction.INSTANCE); } protected RethrottleRequestBuilder rethrottle() { - return RethrottleAction.INSTANCE.newRequestBuilder(client()); + return new RethrottleRequestBuilder(client(), RethrottleAction.INSTANCE); } public static BulkIndexByScrollResponseMatcher matcher() { diff --git a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/RetryTests.java b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/RetryTests.java index aea720aeb21e2..4fe3d1a3a6eff 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/RetryTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/RetryTests.java @@ -106,7 +106,7 @@ final Settings nodeSettings() { public void testReindex() throws Exception { testCase( ReindexAction.NAME, - client -> ReindexAction.INSTANCE.newRequestBuilder(client).source("source").destination("dest"), + client -> new ReindexRequestBuilder(client, ReindexAction.INSTANCE).source("source").destination("dest"), matcher().created(DOC_COUNT)); } @@ -127,7 +127,7 @@ public void testReindexFromRemote() throws Exception { TransportAddress address = masterNode.getHttp().getAddress().publishAddress(); RemoteInfo remote = new RemoteInfo("http", address.getAddress(), address.getPort(), new BytesArray("{\"match_all\":{}}"), null, null, emptyMap(), RemoteInfo.DEFAULT_SOCKET_TIMEOUT, RemoteInfo.DEFAULT_CONNECT_TIMEOUT); - ReindexRequestBuilder request = ReindexAction.INSTANCE.newRequestBuilder(client).source("source").destination("dest") + ReindexRequestBuilder request = new ReindexRequestBuilder(client, ReindexAction.INSTANCE).source("source").destination("dest") .setRemoteInfo(remote); return request; }; @@ -135,12 +135,12 @@ public void testReindexFromRemote() throws Exception { } public void testUpdateByQuery() throws Exception { - testCase(UpdateByQueryAction.NAME, client -> UpdateByQueryAction.INSTANCE.newRequestBuilder(client).source("source"), + testCase(UpdateByQueryAction.NAME, client -> new UpdateByQueryRequestBuilder(client, UpdateByQueryAction.INSTANCE).source("source"), matcher().updated(DOC_COUNT)); } public void testDeleteByQuery() throws Exception { - testCase(DeleteByQueryAction.NAME, client -> DeleteByQueryAction.INSTANCE.newRequestBuilder(client).source("source") + testCase(DeleteByQueryAction.NAME, client -> new DeleteByQueryRequestBuilder(client, DeleteByQueryAction.INSTANCE).source("source") .filter(QueryBuilders.matchAllQuery()), matcher().deleted(DOC_COUNT)); } diff --git a/server/src/main/java/org/elasticsearch/action/Action.java b/server/src/main/java/org/elasticsearch/action/Action.java index 51e3f5440ea4f..8d419f379d3b0 100644 --- a/server/src/main/java/org/elasticsearch/action/Action.java +++ b/server/src/main/java/org/elasticsearch/action/Action.java @@ -19,20 +19,13 @@ package org.elasticsearch.action; -import org.elasticsearch.client.ElasticsearchClient; - /** * Base action. Supports building the Request through a RequestBuilder. */ -public abstract class Action> +public abstract class Action extends GenericAction { protected Action(String name) { super(name); } - - /** - * Creates a new request builder given the client provided as argument - */ - public abstract RequestBuilder newRequestBuilder(ElasticsearchClient client); } diff --git a/server/src/main/java/org/elasticsearch/action/ActionRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/ActionRequestBuilder.java index 964568fc472fd..208c609333c8c 100644 --- a/server/src/main/java/org/elasticsearch/action/ActionRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/ActionRequestBuilder.java @@ -24,14 +24,13 @@ import java.util.Objects; -public abstract class ActionRequestBuilder> { +public abstract class ActionRequestBuilder { - protected final Action action; + protected final Action action; protected final Request request; protected final ElasticsearchClient client; - protected ActionRequestBuilder(ElasticsearchClient client, Action action, Request request) { + protected ActionRequestBuilder(ElasticsearchClient client, Action action, Request request) { Objects.requireNonNull(action, "action must not be null"); this.action = action; this.request = request; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainAction.java index d34ac63602d93..648429cbf5cbd 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainAction.java @@ -25,9 +25,7 @@ /** * Action for explaining shard allocation for a shard in the cluster */ -public class ClusterAllocationExplainAction extends Action { +public class ClusterAllocationExplainAction extends Action { public static final ClusterAllocationExplainAction INSTANCE = new ClusterAllocationExplainAction(); public static final String NAME = "cluster:monitor/allocation/explain"; @@ -40,9 +38,4 @@ private ClusterAllocationExplainAction() { public ClusterAllocationExplainResponse newResponse() { return new ClusterAllocationExplainResponse(); } - - @Override - public ClusterAllocationExplainRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ClusterAllocationExplainRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthAction.java index 786b318511684..31781ca13fe86 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.cluster.health; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ClusterHealthAction extends Action { +public class ClusterHealthAction extends Action { public static final ClusterHealthAction INSTANCE = new ClusterHealthAction(); public static final String NAME = "cluster:monitor/health"; @@ -35,9 +34,4 @@ private ClusterHealthAction() { public ClusterHealthResponse newResponse() { return new ClusterHealthResponse(); } - - @Override - public ClusterHealthRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ClusterHealthRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/hotthreads/NodesHotThreadsAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/hotthreads/NodesHotThreadsAction.java index 57ca90288ce25..a3b4161732700 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/hotthreads/NodesHotThreadsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/hotthreads/NodesHotThreadsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.cluster.node.hotthreads; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class NodesHotThreadsAction extends Action { +public class NodesHotThreadsAction extends Action { public static final NodesHotThreadsAction INSTANCE = new NodesHotThreadsAction(); public static final String NAME = "cluster:monitor/nodes/hot_threads"; @@ -35,9 +34,4 @@ private NodesHotThreadsAction() { public NodesHotThreadsResponse newResponse() { return new NodesHotThreadsResponse(); } - - @Override - public NodesHotThreadsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new NodesHotThreadsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoAction.java index afc90c3c1efc1..e46bc54d80004 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.cluster.node.info; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class NodesInfoAction extends Action { +public class NodesInfoAction extends Action { public static final NodesInfoAction INSTANCE = new NodesInfoAction(); public static final String NAME = "cluster:monitor/nodes/info"; @@ -35,9 +34,4 @@ private NodesInfoAction() { public NodesInfoResponse newResponse() { return new NodesInfoResponse(); } - - @Override - public NodesInfoRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new NodesInfoRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsAction.java index 857922bf9ebce..d8018716135cb 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.cluster.node.stats; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class NodesStatsAction extends Action { +public class NodesStatsAction extends Action { public static final NodesStatsAction INSTANCE = new NodesStatsAction(); public static final String NAME = "cluster:monitor/nodes/stats"; @@ -35,9 +34,4 @@ private NodesStatsAction() { public NodesStatsResponse newResponse() { return new NodesStatsResponse(); } - - @Override - public NodesStatsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new NodesStatsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/cancel/CancelTasksAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/cancel/CancelTasksAction.java index 9ad0d6e4d52d8..0c21c9a919849 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/cancel/CancelTasksAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/cancel/CancelTasksAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.cluster.node.tasks.cancel; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action for cancelling running tasks */ -public class CancelTasksAction extends Action { +public class CancelTasksAction extends Action { public static final CancelTasksAction INSTANCE = new CancelTasksAction(); public static final String NAME = "cluster:admin/tasks/cancel"; @@ -38,9 +37,4 @@ private CancelTasksAction() { public CancelTasksResponse newResponse() { return new CancelTasksResponse(); } - - @Override - public CancelTasksRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new CancelTasksRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskAction.java index c30f5e4091b75..9dfe1e83e5f9a 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.cluster.node.tasks.get; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action for retrieving a list of currently running tasks */ -public class GetTaskAction extends Action { +public class GetTaskAction extends Action { public static final GetTaskAction INSTANCE = new GetTaskAction(); public static final String NAME = "cluster:monitor/task/get"; @@ -38,9 +37,4 @@ private GetTaskAction() { public GetTaskResponse newResponse() { return new GetTaskResponse(); } - - @Override - public GetTaskRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetTaskRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskRequestBuilder.java index e1042df2ac35e..348c4c7a69ba5 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskRequestBuilder.java @@ -27,7 +27,7 @@ /** * Builder for the request to retrieve the list of tasks running on the specified nodes */ -public class GetTaskRequestBuilder extends ActionRequestBuilder { +public class GetTaskRequestBuilder extends ActionRequestBuilder { public GetTaskRequestBuilder(ElasticsearchClient client, GetTaskAction action) { super(client, action, new GetTaskRequest()); } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksAction.java index acc11861108de..e054f074aa21e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.cluster.node.tasks.list; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action for retrieving a list of currently running tasks */ -public class ListTasksAction extends Action { +public class ListTasksAction extends Action { public static final ListTasksAction INSTANCE = new ListTasksAction(); public static final String NAME = "cluster:monitor/tasks/lists"; @@ -38,9 +37,4 @@ private ListTasksAction() { public ListTasksResponse newResponse() { return new ListTasksResponse(); } - - @Override - public ListTasksRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ListTasksRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodesUsageAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodesUsageAction.java index 358659e5f61f7..7722339ebe0ee 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodesUsageAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodesUsageAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.cluster.node.usage; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class NodesUsageAction extends Action { +public class NodesUsageAction extends Action { public static final NodesUsageAction INSTANCE = new NodesUsageAction(); public static final String NAME = "cluster:monitor/nodes/usage"; @@ -31,11 +30,6 @@ protected NodesUsageAction() { super(NAME); } - @Override - public NodesUsageRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new NodesUsageRequestBuilder(client, this); - } - @Override public NodesUsageResponse newResponse() { return new NodesUsageResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodesUsageRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodesUsageRequestBuilder.java index 76d14556b9c4a..05ab953a0d919 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodesUsageRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodesUsageRequestBuilder.java @@ -26,8 +26,7 @@ public class NodesUsageRequestBuilder extends NodesOperationRequestBuilder { - public NodesUsageRequestBuilder(ElasticsearchClient client, - Action action) { + public NodesUsageRequestBuilder(ElasticsearchClient client, Action action) { super(client, action, new NodesUsageRequest()); } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/remote/RemoteInfoAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/remote/RemoteInfoAction.java index aa546c7dffd26..6e3c877156d80 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/remote/RemoteInfoAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/remote/RemoteInfoAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.cluster.remote; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public final class RemoteInfoAction extends Action { +public final class RemoteInfoAction extends Action { public static final String NAME = "cluster:monitor/remote/info"; public static final RemoteInfoAction INSTANCE = new RemoteInfoAction(); @@ -31,11 +30,6 @@ public RemoteInfoAction() { super(NAME); } - @Override - public RemoteInfoRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RemoteInfoRequestBuilder(client, INSTANCE); - } - @Override public RemoteInfoResponse newResponse() { return new RemoteInfoResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/remote/RemoteInfoRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/remote/RemoteInfoRequestBuilder.java index f46f5ecd2d3ca..bd55377ade766 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/remote/RemoteInfoRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/remote/RemoteInfoRequestBuilder.java @@ -22,7 +22,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -public final class RemoteInfoRequestBuilder extends ActionRequestBuilder { +public final class RemoteInfoRequestBuilder extends ActionRequestBuilder { public RemoteInfoRequestBuilder(ElasticsearchClient client, RemoteInfoAction action) { super(client, action, new RemoteInfoRequest()); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/delete/DeleteRepositoryAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/delete/DeleteRepositoryAction.java index 83166753b27a3..3d7f9187ea256 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/delete/DeleteRepositoryAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/delete/DeleteRepositoryAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.cluster.repositories.delete; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Unregister repository action */ -public class DeleteRepositoryAction extends Action { +public class DeleteRepositoryAction extends Action { public static final DeleteRepositoryAction INSTANCE = new DeleteRepositoryAction(); public static final String NAME = "cluster:admin/repository/delete"; @@ -38,10 +37,5 @@ private DeleteRepositoryAction() { public DeleteRepositoryResponse newResponse() { return new DeleteRepositoryResponse(); } - - @Override - public DeleteRepositoryRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new DeleteRepositoryRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/get/GetRepositoriesAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/get/GetRepositoriesAction.java index c0d1d1bcde70d..0ec28a4781deb 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/get/GetRepositoriesAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/get/GetRepositoriesAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.cluster.repositories.get; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Get repositories action */ -public class GetRepositoriesAction extends Action { +public class GetRepositoriesAction extends Action { public static final GetRepositoriesAction INSTANCE = new GetRepositoriesAction(); public static final String NAME = "cluster:admin/repository/get"; @@ -38,10 +37,5 @@ private GetRepositoriesAction() { public GetRepositoriesResponse newResponse() { return new GetRepositoriesResponse(); } - - @Override - public GetRepositoriesRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetRepositoriesRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryAction.java index f3f8b51eeeaa3..3c3d24fb2d3f5 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.cluster.repositories.put; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Register repository action */ -public class PutRepositoryAction extends Action { +public class PutRepositoryAction extends Action { public static final PutRepositoryAction INSTANCE = new PutRepositoryAction(); public static final String NAME = "cluster:admin/repository/put"; @@ -38,10 +37,5 @@ private PutRepositoryAction() { public PutRepositoryResponse newResponse() { return new PutRepositoryResponse(); } - - @Override - public PutRepositoryRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new PutRepositoryRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryAction.java index d52945ac28c9b..4d5865fdf9cee 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.cluster.repositories.verify; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Unregister repository action */ -public class VerifyRepositoryAction extends Action { +public class VerifyRepositoryAction extends Action { public static final VerifyRepositoryAction INSTANCE = new VerifyRepositoryAction(); public static final String NAME = "cluster:admin/repository/verify"; @@ -38,10 +37,5 @@ private VerifyRepositoryAction() { public VerifyRepositoryResponse newResponse() { return new VerifyRepositoryResponse(); } - - @Override - public VerifyRepositoryRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new VerifyRepositoryRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteAction.java index 70a39d2d3295e..4366465ac69e9 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.cluster.reroute; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ClusterRerouteAction extends Action { +public class ClusterRerouteAction extends Action { public static final ClusterRerouteAction INSTANCE = new ClusterRerouteAction(); public static final String NAME = "cluster:admin/reroute"; @@ -35,9 +34,4 @@ private ClusterRerouteAction() { public ClusterRerouteResponse newResponse() { return new ClusterRerouteResponse(); } - - @Override - public ClusterRerouteRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ClusterRerouteRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsAction.java index bb0c0b08a925c..347deae04c049 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.cluster.settings; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ClusterUpdateSettingsAction extends Action { +public class ClusterUpdateSettingsAction extends Action { public static final ClusterUpdateSettingsAction INSTANCE = new ClusterUpdateSettingsAction(); public static final String NAME = "cluster:admin/settings/update"; @@ -35,9 +34,4 @@ private ClusterUpdateSettingsAction() { public ClusterUpdateSettingsResponse newResponse() { return new ClusterUpdateSettingsResponse(); } - - @Override - public ClusterUpdateSettingsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ClusterUpdateSettingsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsAction.java index cb3240a7929b2..3184298ef8b2e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.cluster.shards; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ClusterSearchShardsAction extends Action { +public class ClusterSearchShardsAction extends Action { public static final ClusterSearchShardsAction INSTANCE = new ClusterSearchShardsAction(); public static final String NAME = "indices:admin/shards/search_shards"; @@ -35,9 +34,4 @@ private ClusterSearchShardsAction() { public ClusterSearchShardsResponse newResponse() { return new ClusterSearchShardsResponse(); } - - @Override - public ClusterSearchShardsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ClusterSearchShardsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotAction.java index 9bdcd2c96bde3..c51ff1ff009cd 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.cluster.snapshots.create; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Create snapshot action */ -public class CreateSnapshotAction extends Action { +public class CreateSnapshotAction extends Action { public static final CreateSnapshotAction INSTANCE = new CreateSnapshotAction(); public static final String NAME = "cluster:admin/snapshot/create"; @@ -38,10 +37,5 @@ private CreateSnapshotAction() { public CreateSnapshotResponse newResponse() { return new CreateSnapshotResponse(); } - - @Override - public CreateSnapshotRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new CreateSnapshotRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/delete/DeleteSnapshotAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/delete/DeleteSnapshotAction.java index 8a794a0c8ff66..0a806e2d82d5e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/delete/DeleteSnapshotAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/delete/DeleteSnapshotAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.cluster.snapshots.delete; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Delete snapshot action */ -public class DeleteSnapshotAction extends Action { +public class DeleteSnapshotAction extends Action { public static final DeleteSnapshotAction INSTANCE = new DeleteSnapshotAction(); public static final String NAME = "cluster:admin/snapshot/delete"; @@ -38,10 +37,5 @@ private DeleteSnapshotAction() { public DeleteSnapshotResponse newResponse() { return new DeleteSnapshotResponse(); } - - @Override - public DeleteSnapshotRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new DeleteSnapshotRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsAction.java index 7d2cafb9ceda3..7eb23a836aad2 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.cluster.snapshots.get; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Get snapshots action */ -public class GetSnapshotsAction extends Action { +public class GetSnapshotsAction extends Action { public static final GetSnapshotsAction INSTANCE = new GetSnapshotsAction(); public static final String NAME = "cluster:admin/snapshot/get"; @@ -38,10 +37,5 @@ private GetSnapshotsAction() { public GetSnapshotsResponse newResponse() { return new GetSnapshotsResponse(); } - - @Override - public GetSnapshotsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetSnapshotsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotAction.java index 3836d2d7fa54c..4043784d470a7 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.cluster.snapshots.restore; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Restore snapshot action */ -public class RestoreSnapshotAction extends Action { +public class RestoreSnapshotAction extends Action { public static final RestoreSnapshotAction INSTANCE = new RestoreSnapshotAction(); public static final String NAME = "cluster:admin/snapshot/restore"; @@ -38,10 +37,5 @@ private RestoreSnapshotAction() { public RestoreSnapshotResponse newResponse() { return new RestoreSnapshotResponse(); } - - @Override - public RestoreSnapshotRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RestoreSnapshotRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusAction.java index 0a2d26198ecd4..20d1e80451d5b 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.cluster.snapshots.status; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Snapshots status action */ -public class SnapshotsStatusAction extends Action { +public class SnapshotsStatusAction extends Action { public static final SnapshotsStatusAction INSTANCE = new SnapshotsStatusAction(); public static final String NAME = "cluster:admin/snapshot/status"; @@ -38,10 +37,5 @@ private SnapshotsStatusAction() { public SnapshotsStatusResponse newResponse() { return new SnapshotsStatusResponse(); } - - @Override - public SnapshotsStatusRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SnapshotsStatusRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateAction.java index 959658f6e7ca9..663622b62a319 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.cluster.state; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ClusterStateAction extends Action { +public class ClusterStateAction extends Action { public static final ClusterStateAction INSTANCE = new ClusterStateAction(); public static final String NAME = "cluster:monitor/state"; @@ -35,9 +34,4 @@ private ClusterStateAction() { public ClusterStateResponse newResponse() { return new ClusterStateResponse(); } - - @Override - public ClusterStateRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ClusterStateRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsAction.java index 80ae0b6911bd1..a62c0a9743c57 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.cluster.stats; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ClusterStatsAction extends Action { +public class ClusterStatsAction extends Action { public static final ClusterStatsAction INSTANCE = new ClusterStatsAction(); public static final String NAME = "cluster:monitor/stats"; @@ -35,9 +34,4 @@ private ClusterStatsAction() { public ClusterStatsResponse newResponse() { return new ClusterStatsResponse(); } - - @Override - public ClusterStatsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ClusterStatsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/DeleteStoredScriptAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/DeleteStoredScriptAction.java index 61cb8561ea537..ab99a6aa8a75b 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/DeleteStoredScriptAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/DeleteStoredScriptAction.java @@ -20,10 +20,8 @@ package org.elasticsearch.action.admin.cluster.storedscripts; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class DeleteStoredScriptAction extends Action { +public class DeleteStoredScriptAction extends Action { public static final DeleteStoredScriptAction INSTANCE = new DeleteStoredScriptAction(); public static final String NAME = "cluster:admin/script/delete"; @@ -36,9 +34,4 @@ private DeleteStoredScriptAction() { public DeleteStoredScriptResponse newResponse() { return new DeleteStoredScriptResponse(); } - - @Override - public DeleteStoredScriptRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new DeleteStoredScriptRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptAction.java index 7b9eb5209cc5c..b5d5e864d0701 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptAction.java @@ -20,10 +20,8 @@ package org.elasticsearch.action.admin.cluster.storedscripts; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class GetStoredScriptAction extends Action { +public class GetStoredScriptAction extends Action { public static final GetStoredScriptAction INSTANCE = new GetStoredScriptAction(); public static final String NAME = "cluster:admin/script/get"; @@ -36,10 +34,4 @@ private GetStoredScriptAction() { public GetStoredScriptResponse newResponse() { return new GetStoredScriptResponse(); } - - @Override - public GetStoredScriptRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetStoredScriptRequestBuilder(client, this); - } - } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptAction.java index d01a12f58a2eb..770e6e12565e5 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptAction.java @@ -23,8 +23,7 @@ import org.elasticsearch.client.ElasticsearchClient; -public class PutStoredScriptAction extends Action { +public class PutStoredScriptAction extends Action { public static final PutStoredScriptAction INSTANCE = new PutStoredScriptAction(); public static final String NAME = "cluster:admin/script/put"; @@ -39,9 +38,4 @@ private PutStoredScriptAction() { public PutStoredScriptResponse newResponse() { return new PutStoredScriptResponse(); } - - @Override - public PutStoredScriptRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new PutStoredScriptRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/tasks/PendingClusterTasksAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/tasks/PendingClusterTasksAction.java index 0b420a4e505c2..98b17e9968405 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/tasks/PendingClusterTasksAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/tasks/PendingClusterTasksAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.cluster.tasks; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class PendingClusterTasksAction extends Action { +public class PendingClusterTasksAction extends Action { public static final PendingClusterTasksAction INSTANCE = new PendingClusterTasksAction(); public static final String NAME = "cluster:monitor/task"; @@ -35,9 +34,4 @@ private PendingClusterTasksAction() { public PendingClusterTasksResponse newResponse() { return new PendingClusterTasksResponse(); } - - @Override - public PendingClusterTasksRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new PendingClusterTasksRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesAction.java index d4045b8b22e20..f584a7520fe87 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.alias; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class IndicesAliasesAction extends Action { +public class IndicesAliasesAction extends Action { public static final IndicesAliasesAction INSTANCE = new IndicesAliasesAction(); public static final String NAME = "indices:admin/aliases"; @@ -35,9 +34,4 @@ private IndicesAliasesAction() { public IndicesAliasesResponse newResponse() { return new IndicesAliasesResponse(); } - - @Override - public IndicesAliasesRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new IndicesAliasesRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/AliasesExistAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/AliasesExistAction.java index 70467f4343ca3..de4d044e4cb0b 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/AliasesExistAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/AliasesExistAction.java @@ -21,9 +21,8 @@ import org.elasticsearch.action.Action; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest; -import org.elasticsearch.client.ElasticsearchClient; -public class AliasesExistAction extends Action { +public class AliasesExistAction extends Action { public static final AliasesExistAction INSTANCE = new AliasesExistAction(); public static final String NAME = "indices:admin/aliases/exists"; @@ -32,11 +31,6 @@ private AliasesExistAction() { super(NAME); } - @Override - public AliasesExistRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new AliasesExistRequestBuilder(client, this); - } - @Override public AliasesExistResponse newResponse() { return new AliasesExistResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java index f4e3868fda9d0..f50ae07d1f596 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java @@ -28,7 +28,7 @@ public abstract class BaseAliasesRequestBuilder> extends MasterNodeReadOperationRequestBuilder { - public BaseAliasesRequestBuilder(ElasticsearchClient client, Action action, String... aliases) { + public BaseAliasesRequestBuilder(ElasticsearchClient client, Action action, String... aliases) { super(client, action, new GetAliasesRequest(aliases)); } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesAction.java index 71badddacab75..d8f2453c2cbd0 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.alias.get; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class GetAliasesAction extends Action { +public class GetAliasesAction extends Action { public static final GetAliasesAction INSTANCE = new GetAliasesAction(); public static final String NAME = "indices:admin/aliases/get"; @@ -31,11 +30,6 @@ private GetAliasesAction() { super(NAME); } - @Override - public GetAliasesRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetAliasesRequestBuilder(client, this); - } - @Override public GetAliasesResponse newResponse() { return new GetAliasesResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeAction.java index 5b92af47b3793..1288eccede285 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.analyze; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class AnalyzeAction extends Action { +public class AnalyzeAction extends Action { public static final AnalyzeAction INSTANCE = new AnalyzeAction(); public static final String NAME = "indices:admin/analyze"; @@ -35,9 +34,4 @@ private AnalyzeAction() { public AnalyzeResponse newResponse() { return new AnalyzeResponse(); } - - @Override - public AnalyzeRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new AnalyzeRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java index f8e35168bcb26..f0b0b19ad5ffa 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.cache.clear; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ClearIndicesCacheAction extends Action { +public class ClearIndicesCacheAction extends Action { public static final ClearIndicesCacheAction INSTANCE = new ClearIndicesCacheAction(); public static final String NAME = "indices:admin/cache/clear"; @@ -35,9 +34,4 @@ private ClearIndicesCacheAction() { public ClearIndicesCacheResponse newResponse() { return new ClearIndicesCacheResponse(); } - - @Override - public ClearIndicesCacheRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ClearIndicesCacheRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexAction.java index 44151f2cfe9f9..f206324f5ea54 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.close; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class CloseIndexAction extends Action { +public class CloseIndexAction extends Action { public static final CloseIndexAction INSTANCE = new CloseIndexAction(); public static final String NAME = "indices:admin/close"; @@ -35,9 +34,4 @@ private CloseIndexAction() { public CloseIndexResponse newResponse() { return new CloseIndexResponse(); } - - @Override - public CloseIndexRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new CloseIndexRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexAction.java index 3bac77241bf9a..cceadaabefddc 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.create; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class CreateIndexAction extends Action { +public class CreateIndexAction extends Action { public static final CreateIndexAction INSTANCE = new CreateIndexAction(); public static final String NAME = "indices:admin/create"; @@ -35,9 +34,4 @@ private CreateIndexAction() { public CreateIndexResponse newResponse() { return new CreateIndexResponse(); } - - @Override - public CreateIndexRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new CreateIndexRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexAction.java index 2dcff890f3ed1..40cabf5e78175 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.delete; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class DeleteIndexAction extends Action { +public class DeleteIndexAction extends Action { public static final DeleteIndexAction INSTANCE = new DeleteIndexAction(); public static final String NAME = "indices:admin/delete"; @@ -35,9 +34,4 @@ private DeleteIndexAction() { public DeleteIndexResponse newResponse() { return new DeleteIndexResponse(); } - - @Override - public DeleteIndexRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new DeleteIndexRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/exists/indices/IndicesExistsAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/exists/indices/IndicesExistsAction.java index aaabcec516b9e..af655b9d1b081 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/exists/indices/IndicesExistsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/exists/indices/IndicesExistsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.exists.indices; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class IndicesExistsAction extends Action { +public class IndicesExistsAction extends Action { public static final IndicesExistsAction INSTANCE = new IndicesExistsAction(); public static final String NAME = "indices:admin/exists"; @@ -35,9 +34,4 @@ private IndicesExistsAction() { public IndicesExistsResponse newResponse() { return new IndicesExistsResponse(); } - - @Override - public IndicesExistsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new IndicesExistsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/exists/types/TypesExistsAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/exists/types/TypesExistsAction.java index 147d7b8f1abd0..3f3e1d98b5058 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/exists/types/TypesExistsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/exists/types/TypesExistsAction.java @@ -19,9 +19,8 @@ package org.elasticsearch.action.admin.indices.exists.types; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class TypesExistsAction extends Action { +public class TypesExistsAction extends Action { public static final TypesExistsAction INSTANCE = new TypesExistsAction(); public static final String NAME = "indices:admin/types/exists"; @@ -34,9 +33,4 @@ private TypesExistsAction() { public TypesExistsResponse newResponse() { return new TypesExistsResponse(); } - - @Override - public TypesExistsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new TypesExistsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushAction.java index 1812cfae1a7b8..41e7d214760b3 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.flush; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class FlushAction extends Action { +public class FlushAction extends Action { public static final FlushAction INSTANCE = new FlushAction(); public static final String NAME = "indices:admin/flush"; @@ -35,9 +34,4 @@ private FlushAction() { public FlushResponse newResponse() { return new FlushResponse(); } - - @Override - public FlushRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new FlushRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushAction.java index 291fd49c63ada..7501f2dc2c238 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushAction.java @@ -20,10 +20,9 @@ package org.elasticsearch.action.admin.indices.flush; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class SyncedFlushAction extends Action { +public class SyncedFlushAction extends Action { public static final SyncedFlushAction INSTANCE = new SyncedFlushAction(); public static final String NAME = "indices:admin/synced_flush"; @@ -36,9 +35,4 @@ private SyncedFlushAction() { public SyncedFlushResponse newResponse() { return new SyncedFlushResponse(); } - - @Override - public SyncedFlushRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SyncedFlushRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushRequestBuilder.java index 9e40726081153..aee7c4688bb6c 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushRequestBuilder.java @@ -23,7 +23,7 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.ElasticsearchClient; -public class SyncedFlushRequestBuilder extends ActionRequestBuilder { +public class SyncedFlushRequestBuilder extends ActionRequestBuilder { public SyncedFlushRequestBuilder(ElasticsearchClient client, SyncedFlushAction action) { super(client, action, new SyncedFlushRequest()); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeAction.java index 656c5b91a70fc..524d41333012b 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.forcemerge; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ForceMergeAction extends Action { +public class ForceMergeAction extends Action { public static final ForceMergeAction INSTANCE = new ForceMergeAction(); public static final String NAME = "indices:admin/forcemerge"; @@ -35,9 +34,4 @@ private ForceMergeAction() { public ForceMergeResponse newResponse() { return new ForceMergeResponse(); } - - @Override - public ForceMergeRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ForceMergeRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexAction.java index f692c1e02636d..843d331db95a0 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.get; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class GetIndexAction extends Action { +public class GetIndexAction extends Action { public static final GetIndexAction INSTANCE = new GetIndexAction(); public static final String NAME = "indices:admin/get"; @@ -31,11 +30,6 @@ private GetIndexAction() { super(NAME); } - @Override - public GetIndexRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetIndexRequestBuilder(client, this); - } - @Override public GetIndexResponse newResponse() { return new GetIndexResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsAction.java index 410292ca688b6..58fd60f997429 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.mapping.get; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class GetFieldMappingsAction extends Action { +public class GetFieldMappingsAction extends Action { public static final GetFieldMappingsAction INSTANCE = new GetFieldMappingsAction(); public static final String NAME = "indices:admin/mappings/fields/get"; @@ -31,11 +30,6 @@ private GetFieldMappingsAction() { super(NAME); } - @Override - public GetFieldMappingsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetFieldMappingsRequestBuilder(client, this); - } - @Override public GetFieldMappingsResponse newResponse() { return new GetFieldMappingsResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsRequestBuilder.java index 84b16ac20390c..a80ba8bf2ce8d 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsRequestBuilder.java @@ -25,7 +25,7 @@ import org.elasticsearch.common.util.ArrayUtils; /** A helper class to build {@link GetFieldMappingsRequest} objects */ -public class GetFieldMappingsRequestBuilder extends ActionRequestBuilder { +public class GetFieldMappingsRequestBuilder extends ActionRequestBuilder { public GetFieldMappingsRequestBuilder(ElasticsearchClient client, GetFieldMappingsAction action, String... indices) { super(client, action, new GetFieldMappingsRequest().indices(indices)); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsAction.java index 5a9425cadec7f..08042baa803ef 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.mapping.get; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class GetMappingsAction extends Action { +public class GetMappingsAction extends Action { public static final GetMappingsAction INSTANCE = new GetMappingsAction(); public static final String NAME = "indices:admin/mappings/get"; @@ -31,11 +30,6 @@ private GetMappingsAction() { super(NAME); } - @Override - public GetMappingsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetMappingsRequestBuilder(client, this); - } - @Override public GetMappingsResponse newResponse() { return new GetMappingsResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingAction.java index 5bcff09e01ab2..cdbf0bb8b53c2 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.mapping.put; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class PutMappingAction extends Action { +public class PutMappingAction extends Action { public static final PutMappingAction INSTANCE = new PutMappingAction(); public static final String NAME = "indices:admin/mapping/put"; @@ -35,9 +34,4 @@ private PutMappingAction() { public PutMappingResponse newResponse() { return new PutMappingResponse(); } - - @Override - public PutMappingRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new PutMappingRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexAction.java index c8553322d301a..669dbfc78a5b0 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.open; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class OpenIndexAction extends Action { +public class OpenIndexAction extends Action { public static final OpenIndexAction INSTANCE = new OpenIndexAction(); public static final String NAME = "indices:admin/open"; @@ -35,9 +34,4 @@ private OpenIndexAction() { public OpenIndexResponse newResponse() { return new OpenIndexResponse(); } - - @Override - public OpenIndexRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new OpenIndexRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryAction.java index a8848a23edc17..453d52c02a087 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.indices.recovery; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Recovery information action */ -public class RecoveryAction extends Action { +public class RecoveryAction extends Action { public static final RecoveryAction INSTANCE = new RecoveryAction(); public static final String NAME = "indices:monitor/recovery"; @@ -34,11 +33,6 @@ private RecoveryAction() { super(NAME); } - @Override - public RecoveryRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RecoveryRequestBuilder(client, this); - } - @Override public RecoveryResponse newResponse() { return new RecoveryResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshAction.java index cfc2fb3a09ff1..059e26d29fec5 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.refresh; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class RefreshAction extends Action { +public class RefreshAction extends Action { public static final RefreshAction INSTANCE = new RefreshAction(); public static final String NAME = "indices:admin/refresh"; @@ -35,9 +34,4 @@ private RefreshAction() { public RefreshResponse newResponse() { return new RefreshResponse(); } - - @Override - public RefreshRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RefreshRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverAction.java index f66c77968f14f..18edb82af08d7 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.rollover; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class RolloverAction extends Action { +public class RolloverAction extends Action { public static final RolloverAction INSTANCE = new RolloverAction(); public static final String NAME = "indices:admin/rollover"; @@ -35,9 +34,4 @@ private RolloverAction() { public RolloverResponse newResponse() { return new RolloverResponse(); } - - @Override - public RolloverRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RolloverRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsAction.java index a8cc79852c26c..420a2dea04cc5 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.segments; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class IndicesSegmentsAction extends Action { +public class IndicesSegmentsAction extends Action { public static final IndicesSegmentsAction INSTANCE = new IndicesSegmentsAction(); public static final String NAME = "indices:monitor/segments"; @@ -35,9 +34,4 @@ private IndicesSegmentsAction() { public IndicesSegmentResponse newResponse() { return new IndicesSegmentResponse(); } - - @Override - public IndicesSegmentsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new IndicesSegmentsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsAction.java index 1abf8e746fbb3..b06af8726878a 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.settings.get; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class GetSettingsAction extends Action { +public class GetSettingsAction extends Action { public static final GetSettingsAction INSTANCE = new GetSettingsAction(); public static final String NAME = "indices:monitor/settings/get"; @@ -31,11 +30,6 @@ public GetSettingsAction() { super(NAME); } - @Override - public GetSettingsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetSettingsRequestBuilder(client, this); - } - @Override public GetSettingsResponse newResponse() { return new GetSettingsResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsAction.java index a23874831c2f9..9a8c667e18202 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.settings.put; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class UpdateSettingsAction extends Action { +public class UpdateSettingsAction extends Action { public static final UpdateSettingsAction INSTANCE = new UpdateSettingsAction(); public static final String NAME = "indices:admin/settings/update"; @@ -35,9 +34,4 @@ private UpdateSettingsAction() { public UpdateSettingsResponse newResponse() { return new UpdateSettingsResponse(); } - - @Override - public UpdateSettingsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new UpdateSettingsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreRequestBuilder.java index 8ddaf62bd950a..bb21ea9f85eac 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreRequestBuilder.java @@ -30,7 +30,7 @@ */ public class IndicesShardStoreRequestBuilder extends MasterNodeReadOperationRequestBuilder { - public IndicesShardStoreRequestBuilder(ElasticsearchClient client, Action action, String... indices) { + public IndicesShardStoreRequestBuilder(ElasticsearchClient client, Action action, String... indices) { super(client, action, new IndicesShardStoresRequest(indices)); } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresAction.java index 6475d92ccbd63..8bb08ee0f09a8 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresAction.java @@ -20,7 +20,6 @@ package org.elasticsearch.action.admin.indices.shards; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action for {@link TransportIndicesShardStoresAction} @@ -29,7 +28,7 @@ * Shard store information reports which nodes hold shard copies, how recent they are * and any exceptions on opening the shard index or from previous engine failures */ -public class IndicesShardStoresAction extends Action { +public class IndicesShardStoresAction extends Action { public static final IndicesShardStoresAction INSTANCE = new IndicesShardStoresAction(); public static final String NAME = "indices:monitor/shard_stores"; @@ -42,9 +41,4 @@ private IndicesShardStoresAction() { public IndicesShardStoresResponse newResponse() { return new IndicesShardStoresResponse(); } - - @Override - public IndicesShardStoreRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new IndicesShardStoreRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeAction.java index b92631dd09917..5791999b7fc85 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeAction.java @@ -21,9 +21,8 @@ import org.elasticsearch.Version; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ResizeAction extends Action { +public class ResizeAction extends Action { public static final ResizeAction INSTANCE = new ResizeAction(); public static final String NAME = "indices:admin/resize"; @@ -37,9 +36,4 @@ private ResizeAction() { public ResizeResponse newResponse() { return new ResizeResponse(); } - - @Override - public ResizeRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ResizeRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequestBuilder.java index 4443dfd9e6c5f..36f645c16170c 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequestBuilder.java @@ -27,7 +27,7 @@ public class ResizeRequestBuilder extends AcknowledgedRequestBuilder { - public ResizeRequestBuilder(ElasticsearchClient client, Action action) { + public ResizeRequestBuilder(ElasticsearchClient client, Action action) { super(client, action, new ResizeRequest()); } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ShrinkAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ShrinkAction.java index 48c23d643ba4c..cddc8390b546e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ShrinkAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ShrinkAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.shrink; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ShrinkAction extends Action { +public class ShrinkAction extends Action { public static final ShrinkAction INSTANCE = new ShrinkAction(); public static final String NAME = "indices:admin/shrink"; @@ -35,9 +34,4 @@ private ShrinkAction() { public ResizeResponse newResponse() { return new ResizeResponse(); } - - @Override - public ResizeRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ResizeRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsAction.java index 1bf17115afbf2..60363722193cb 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.stats; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class IndicesStatsAction extends Action { +public class IndicesStatsAction extends Action { public static final IndicesStatsAction INSTANCE = new IndicesStatsAction(); public static final String NAME = "indices:monitor/stats"; @@ -35,9 +34,4 @@ private IndicesStatsAction() { public IndicesStatsResponse newResponse() { return new IndicesStatsResponse(); } - - @Override - public IndicesStatsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new IndicesStatsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteIndexTemplateAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteIndexTemplateAction.java index 3d871db3f4b5c..5cef3045846a2 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteIndexTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteIndexTemplateAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.template.delete; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class DeleteIndexTemplateAction extends Action { +public class DeleteIndexTemplateAction extends Action { public static final DeleteIndexTemplateAction INSTANCE = new DeleteIndexTemplateAction(); public static final String NAME = "indices:admin/template/delete"; @@ -35,9 +34,4 @@ private DeleteIndexTemplateAction() { public DeleteIndexTemplateResponse newResponse() { return new DeleteIndexTemplateResponse(); } - - @Override - public DeleteIndexTemplateRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new DeleteIndexTemplateRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetIndexTemplatesAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetIndexTemplatesAction.java index 545601f01089b..1735e7fee3873 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetIndexTemplatesAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetIndexTemplatesAction.java @@ -19,9 +19,8 @@ package org.elasticsearch.action.admin.indices.template.get; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class GetIndexTemplatesAction extends Action { +public class GetIndexTemplatesAction extends Action { public static final GetIndexTemplatesAction INSTANCE = new GetIndexTemplatesAction(); public static final String NAME = "indices:admin/template/get"; @@ -34,9 +33,4 @@ protected GetIndexTemplatesAction() { public GetIndexTemplatesResponse newResponse() { return new GetIndexTemplatesResponse(); } - - @Override - public GetIndexTemplatesRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetIndexTemplatesRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateAction.java index a442b5463bab8..b73384452e6ee 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.template.put; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class PutIndexTemplateAction extends Action { +public class PutIndexTemplateAction extends Action { public static final PutIndexTemplateAction INSTANCE = new PutIndexTemplateAction(); public static final String NAME = "indices:admin/template/put"; @@ -35,9 +34,4 @@ private PutIndexTemplateAction() { public PutIndexTemplateResponse newResponse() { return new PutIndexTemplateResponse(); } - - @Override - public PutIndexTemplateRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new PutIndexTemplateRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java index 98c4ea68d88cb..9e078a53bb714 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.upgrade.get; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class UpgradeStatusAction extends Action { +public class UpgradeStatusAction extends Action { public static final UpgradeStatusAction INSTANCE = new UpgradeStatusAction(); public static final String NAME = "indices:monitor/upgrade"; @@ -35,9 +34,4 @@ private UpgradeStatusAction() { public UpgradeStatusResponse newResponse() { return new UpgradeStatusResponse(); } - - @Override - public UpgradeStatusRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new UpgradeStatusRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeAction.java index 908a8a0d283ed..20f780cd0bce7 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.admin.indices.upgrade.post; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Upgrade index/indices action. */ -public class UpgradeAction extends Action { +public class UpgradeAction extends Action { public static final UpgradeAction INSTANCE = new UpgradeAction(); public static final String NAME = "indices:admin/upgrade"; @@ -38,9 +37,4 @@ private UpgradeAction() { public UpgradeResponse newResponse() { return new UpgradeResponse(); } - - @Override - public UpgradeRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new UpgradeRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeSettingsAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeSettingsAction.java index 54632261ef4a4..aabb9b3c660d4 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeSettingsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeSettingsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.upgrade.post; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class UpgradeSettingsAction extends Action { +public class UpgradeSettingsAction extends Action { public static final UpgradeSettingsAction INSTANCE = new UpgradeSettingsAction(); public static final String NAME = "internal:indices/admin/upgrade"; @@ -35,9 +34,4 @@ private UpgradeSettingsAction() { public UpgradeSettingsResponse newResponse() { return new UpgradeSettingsResponse(); } - - @Override - public UpgradeSettingsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new UpgradeSettingsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryAction.java index 51791062c83cc..47c982d5f6d85 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.admin.indices.validate.query; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ValidateQueryAction extends Action { +public class ValidateQueryAction extends Action { public static final ValidateQueryAction INSTANCE = new ValidateQueryAction(); public static final String NAME = "indices:admin/validate/query"; @@ -35,9 +34,4 @@ private ValidateQueryAction() { public ValidateQueryResponse newResponse() { return new ValidateQueryResponse(); } - - @Override - public ValidateQueryRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ValidateQueryRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/bulk/BulkAction.java b/server/src/main/java/org/elasticsearch/action/bulk/BulkAction.java index d4aba69c343f8..ea7d0160fd996 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/BulkAction.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/BulkAction.java @@ -20,11 +20,10 @@ package org.elasticsearch.action.bulk; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.transport.TransportRequestOptions; -public class BulkAction extends Action { +public class BulkAction extends Action { public static final BulkAction INSTANCE = new BulkAction(); public static final String NAME = "indices:data/write/bulk"; @@ -38,11 +37,6 @@ public BulkResponse newResponse() { return new BulkResponse(); } - @Override - public BulkRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new BulkRequestBuilder(client, this); - } - @Override public TransportRequestOptions transportOptions(Settings settings) { return TransportRequestOptions.builder() diff --git a/server/src/main/java/org/elasticsearch/action/bulk/BulkRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/bulk/BulkRequestBuilder.java index ca4a5ef2cbb91..a577569476c85 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/BulkRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/BulkRequestBuilder.java @@ -38,7 +38,7 @@ * A bulk request holds an ordered {@link IndexRequest}s and {@link DeleteRequest}s and allows to executes * it in a single batch. */ -public class BulkRequestBuilder extends ActionRequestBuilder +public class BulkRequestBuilder extends ActionRequestBuilder implements WriteRequestBuilder { public BulkRequestBuilder(ElasticsearchClient client, BulkAction action) { diff --git a/server/src/main/java/org/elasticsearch/action/delete/DeleteAction.java b/server/src/main/java/org/elasticsearch/action/delete/DeleteAction.java index 09aa9f586561f..23306d5db11de 100644 --- a/server/src/main/java/org/elasticsearch/action/delete/DeleteAction.java +++ b/server/src/main/java/org/elasticsearch/action/delete/DeleteAction.java @@ -22,7 +22,7 @@ import org.elasticsearch.action.Action; import org.elasticsearch.client.ElasticsearchClient; -public class DeleteAction extends Action { +public class DeleteAction extends Action { public static final DeleteAction INSTANCE = new DeleteAction(); public static final String NAME = "indices:data/write/delete"; @@ -35,9 +35,4 @@ private DeleteAction() { public DeleteResponse newResponse() { return new DeleteResponse(); } - - @Override - public DeleteRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new DeleteRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/explain/ExplainAction.java b/server/src/main/java/org/elasticsearch/action/explain/ExplainAction.java index b48530ce5271b..b298e62f514a1 100644 --- a/server/src/main/java/org/elasticsearch/action/explain/ExplainAction.java +++ b/server/src/main/java/org/elasticsearch/action/explain/ExplainAction.java @@ -20,12 +20,11 @@ package org.elasticsearch.action.explain; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Entry point for the explain feature. */ -public class ExplainAction extends Action { +public class ExplainAction extends Action { public static final ExplainAction INSTANCE = new ExplainAction(); public static final String NAME = "indices:data/read/explain"; @@ -34,11 +33,6 @@ private ExplainAction() { super(NAME); } - @Override - public ExplainRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ExplainRequestBuilder(client, this); - } - @Override public ExplainResponse newResponse() { return new ExplainResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesAction.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesAction.java index 93d67f3fc3cc4..24896d3c620d1 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesAction.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesAction.java @@ -20,10 +20,8 @@ package org.elasticsearch.action.fieldcaps; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class FieldCapabilitiesAction extends Action { +public class FieldCapabilitiesAction extends Action { public static final FieldCapabilitiesAction INSTANCE = new FieldCapabilitiesAction(); public static final String NAME = "indices:data/read/field_caps"; @@ -36,9 +34,4 @@ private FieldCapabilitiesAction() { public FieldCapabilitiesResponse newResponse() { return new FieldCapabilitiesResponse(); } - - @Override - public FieldCapabilitiesRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new FieldCapabilitiesRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestBuilder.java index 742d5b3ee3297..8da925e8fc98a 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestBuilder.java @@ -22,9 +22,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -public class FieldCapabilitiesRequestBuilder extends - ActionRequestBuilder { +public class FieldCapabilitiesRequestBuilder extends ActionRequestBuilder { public FieldCapabilitiesRequestBuilder(ElasticsearchClient client, FieldCapabilitiesAction action, String... indices) { diff --git a/server/src/main/java/org/elasticsearch/action/get/GetAction.java b/server/src/main/java/org/elasticsearch/action/get/GetAction.java index 69c67b1be2bc8..c9df5ffb98e00 100644 --- a/server/src/main/java/org/elasticsearch/action/get/GetAction.java +++ b/server/src/main/java/org/elasticsearch/action/get/GetAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.get; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class GetAction extends Action { +public class GetAction extends Action { public static final GetAction INSTANCE = new GetAction(); public static final String NAME = "indices:data/read/get"; @@ -35,9 +34,4 @@ private GetAction() { public GetResponse newResponse() { return new GetResponse(); } - - @Override - public GetRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/get/MultiGetAction.java b/server/src/main/java/org/elasticsearch/action/get/MultiGetAction.java index 8d6dfc10775f9..1080b71fb9f65 100644 --- a/server/src/main/java/org/elasticsearch/action/get/MultiGetAction.java +++ b/server/src/main/java/org/elasticsearch/action/get/MultiGetAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.get; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class MultiGetAction extends Action { +public class MultiGetAction extends Action { public static final MultiGetAction INSTANCE = new MultiGetAction(); public static final String NAME = "indices:data/read/mget"; @@ -35,9 +34,4 @@ private MultiGetAction() { public MultiGetResponse newResponse() { return new MultiGetResponse(); } - - @Override - public MultiGetRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new MultiGetRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/get/MultiGetRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/get/MultiGetRequestBuilder.java index 508dc99fc4dbd..4385447846b83 100644 --- a/server/src/main/java/org/elasticsearch/action/get/MultiGetRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/get/MultiGetRequestBuilder.java @@ -26,7 +26,7 @@ /** * A multi get document action request builder. */ -public class MultiGetRequestBuilder extends ActionRequestBuilder { +public class MultiGetRequestBuilder extends ActionRequestBuilder { public MultiGetRequestBuilder(ElasticsearchClient client, MultiGetAction action) { super(client, action, new MultiGetRequest()); diff --git a/server/src/main/java/org/elasticsearch/action/index/IndexAction.java b/server/src/main/java/org/elasticsearch/action/index/IndexAction.java index fa2bd06f29700..1f72369d9dbd5 100644 --- a/server/src/main/java/org/elasticsearch/action/index/IndexAction.java +++ b/server/src/main/java/org/elasticsearch/action/index/IndexAction.java @@ -22,7 +22,7 @@ import org.elasticsearch.action.Action; import org.elasticsearch.client.ElasticsearchClient; -public class IndexAction extends Action { +public class IndexAction extends Action { public static final IndexAction INSTANCE = new IndexAction(); public static final String NAME = "indices:data/write/index"; @@ -35,9 +35,4 @@ private IndexAction() { public IndexResponse newResponse() { return new IndexResponse(); } - - @Override - public IndexRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new IndexRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/ingest/DeletePipelineAction.java b/server/src/main/java/org/elasticsearch/action/ingest/DeletePipelineAction.java index ba1dd5d385fea..03271f439c709 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/DeletePipelineAction.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/DeletePipelineAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.ingest; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class DeletePipelineAction extends Action { +public class DeletePipelineAction extends Action { public static final DeletePipelineAction INSTANCE = new DeletePipelineAction(); public static final String NAME = "cluster:admin/ingest/pipeline/delete"; @@ -31,11 +30,6 @@ public DeletePipelineAction() { super(NAME); } - @Override - public DeletePipelineRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new DeletePipelineRequestBuilder(client, this); - } - @Override public WritePipelineResponse newResponse() { return new WritePipelineResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/ingest/DeletePipelineRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/ingest/DeletePipelineRequestBuilder.java index 90cbce135af2c..afe4ea1b5907b 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/DeletePipelineRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/DeletePipelineRequestBuilder.java @@ -22,7 +22,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -public class DeletePipelineRequestBuilder extends ActionRequestBuilder { +public class DeletePipelineRequestBuilder extends ActionRequestBuilder { public DeletePipelineRequestBuilder(ElasticsearchClient client, DeletePipelineAction action) { super(client, action, new DeletePipelineRequest()); diff --git a/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineAction.java b/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineAction.java index f6bc3d9a778dc..82e1a546b6e52 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineAction.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.ingest; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class GetPipelineAction extends Action { +public class GetPipelineAction extends Action { public static final GetPipelineAction INSTANCE = new GetPipelineAction(); public static final String NAME = "cluster:admin/ingest/pipeline/get"; @@ -31,11 +30,6 @@ public GetPipelineAction() { super(NAME); } - @Override - public GetPipelineRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetPipelineRequestBuilder(client, this); - } - @Override public GetPipelineResponse newResponse() { return new GetPipelineResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/ingest/IngestActionForwarder.java b/server/src/main/java/org/elasticsearch/action/ingest/IngestActionForwarder.java index 8b163eb1eedf8..991e233220726 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/IngestActionForwarder.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/IngestActionForwarder.java @@ -47,7 +47,7 @@ public IngestActionForwarder(TransportService transportService) { ingestNodes = new DiscoveryNode[0]; } - public void forwardIngestRequest(Action action, ActionRequest request, ActionListener listener) { + public void forwardIngestRequest(Action action, ActionRequest request, ActionListener listener) { transportService.sendRequest(randomIngestNode(), action.name(), request, new ActionListenerResponseHandler(listener, action::newResponse)); } diff --git a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineAction.java b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineAction.java index 8f4b4170f51b1..068cbea08399b 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineAction.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineAction.java @@ -20,10 +20,8 @@ package org.elasticsearch.action.ingest; import org.elasticsearch.action.Action; -import org.elasticsearch.action.index.IndexResponse; -import org.elasticsearch.client.ElasticsearchClient; -public class PutPipelineAction extends Action { +public class PutPipelineAction extends Action { public static final PutPipelineAction INSTANCE = new PutPipelineAction(); public static final String NAME = "cluster:admin/ingest/pipeline/put"; @@ -32,11 +30,6 @@ public PutPipelineAction() { super(NAME); } - @Override - public PutPipelineRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new PutPipelineRequestBuilder(client, this); - } - @Override public WritePipelineResponse newResponse() { return new WritePipelineResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequestBuilder.java index c03b3b84f8b5b..ffbb94d27a05b 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequestBuilder.java @@ -24,7 +24,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentType; -public class PutPipelineRequestBuilder extends ActionRequestBuilder { +public class PutPipelineRequestBuilder extends ActionRequestBuilder { public PutPipelineRequestBuilder(ElasticsearchClient client, PutPipelineAction action) { super(client, action, new PutPipelineRequest()); diff --git a/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineAction.java b/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineAction.java index c1d219a4190e9..4da35ba25b7eb 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineAction.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.ingest; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class SimulatePipelineAction extends Action { +public class SimulatePipelineAction extends Action { public static final SimulatePipelineAction INSTANCE = new SimulatePipelineAction(); public static final String NAME = "cluster:admin/ingest/pipeline/simulate"; @@ -31,11 +30,6 @@ public SimulatePipelineAction() { super(NAME); } - @Override - public SimulatePipelineRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SimulatePipelineRequestBuilder(client, this); - } - @Override public SimulatePipelineResponse newResponse() { return new SimulatePipelineResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequestBuilder.java index bb5d0e4e40003..7b7d31603aa6b 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequestBuilder.java @@ -24,7 +24,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentType; -public class SimulatePipelineRequestBuilder extends ActionRequestBuilder { +public class SimulatePipelineRequestBuilder extends ActionRequestBuilder { /** * Create a new builder for {@link SimulatePipelineRequest}s diff --git a/server/src/main/java/org/elasticsearch/action/main/MainAction.java b/server/src/main/java/org/elasticsearch/action/main/MainAction.java index 355c2a3434cce..10fd1f9887c7d 100644 --- a/server/src/main/java/org/elasticsearch/action/main/MainAction.java +++ b/server/src/main/java/org/elasticsearch/action/main/MainAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.main; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class MainAction extends Action { +public class MainAction extends Action { public static final String NAME = "cluster:monitor/main"; public static final MainAction INSTANCE = new MainAction(); @@ -31,11 +30,6 @@ public MainAction() { super(NAME); } - @Override - public MainRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new MainRequestBuilder(client, INSTANCE); - } - @Override public MainResponse newResponse() { return new MainResponse(); diff --git a/server/src/main/java/org/elasticsearch/action/main/MainRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/main/MainRequestBuilder.java index 6e973bd7d79d6..5b1c7338c90cb 100644 --- a/server/src/main/java/org/elasticsearch/action/main/MainRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/main/MainRequestBuilder.java @@ -22,7 +22,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -public class MainRequestBuilder extends ActionRequestBuilder { +public class MainRequestBuilder extends ActionRequestBuilder { public MainRequestBuilder(ElasticsearchClient client, MainAction action) { super(client, action, new MainRequest()); diff --git a/server/src/main/java/org/elasticsearch/action/search/ClearScrollAction.java b/server/src/main/java/org/elasticsearch/action/search/ClearScrollAction.java index 151635ac93f21..4edda430c5cda 100644 --- a/server/src/main/java/org/elasticsearch/action/search/ClearScrollAction.java +++ b/server/src/main/java/org/elasticsearch/action/search/ClearScrollAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.search; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ClearScrollAction extends Action { +public class ClearScrollAction extends Action { public static final ClearScrollAction INSTANCE = new ClearScrollAction(); public static final String NAME = "indices:data/read/scroll/clear"; @@ -35,9 +34,4 @@ private ClearScrollAction() { public ClearScrollResponse newResponse() { return new ClearScrollResponse(); } - - @Override - public ClearScrollRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ClearScrollRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/search/ClearScrollRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/search/ClearScrollRequestBuilder.java index b1ca4a60a859f..6c5d7bba496d6 100644 --- a/server/src/main/java/org/elasticsearch/action/search/ClearScrollRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/search/ClearScrollRequestBuilder.java @@ -24,7 +24,7 @@ import java.util.List; -public class ClearScrollRequestBuilder extends ActionRequestBuilder { +public class ClearScrollRequestBuilder extends ActionRequestBuilder { public ClearScrollRequestBuilder(ElasticsearchClient client, ClearScrollAction action) { super(client, action, new ClearScrollRequest()); diff --git a/server/src/main/java/org/elasticsearch/action/search/MultiSearchAction.java b/server/src/main/java/org/elasticsearch/action/search/MultiSearchAction.java index 04651c00c026c..c2c8c4ce23256 100644 --- a/server/src/main/java/org/elasticsearch/action/search/MultiSearchAction.java +++ b/server/src/main/java/org/elasticsearch/action/search/MultiSearchAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.search; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class MultiSearchAction extends Action { +public class MultiSearchAction extends Action { public static final MultiSearchAction INSTANCE = new MultiSearchAction(); public static final String NAME = "indices:data/read/msearch"; @@ -35,9 +34,4 @@ private MultiSearchAction() { public MultiSearchResponse newResponse() { return new MultiSearchResponse(); } - - @Override - public MultiSearchRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new MultiSearchRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequestBuilder.java index 6cebb73fb4fa6..64d512f4be05f 100644 --- a/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequestBuilder.java @@ -26,7 +26,7 @@ /** * A request builder for multiple search requests. */ -public class MultiSearchRequestBuilder extends ActionRequestBuilder { +public class MultiSearchRequestBuilder extends ActionRequestBuilder { public MultiSearchRequestBuilder(ElasticsearchClient client, MultiSearchAction action) { super(client, action, new MultiSearchRequest()); diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchAction.java b/server/src/main/java/org/elasticsearch/action/search/SearchAction.java index 38a77fa772adb..80bc1abcca8c6 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchAction.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.search; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class SearchAction extends Action { +public class SearchAction extends Action { public static final SearchAction INSTANCE = new SearchAction(); public static final String NAME = "indices:data/read/search"; @@ -35,9 +34,4 @@ private SearchAction() { public SearchResponse newResponse() { return new SearchResponse(); } - - @Override - public SearchRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SearchRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java index 424db04ce3903..22b0b0c44d657 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java @@ -44,7 +44,7 @@ /** * A search action request builder. */ -public class SearchRequestBuilder extends ActionRequestBuilder { +public class SearchRequestBuilder extends ActionRequestBuilder { public SearchRequestBuilder(ElasticsearchClient client, SearchAction action) { super(client, action, new SearchRequest()); diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchScrollAction.java b/server/src/main/java/org/elasticsearch/action/search/SearchScrollAction.java index 6bd23f7741a70..209e3c7f583e2 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchScrollAction.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchScrollAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.search; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class SearchScrollAction extends Action { +public class SearchScrollAction extends Action { public static final SearchScrollAction INSTANCE = new SearchScrollAction(); public static final String NAME = "indices:data/read/scroll"; @@ -35,9 +34,4 @@ private SearchScrollAction() { public SearchResponse newResponse() { return new SearchResponse(); } - - @Override - public SearchScrollRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SearchScrollRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchScrollRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/search/SearchScrollRequestBuilder.java index 781753afec273..4afb8d86fbfad 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchScrollRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchScrollRequestBuilder.java @@ -27,7 +27,7 @@ /** * A search scroll action request builder. */ -public class SearchScrollRequestBuilder extends ActionRequestBuilder { +public class SearchScrollRequestBuilder extends ActionRequestBuilder { public SearchScrollRequestBuilder(ElasticsearchClient client, SearchScrollAction action) { super(client, action, new SearchScrollRequest()); diff --git a/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastOperationRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastOperationRequestBuilder.java index fb995513acbbf..056381cc7dc11 100644 --- a/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastOperationRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastOperationRequestBuilder.java @@ -25,9 +25,9 @@ import org.elasticsearch.client.ElasticsearchClient; public abstract class BroadcastOperationRequestBuilder, Response extends BroadcastResponse, RequestBuilder extends BroadcastOperationRequestBuilder> - extends ActionRequestBuilder { + extends ActionRequestBuilder { - protected BroadcastOperationRequestBuilder(ElasticsearchClient client, Action action, Request request) { + protected BroadcastOperationRequestBuilder(ElasticsearchClient client, Action action, Request request) { super(client, action, request); } diff --git a/server/src/main/java/org/elasticsearch/action/support/master/AcknowledgedRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/support/master/AcknowledgedRequestBuilder.java index 6a4a2b9c0d7e4..45d92801170f5 100644 --- a/server/src/main/java/org/elasticsearch/action/support/master/AcknowledgedRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/support/master/AcknowledgedRequestBuilder.java @@ -28,7 +28,7 @@ public abstract class AcknowledgedRequestBuilder, Response extends AcknowledgedResponse, RequestBuilder extends AcknowledgedRequestBuilder> extends MasterNodeOperationRequestBuilder { - protected AcknowledgedRequestBuilder(ElasticsearchClient client, Action action, Request request) { + protected AcknowledgedRequestBuilder(ElasticsearchClient client, Action action, Request request) { super(client, action, request); } diff --git a/server/src/main/java/org/elasticsearch/action/support/master/MasterNodeOperationRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/support/master/MasterNodeOperationRequestBuilder.java index 0b3b5af36d26e..1302d2003da19 100644 --- a/server/src/main/java/org/elasticsearch/action/support/master/MasterNodeOperationRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/support/master/MasterNodeOperationRequestBuilder.java @@ -29,9 +29,9 @@ * Base request builder for master node operations */ public abstract class MasterNodeOperationRequestBuilder, Response extends ActionResponse, RequestBuilder extends MasterNodeOperationRequestBuilder> - extends ActionRequestBuilder { + extends ActionRequestBuilder { - protected MasterNodeOperationRequestBuilder(ElasticsearchClient client, Action action, Request request) { + protected MasterNodeOperationRequestBuilder(ElasticsearchClient client, Action action, Request request) { super(client, action, request); } diff --git a/server/src/main/java/org/elasticsearch/action/support/master/MasterNodeReadOperationRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/support/master/MasterNodeReadOperationRequestBuilder.java index 7955abfbe96c2..96735f101e6a7 100644 --- a/server/src/main/java/org/elasticsearch/action/support/master/MasterNodeReadOperationRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/support/master/MasterNodeReadOperationRequestBuilder.java @@ -29,7 +29,7 @@ public abstract class MasterNodeReadOperationRequestBuilder, Response extends ActionResponse, RequestBuilder extends MasterNodeReadOperationRequestBuilder> extends MasterNodeOperationRequestBuilder { - protected MasterNodeReadOperationRequestBuilder(ElasticsearchClient client, Action action, Request request) { + protected MasterNodeReadOperationRequestBuilder(ElasticsearchClient client, Action action, Request request) { super(client, action, request); } diff --git a/server/src/main/java/org/elasticsearch/action/support/master/info/ClusterInfoRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/support/master/info/ClusterInfoRequestBuilder.java index 96e0ad8ee6bab..26dedf15da80d 100644 --- a/server/src/main/java/org/elasticsearch/action/support/master/info/ClusterInfoRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/support/master/info/ClusterInfoRequestBuilder.java @@ -28,7 +28,7 @@ public abstract class ClusterInfoRequestBuilder, Response extends ActionResponse, Builder extends ClusterInfoRequestBuilder> extends MasterNodeReadOperationRequestBuilder { - protected ClusterInfoRequestBuilder(ElasticsearchClient client, Action action, Request request) { + protected ClusterInfoRequestBuilder(ElasticsearchClient client, Action action, Request request) { super(client, action, request); } diff --git a/server/src/main/java/org/elasticsearch/action/support/nodes/NodesOperationRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/support/nodes/NodesOperationRequestBuilder.java index ffb43e7ee0432..37c06a419589a 100644 --- a/server/src/main/java/org/elasticsearch/action/support/nodes/NodesOperationRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/support/nodes/NodesOperationRequestBuilder.java @@ -25,9 +25,9 @@ import org.elasticsearch.common.unit.TimeValue; public abstract class NodesOperationRequestBuilder, Response extends BaseNodesResponse, RequestBuilder extends NodesOperationRequestBuilder> - extends ActionRequestBuilder { + extends ActionRequestBuilder { - protected NodesOperationRequestBuilder(ElasticsearchClient client, Action action, Request request) { + protected NodesOperationRequestBuilder(ElasticsearchClient client, Action action, Request request) { super(client, action, request); } diff --git a/server/src/main/java/org/elasticsearch/action/support/replication/ReplicationRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/support/replication/ReplicationRequestBuilder.java index 15d36ad346780..32fbaf70ab35c 100644 --- a/server/src/main/java/org/elasticsearch/action/support/replication/ReplicationRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/support/replication/ReplicationRequestBuilder.java @@ -27,9 +27,9 @@ import org.elasticsearch.common.unit.TimeValue; public abstract class ReplicationRequestBuilder, Response extends ActionResponse, RequestBuilder extends ReplicationRequestBuilder> - extends ActionRequestBuilder { + extends ActionRequestBuilder { - protected ReplicationRequestBuilder(ElasticsearchClient client, Action action, Request request) { + protected ReplicationRequestBuilder(ElasticsearchClient client, Action action, Request request) { super(client, action, request); } diff --git a/server/src/main/java/org/elasticsearch/action/support/single/instance/InstanceShardOperationRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/support/single/instance/InstanceShardOperationRequestBuilder.java index 9e7a48dc49eea..0c5d26b0aed64 100644 --- a/server/src/main/java/org/elasticsearch/action/support/single/instance/InstanceShardOperationRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/support/single/instance/InstanceShardOperationRequestBuilder.java @@ -26,9 +26,9 @@ import org.elasticsearch.common.unit.TimeValue; public abstract class InstanceShardOperationRequestBuilder, Response extends ActionResponse, RequestBuilder extends InstanceShardOperationRequestBuilder> - extends ActionRequestBuilder { + extends ActionRequestBuilder { - protected InstanceShardOperationRequestBuilder(ElasticsearchClient client, Action action, Request request) { + protected InstanceShardOperationRequestBuilder(ElasticsearchClient client, Action action, Request request) { super(client, action, request); } diff --git a/server/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardOperationRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardOperationRequestBuilder.java index af6ee2287f212..1de3479fb5d52 100644 --- a/server/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardOperationRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardOperationRequestBuilder.java @@ -25,9 +25,9 @@ import org.elasticsearch.client.ElasticsearchClient; public abstract class SingleShardOperationRequestBuilder, Response extends ActionResponse, RequestBuilder extends SingleShardOperationRequestBuilder> - extends ActionRequestBuilder { + extends ActionRequestBuilder { - protected SingleShardOperationRequestBuilder(ElasticsearchClient client, Action action, Request request) { + protected SingleShardOperationRequestBuilder(ElasticsearchClient client, Action action, Request request) { super(client, action, request); } diff --git a/server/src/main/java/org/elasticsearch/action/support/tasks/TasksRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/support/tasks/TasksRequestBuilder.java index 656dae9992889..cda4497437a7b 100644 --- a/server/src/main/java/org/elasticsearch/action/support/tasks/TasksRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/support/tasks/TasksRequestBuilder.java @@ -31,9 +31,9 @@ public class TasksRequestBuilder< Request extends BaseTasksRequest, Response extends BaseTasksResponse, RequestBuilder extends TasksRequestBuilder - > extends ActionRequestBuilder { + > extends ActionRequestBuilder { - protected TasksRequestBuilder(ElasticsearchClient client, Action action, Request request) { + protected TasksRequestBuilder(ElasticsearchClient client, Action action, Request request) { super(client, action, request); } diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsAction.java b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsAction.java index a84ba25f5bb4e..f7a9eda6cc265 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsAction.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.termvectors; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class MultiTermVectorsAction extends Action { +public class MultiTermVectorsAction extends Action { public static final MultiTermVectorsAction INSTANCE = new MultiTermVectorsAction(); public static final String NAME = "indices:data/read/mtv"; @@ -35,9 +34,4 @@ private MultiTermVectorsAction() { public MultiTermVectorsResponse newResponse() { return new MultiTermVectorsResponse(); } - - @Override - public MultiTermVectorsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new MultiTermVectorsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequestBuilder.java index 2e68cd25b04d3..b982c4f720930 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequestBuilder.java @@ -23,7 +23,7 @@ import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.Nullable; -public class MultiTermVectorsRequestBuilder extends ActionRequestBuilder { +public class MultiTermVectorsRequestBuilder extends ActionRequestBuilder { public MultiTermVectorsRequestBuilder(ElasticsearchClient client, MultiTermVectorsAction action) { super(client, action, new MultiTermVectorsRequest()); diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsAction.java b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsAction.java index 982f7ad52c1aa..ded987c52a085 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsAction.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.action.termvectors; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class TermVectorsAction extends Action { +public class TermVectorsAction extends Action { public static final TermVectorsAction INSTANCE = new TermVectorsAction(); public static final String NAME = "indices:data/read/tv"; @@ -35,9 +34,4 @@ private TermVectorsAction() { public TermVectorsResponse newResponse() { return new TermVectorsResponse(); } - - @Override - public TermVectorsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new TermVectorsRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequestBuilder.java index 7faadef68d804..80bf769b9714e 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequestBuilder.java @@ -33,7 +33,7 @@ * Note, the {@code index}, {@code type} and {@code id} are * required. */ -public class TermVectorsRequestBuilder extends ActionRequestBuilder { +public class TermVectorsRequestBuilder extends ActionRequestBuilder { public TermVectorsRequestBuilder(ElasticsearchClient client, TermVectorsAction action) { super(client, action, new TermVectorsRequest()); diff --git a/server/src/main/java/org/elasticsearch/action/update/UpdateAction.java b/server/src/main/java/org/elasticsearch/action/update/UpdateAction.java index 7d7997a7a0b31..039939e752bb0 100644 --- a/server/src/main/java/org/elasticsearch/action/update/UpdateAction.java +++ b/server/src/main/java/org/elasticsearch/action/update/UpdateAction.java @@ -22,7 +22,7 @@ import org.elasticsearch.action.Action; import org.elasticsearch.client.ElasticsearchClient; -public class UpdateAction extends Action { +public class UpdateAction extends Action { public static final UpdateAction INSTANCE = new UpdateAction(); public static final String NAME = "indices:data/write/update"; @@ -35,9 +35,4 @@ private UpdateAction() { public UpdateResponse newResponse() { return new UpdateResponse(); } - - @Override - public UpdateRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new UpdateRequestBuilder(client, this); - } } diff --git a/server/src/main/java/org/elasticsearch/client/ElasticsearchClient.java b/server/src/main/java/org/elasticsearch/client/ElasticsearchClient.java index c6aa4991a8232..6fab5a8e2eb4e 100644 --- a/server/src/main/java/org/elasticsearch/client/ElasticsearchClient.java +++ b/server/src/main/java/org/elasticsearch/client/ElasticsearchClient.java @@ -37,11 +37,10 @@ public interface ElasticsearchClient { * @param request The action request. * @param The request type. * @param the response type. - * @param The request builder type. * @return A future allowing to get back the response. */ - > ActionFuture execute( - Action action, Request request); + ActionFuture execute( + Action action, Request request); /** * Executes a generic action, denoted by an {@link Action}. @@ -51,22 +50,9 @@ The request type. * @param The response type. - * @param The request builder type. */ - > void execute( - Action action, Request request, ActionListener listener); - - /** - * Prepares a request builder to execute, specified by {@link Action}. - * - * @param action The action type to execute. - * @param The request type. - * @param The response type. - * @param The request builder. - * @return The request builder, that can, at a later stage, execute the request. - */ - > RequestBuilder prepareExecute( - Action action); + void execute( + Action action, Request request, ActionListener listener); /** * Returns the threadpool used to execute requests on this client diff --git a/server/src/main/java/org/elasticsearch/client/FilterClient.java b/server/src/main/java/org/elasticsearch/client/FilterClient.java index 92f6817b74b67..ac94cdf017680 100644 --- a/server/src/main/java/org/elasticsearch/client/FilterClient.java +++ b/server/src/main/java/org/elasticsearch/client/FilterClient.java @@ -62,8 +62,8 @@ public void close() { } @Override - protected > void doExecute( - Action action, Request request, ActionListener listener) { + protected > void doExecute( + Action action, Request request, ActionListener listener) { in().execute(action, request, listener); } diff --git a/server/src/main/java/org/elasticsearch/client/ParentTaskAssigningClient.java b/server/src/main/java/org/elasticsearch/client/ParentTaskAssigningClient.java index 62843c41b7027..180c0f21b8d9a 100644 --- a/server/src/main/java/org/elasticsearch/client/ParentTaskAssigningClient.java +++ b/server/src/main/java/org/elasticsearch/client/ParentTaskAssigningClient.java @@ -60,8 +60,8 @@ public Client unwrap() { @Override protected < Request extends ActionRequest, Response extends ActionResponse, - RequestBuilder extends ActionRequestBuilder - > void doExecute(Action action, Request request, ActionListener listener) { + RequestBuilder extends ActionRequestBuilder + > void doExecute(Action action, Request request, ActionListener listener) { request.setParentTask(parentTask); super.doExecute(action, request, listener); } diff --git a/server/src/main/java/org/elasticsearch/client/node/NodeClient.java b/server/src/main/java/org/elasticsearch/client/node/NodeClient.java index 69bf5d21f7a4a..3f214c90b6701 100644 --- a/server/src/main/java/org/elasticsearch/client/node/NodeClient.java +++ b/server/src/main/java/org/elasticsearch/client/node/NodeClient.java @@ -70,8 +70,8 @@ public void close() { @Override public < Request extends ActionRequest, Response extends ActionResponse, - RequestBuilder extends ActionRequestBuilder - > void doExecute(Action action, Request request, ActionListener listener) { + RequestBuilder extends ActionRequestBuilder + > void doExecute(Action action, Request request, ActionListener listener) { // Discard the task because the Client interface doesn't use it. executeLocally(action, request, listener); } diff --git a/server/src/main/java/org/elasticsearch/client/support/AbstractClient.java b/server/src/main/java/org/elasticsearch/client/support/AbstractClient.java index c0da35a307981..41c1d245d39ca 100644 --- a/server/src/main/java/org/elasticsearch/client/support/AbstractClient.java +++ b/server/src/main/java/org/elasticsearch/client/support/AbstractClient.java @@ -382,14 +382,8 @@ public final AdminClient admin() { } @Override - public final > RequestBuilder prepareExecute( - final Action action) { - return action.newRequestBuilder(this); - } - - @Override - public final > ActionFuture execute( - Action action, Request request) { + public final ActionFuture execute( + Action action, Request request) { PlainActionFuture actionFuture = PlainActionFuture.newFuture(); execute(action, request, actionFuture); return actionFuture; @@ -399,13 +393,13 @@ public final > void execute( - Action action, Request request, ActionListener listener) { + public final void execute( + Action action, Request request, ActionListener listener) { listener = threadedWrapper.wrap(listener); doExecute(action, request, listener); } - protected abstract > void doExecute(Action action, Request request, ActionListener listener); + protected abstract > void doExecute(Action action, Request request, ActionListener listener); @Override public ActionFuture index(final IndexRequest request) { @@ -701,23 +695,17 @@ static class ClusterAdmin implements ClusterAdminClient { } @Override - public > ActionFuture execute( - Action action, Request request) { + public ActionFuture execute( + Action action, Request request) { return client.execute(action, request); } @Override - public > void execute( - Action action, Request request, ActionListener listener) { + public void execute( + Action action, Request request, ActionListener listener) { client.execute(action, request, listener); } - @Override - public > RequestBuilder prepareExecute( - Action action) { - return client.prepareExecute(action); - } - @Override public ThreadPool threadPool() { return client.threadPool(); @@ -1224,7 +1212,7 @@ public ActionFuture deleteStoredScript(DeleteStoredS @Override public DeleteStoredScriptRequestBuilder prepareDeleteStoredScript(){ - return DeleteStoredScriptAction.INSTANCE.newRequestBuilder(this); + return new DeleteStoredScriptRequestBuilder(client, DeleteStoredScriptAction.INSTANCE); } @Override @@ -1242,23 +1230,17 @@ static class IndicesAdmin implements IndicesAdminClient { } @Override - public > ActionFuture execute( - Action action, Request request) { + public ActionFuture execute( + Action action, Request request) { return client.execute(action, request); } @Override - public > void execute( - Action action, Request request, ActionListener listener) { + public void execute( + Action action, Request request, ActionListener listener) { client.execute(action, request, listener); } - @Override - public > RequestBuilder prepareExecute( - Action action) { - return client.prepareExecute(action); - } - @Override public ThreadPool threadPool() { return client.threadPool(); @@ -1775,7 +1757,7 @@ public void getSettings(GetSettingsRequest request, ActionListener headers) { return new FilterClient(this) { @Override - protected > void doExecute(Action action, Request request, ActionListener listener) { + protected > void doExecute(Action action, Request request, ActionListener listener) { ThreadContext threadContext = threadPool().getThreadContext(); try (ThreadContext.StoredContext ctx = threadContext.stashAndMergeHeaders(headers)) { super.doExecute(action, request, listener); diff --git a/server/src/main/java/org/elasticsearch/client/transport/TransportClient.java b/server/src/main/java/org/elasticsearch/client/transport/TransportClient.java index 2aeea08d1a575..f6d3a87f10da9 100644 --- a/server/src/main/java/org/elasticsearch/client/transport/TransportClient.java +++ b/server/src/main/java/org/elasticsearch/client/transport/TransportClient.java @@ -370,7 +370,7 @@ public void close() { } @Override - protected > void doExecute(Action action, Request request, ActionListener listener) { + protected > void doExecute(Action action, Request request, ActionListener listener) { proxy.execute(action, request, listener); } diff --git a/server/src/main/java/org/elasticsearch/client/transport/TransportProxyClient.java b/server/src/main/java/org/elasticsearch/client/transport/TransportProxyClient.java index e07fab0092d0e..249fd54ef69d9 100644 --- a/server/src/main/java/org/elasticsearch/client/transport/TransportProxyClient.java +++ b/server/src/main/java/org/elasticsearch/client/transport/TransportProxyClient.java @@ -53,7 +53,7 @@ final class TransportProxyClient { } public > void execute(final Action action, + ActionRequestBuilder> void execute(final Action action, final Request request, ActionListener listener) { final TransportActionNodeProxy proxy = proxies.get(action); assert proxy != null : "no proxy found for action: " + action; diff --git a/server/src/main/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequestBuilder.java b/server/src/main/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequestBuilder.java index e3c5bd2197a94..5ffccef23f51c 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequestBuilder.java @@ -31,11 +31,11 @@ public abstract class AbstractBulkByScrollRequestBuilder< Request extends AbstractBulkByScrollRequest, Self extends AbstractBulkByScrollRequestBuilder> - extends ActionRequestBuilder { + extends ActionRequestBuilder { private final SearchRequestBuilder source; protected AbstractBulkByScrollRequestBuilder(ElasticsearchClient client, - Action action, SearchRequestBuilder source, Request request) { + Action action, SearchRequestBuilder source, Request request) { super(client, action, request); this.source = source; } diff --git a/server/src/main/java/org/elasticsearch/index/reindex/AbstractBulkIndexByScrollRequestBuilder.java b/server/src/main/java/org/elasticsearch/index/reindex/AbstractBulkIndexByScrollRequestBuilder.java index ca1c980995bba..d8cf2f49149f7 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/AbstractBulkIndexByScrollRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/AbstractBulkIndexByScrollRequestBuilder.java @@ -30,7 +30,7 @@ public abstract class AbstractBulkIndexByScrollRequestBuilder< extends AbstractBulkByScrollRequestBuilder { protected AbstractBulkIndexByScrollRequestBuilder(ElasticsearchClient client, - Action action, SearchRequestBuilder search, Request request) { + Action action, SearchRequestBuilder search, Request request) { super(client, action, search, request); } diff --git a/server/src/main/java/org/elasticsearch/index/reindex/DeleteByQueryAction.java b/server/src/main/java/org/elasticsearch/index/reindex/DeleteByQueryAction.java index c1abb16ca3977..639c615727fe0 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/DeleteByQueryAction.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/DeleteByQueryAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.index.reindex; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class DeleteByQueryAction extends Action { +public class DeleteByQueryAction extends Action { public static final DeleteByQueryAction INSTANCE = new DeleteByQueryAction(); public static final String NAME = "indices:data/write/delete/byquery"; @@ -31,11 +30,6 @@ private DeleteByQueryAction() { super(NAME); } - @Override - public DeleteByQueryRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new DeleteByQueryRequestBuilder(client, this); - } - @Override public BulkByScrollResponse newResponse() { return new BulkByScrollResponse(); diff --git a/server/src/main/java/org/elasticsearch/index/reindex/DeleteByQueryRequestBuilder.java b/server/src/main/java/org/elasticsearch/index/reindex/DeleteByQueryRequestBuilder.java index e94d1308a74be..ef2057806e1ce 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/DeleteByQueryRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/DeleteByQueryRequestBuilder.java @@ -27,13 +27,12 @@ public class DeleteByQueryRequestBuilder extends AbstractBulkByScrollRequestBuilder { - public DeleteByQueryRequestBuilder(ElasticsearchClient client, - Action action) { + public DeleteByQueryRequestBuilder(ElasticsearchClient client, Action action) { this(client, action, new SearchRequestBuilder(client, SearchAction.INSTANCE)); } private DeleteByQueryRequestBuilder(ElasticsearchClient client, - Action action, + Action action, SearchRequestBuilder search) { super(client, action, search, new DeleteByQueryRequest(search.request())); } diff --git a/server/src/main/java/org/elasticsearch/index/reindex/ReindexAction.java b/server/src/main/java/org/elasticsearch/index/reindex/ReindexAction.java index 1c53a925f0d71..c4e4a68d114d0 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/ReindexAction.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/ReindexAction.java @@ -20,9 +20,8 @@ package org.elasticsearch.index.reindex; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ReindexAction extends Action { +public class ReindexAction extends Action { public static final ReindexAction INSTANCE = new ReindexAction(); public static final String NAME = "indices:data/write/reindex"; @@ -30,11 +29,6 @@ private ReindexAction() { super(NAME); } - @Override - public ReindexRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ReindexRequestBuilder(client, this); - } - @Override public BulkByScrollResponse newResponse() { return new BulkByScrollResponse(); diff --git a/server/src/main/java/org/elasticsearch/index/reindex/ReindexRequestBuilder.java b/server/src/main/java/org/elasticsearch/index/reindex/ReindexRequestBuilder.java index 68bd3f4661828..3d20bca989b83 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/ReindexRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/ReindexRequestBuilder.java @@ -31,13 +31,13 @@ public class ReindexRequestBuilder extends private final IndexRequestBuilder destination; public ReindexRequestBuilder(ElasticsearchClient client, - Action action) { + Action action) { this(client, action, new SearchRequestBuilder(client, SearchAction.INSTANCE), new IndexRequestBuilder(client, IndexAction.INSTANCE)); } private ReindexRequestBuilder(ElasticsearchClient client, - Action action, + Action action, SearchRequestBuilder search, IndexRequestBuilder destination) { super(client, action, search, new ReindexRequest(search.request(), destination.request())); this.destination = destination; diff --git a/server/src/main/java/org/elasticsearch/index/reindex/UpdateByQueryAction.java b/server/src/main/java/org/elasticsearch/index/reindex/UpdateByQueryAction.java index 1058f7f13078a..b2fb0a205eb08 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/UpdateByQueryAction.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/UpdateByQueryAction.java @@ -20,10 +20,8 @@ package org.elasticsearch.index.reindex; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class UpdateByQueryAction extends - Action { +public class UpdateByQueryAction extends Action { public static final UpdateByQueryAction INSTANCE = new UpdateByQueryAction(); public static final String NAME = "indices:data/write/update/byquery"; @@ -31,11 +29,6 @@ private UpdateByQueryAction() { super(NAME); } - @Override - public UpdateByQueryRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new UpdateByQueryRequestBuilder(client, this); - } - @Override public BulkByScrollResponse newResponse() { return new BulkByScrollResponse(); diff --git a/server/src/main/java/org/elasticsearch/index/reindex/UpdateByQueryRequestBuilder.java b/server/src/main/java/org/elasticsearch/index/reindex/UpdateByQueryRequestBuilder.java index 06e0426864193..dc56bb9cf9de3 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/UpdateByQueryRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/UpdateByQueryRequestBuilder.java @@ -27,13 +27,12 @@ public class UpdateByQueryRequestBuilder extends AbstractBulkIndexByScrollRequestBuilder { - public UpdateByQueryRequestBuilder(ElasticsearchClient client, - Action action) { + public UpdateByQueryRequestBuilder(ElasticsearchClient client, Action action) { this(client, action, new SearchRequestBuilder(client, SearchAction.INSTANCE)); } private UpdateByQueryRequestBuilder(ElasticsearchClient client, - Action action, + Action action, SearchRequestBuilder search) { super(client, action, search, new UpdateByQueryRequest(search.request())); } diff --git a/server/src/main/java/org/elasticsearch/persistent/CompletionPersistentTaskAction.java b/server/src/main/java/org/elasticsearch/persistent/CompletionPersistentTaskAction.java index c4bffeeb44d22..b7281e1026a63 100644 --- a/server/src/main/java/org/elasticsearch/persistent/CompletionPersistentTaskAction.java +++ b/server/src/main/java/org/elasticsearch/persistent/CompletionPersistentTaskAction.java @@ -18,6 +18,9 @@ */ package org.elasticsearch.persistent; +import java.io.IOException; +import java.util.Objects; + import org.elasticsearch.action.Action; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRequestValidationException; @@ -35,12 +38,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.persistent.PersistentTasksCustomMetaData.PersistentTask; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.persistent.PersistentTasksCustomMetaData.PersistentTask; - -import java.io.IOException; -import java.util.Objects; import static org.elasticsearch.action.ValidateActions.addValidationError; @@ -48,9 +48,7 @@ * Action that is used by executor node to indicate that the persistent action finished or failed on the node and needs to be * removed from the cluster state in case of successful completion or restarted on some other node in case of failure. */ -public class CompletionPersistentTaskAction extends Action { +public class CompletionPersistentTaskAction extends Action { public static final CompletionPersistentTaskAction INSTANCE = new CompletionPersistentTaskAction(); public static final String NAME = "cluster:admin/persistent/completion"; @@ -59,11 +57,6 @@ private CompletionPersistentTaskAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public PersistentTaskResponse newResponse() { return new PersistentTaskResponse(); diff --git a/server/src/main/java/org/elasticsearch/persistent/PersistentTasksService.java b/server/src/main/java/org/elasticsearch/persistent/PersistentTasksService.java index 482491fc3f7e9..7a4a956fcfd5b 100644 --- a/server/src/main/java/org/elasticsearch/persistent/PersistentTasksService.java +++ b/server/src/main/java/org/elasticsearch/persistent/PersistentTasksService.java @@ -137,8 +137,8 @@ public void sendRemoveRequest(final String taskId, final ActionListener * The origin is set in the context and the listener is wrapped to ensure the proper context is restored */ - private > - void execute(final Req request, final Action action, final ActionListener> listener) { + private + void execute(final Req request, final Action action, final ActionListener> listener) { try { final ThreadContext threadContext = client.threadPool().getThreadContext(); final Supplier supplier = threadContext.newRestorableContext(false); diff --git a/server/src/main/java/org/elasticsearch/persistent/RemovePersistentTaskAction.java b/server/src/main/java/org/elasticsearch/persistent/RemovePersistentTaskAction.java index d0a4575a10303..f278b5bcc5e22 100644 --- a/server/src/main/java/org/elasticsearch/persistent/RemovePersistentTaskAction.java +++ b/server/src/main/java/org/elasticsearch/persistent/RemovePersistentTaskAction.java @@ -42,9 +42,7 @@ import java.io.IOException; import java.util.Objects; -public class RemovePersistentTaskAction extends Action { +public class RemovePersistentTaskAction extends Action { public static final RemovePersistentTaskAction INSTANCE = new RemovePersistentTaskAction(); public static final String NAME = "cluster:admin/persistent/remove"; @@ -53,11 +51,6 @@ private RemovePersistentTaskAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public PersistentTaskResponse newResponse() { return new PersistentTaskResponse(); diff --git a/server/src/main/java/org/elasticsearch/persistent/StartPersistentTaskAction.java b/server/src/main/java/org/elasticsearch/persistent/StartPersistentTaskAction.java index 3b988939879c5..4e6b11205fdfc 100644 --- a/server/src/main/java/org/elasticsearch/persistent/StartPersistentTaskAction.java +++ b/server/src/main/java/org/elasticsearch/persistent/StartPersistentTaskAction.java @@ -48,9 +48,7 @@ /** * This action can be used to add the record for the persistent action to the cluster state. */ -public class StartPersistentTaskAction extends Action { +public class StartPersistentTaskAction extends Action { public static final StartPersistentTaskAction INSTANCE = new StartPersistentTaskAction(); public static final String NAME = "cluster:admin/persistent/start"; @@ -59,11 +57,6 @@ private StartPersistentTaskAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public PersistentTaskResponse newResponse() { return new PersistentTaskResponse(); diff --git a/server/src/main/java/org/elasticsearch/persistent/UpdatePersistentTaskStatusAction.java b/server/src/main/java/org/elasticsearch/persistent/UpdatePersistentTaskStatusAction.java index 53bc9afd0fdf5..a898558fc2668 100644 --- a/server/src/main/java/org/elasticsearch/persistent/UpdatePersistentTaskStatusAction.java +++ b/server/src/main/java/org/elasticsearch/persistent/UpdatePersistentTaskStatusAction.java @@ -18,6 +18,9 @@ */ package org.elasticsearch.persistent; +import java.io.IOException; +import java.util.Objects; + import org.elasticsearch.action.Action; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRequestValidationException; @@ -35,19 +38,14 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.persistent.PersistentTasksCustomMetaData.PersistentTask; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.persistent.PersistentTasksCustomMetaData.PersistentTask; - -import java.io.IOException; -import java.util.Objects; import static org.elasticsearch.action.ValidateActions.addValidationError; -public class UpdatePersistentTaskStatusAction extends Action { +public class UpdatePersistentTaskStatusAction extends Action { public static final UpdatePersistentTaskStatusAction INSTANCE = new UpdatePersistentTaskStatusAction(); public static final String NAME = "cluster:admin/persistent/update_status"; @@ -56,11 +54,6 @@ private UpdatePersistentTaskStatusAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public PersistentTaskResponse newResponse() { return new PersistentTaskResponse(); diff --git a/server/src/main/java/org/elasticsearch/transport/RemoteClusterAwareClient.java b/server/src/main/java/org/elasticsearch/transport/RemoteClusterAwareClient.java index aa476bf4dd267..70a07db12475f 100644 --- a/server/src/main/java/org/elasticsearch/transport/RemoteClusterAwareClient.java +++ b/server/src/main/java/org/elasticsearch/transport/RemoteClusterAwareClient.java @@ -44,8 +44,8 @@ final class RemoteClusterAwareClient extends AbstractClient { @Override protected > - void doExecute(Action action, Request request, ActionListener listener) { + ActionRequestBuilder> + void doExecute(Action action, Request request, ActionListener listener) { remoteClusterService.ensureConnected(clusterAlias, ActionListener.wrap(res -> { Transport.Connection connection = remoteClusterService.getConnection(clusterAlias); service.sendRequest(connection, action.name(), request, TransportRequestOptions.EMPTY, diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TasksIT.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TasksIT.java index 4ab54cdd206be..bdddaf69cfe92 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TasksIT.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TasksIT.java @@ -497,7 +497,8 @@ public void waitForTaskCompletion(Task task) { public void testTasksCancellation() throws Exception { // Start blocking test task // Get real client (the plugin is not registered on transport nodes) - ActionFuture future = TestTaskPlugin.TestTaskAction.INSTANCE.newRequestBuilder(client()).execute(); + ActionFuture future = new TestTaskPlugin.NodesRequestBuilder(client(), + TestTaskPlugin.TestTaskAction.INSTANCE).execute(); logger.info("--> started test tasks"); // Wait for the task to start on all nodes @@ -518,12 +519,13 @@ public void testTasksCancellation() throws Exception { public void testTasksUnblocking() throws Exception { // Start blocking test task - ActionFuture future = TestTaskPlugin.TestTaskAction.INSTANCE.newRequestBuilder(client()).execute(); + ActionFuture future = + new TestTaskPlugin.NodesRequestBuilder(client(), TestTaskPlugin.TestTaskAction.INSTANCE).execute(); // Wait for the task to start on all nodes assertBusy(() -> assertEquals(internalCluster().size(), client().admin().cluster().prepareListTasks().setActions(TestTaskPlugin.TestTaskAction.NAME + "[n]").get().getTasks().size())); - TestTaskPlugin.UnblockTestTasksAction.INSTANCE.newRequestBuilder(client()).get(); + new TestTaskPlugin.UnblockTestTasksRequestBuilder(client(), TestTaskPlugin.UnblockTestTasksAction.INSTANCE).get(); future.get(); assertEquals(0, client().admin().cluster().prepareListTasks().setActions(TestTaskPlugin.TestTaskAction.NAME + "[n]").get() @@ -581,8 +583,8 @@ public void testGetTaskWaitForCompletionWithStoringResult() throws Exception { private void waitForCompletionTestCase(boolean storeResult, Function> wait, Consumer validator) throws Exception { // Start blocking test task - ActionFuture future = TestTaskPlugin.TestTaskAction.INSTANCE.newRequestBuilder(client()) - .setShouldStoreResult(storeResult).execute(); + ActionFuture future = new TestTaskPlugin.NodesRequestBuilder(client(), + TestTaskPlugin.TestTaskAction.INSTANCE).setShouldStoreResult(storeResult).execute(); ActionFuture waitResponseFuture; TaskId taskId; @@ -620,7 +622,7 @@ public void onTaskUnregistered(Task task) { waitForWaitingToStart.await(); } finally { // Unblock the request so the wait for completion request can finish - TestTaskPlugin.UnblockTestTasksAction.INSTANCE.newRequestBuilder(client()).get(); + new TestTaskPlugin.UnblockTestTasksRequestBuilder(client(), TestTaskPlugin.UnblockTestTasksAction.INSTANCE).get(); } // Now that the task is unblocked the list response will come back @@ -655,7 +657,8 @@ public void testGetTaskWaitForTimeout() throws Exception { */ private void waitForTimeoutTestCase(Function> wait) throws Exception { // Start blocking test task - ActionFuture future = TestTaskPlugin.TestTaskAction.INSTANCE.newRequestBuilder(client()).execute(); + ActionFuture future = new TestTaskPlugin.NodesRequestBuilder(client(), + TestTaskPlugin.TestTaskAction.INSTANCE).execute(); try { TaskId taskId = waitForTestTaskStartOnAllNodes(); @@ -672,7 +675,7 @@ private void waitForTimeoutTestCase(Function events = findEvents(TestTaskPlugin.TestTaskAction.NAME, Tuple::v1); @@ -782,7 +786,7 @@ public void testTaskStoringFailureResult() throws Exception { // Start non-blocking test task that should fail assertThrows( - TestTaskPlugin.TestTaskAction.INSTANCE.newRequestBuilder(client()) + new TestTaskPlugin.NodesRequestBuilder(client(), TestTaskPlugin.TestTaskAction.INSTANCE) .setShouldFail(true) .setShouldStoreResult(true) .setShouldBlock(false), diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java index 5bf000a17bac7..a98c9088b8dc0 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java @@ -323,7 +323,7 @@ protected NodeResponse nodeOperation(NodeRequest request) { } - public static class TestTaskAction extends Action { + public static class TestTaskAction extends Action { public static final TestTaskAction INSTANCE = new TestTaskAction(); public static final String NAME = "cluster:admin/tasks/test"; @@ -336,16 +336,11 @@ private TestTaskAction() { public NodesResponse newResponse() { return new NodesResponse(); } - - @Override - public NodesRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new NodesRequestBuilder(client, this); - } } public static class NodesRequestBuilder extends NodesOperationRequestBuilder { - protected NodesRequestBuilder(ElasticsearchClient client, Action action) { + protected NodesRequestBuilder(ElasticsearchClient client, Action action) { super(client, action, new NodesRequest("test")); } @@ -459,8 +454,7 @@ protected void taskOperation(UnblockTestTasksRequest request, Task task, ActionL } - public static class UnblockTestTasksAction extends Action { + public static class UnblockTestTasksAction extends Action { public static final UnblockTestTasksAction INSTANCE = new UnblockTestTasksAction(); public static final String NAME = "cluster:admin/tasks/testunblock"; @@ -473,18 +467,12 @@ private UnblockTestTasksAction() { public UnblockTestTasksResponse newResponse() { return new UnblockTestTasksResponse(); } - - @Override - public UnblockTestTasksRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new UnblockTestTasksRequestBuilder(client, this); - } } - public static class UnblockTestTasksRequestBuilder extends ActionRequestBuilder { + public static class UnblockTestTasksRequestBuilder extends ActionRequestBuilder { - protected UnblockTestTasksRequestBuilder(ElasticsearchClient client, Action action) { + protected UnblockTestTasksRequestBuilder(ElasticsearchClient client, + Action action) { super(client, action, new UnblockTestTasksRequest()); } } diff --git a/server/src/test/java/org/elasticsearch/client/ParentTaskAssigningClientTests.java b/server/src/test/java/org/elasticsearch/client/ParentTaskAssigningClientTests.java index ee577d4df2f46..00b293bcffb34 100644 --- a/server/src/test/java/org/elasticsearch/client/ParentTaskAssigningClientTests.java +++ b/server/src/test/java/org/elasticsearch/client/ParentTaskAssigningClientTests.java @@ -40,8 +40,8 @@ public void testSetsParentId() { @Override protected < Request extends ActionRequest, Response extends ActionResponse, - RequestBuilder extends ActionRequestBuilder - > void doExecute( Action action, Request request, + RequestBuilder extends ActionRequestBuilder + > void doExecute( Action action, Request request, ActionListener listener) { assertEquals(parentTaskId[0], request.getParentTask()); super.doExecute(action, request, listener); diff --git a/server/src/test/java/org/elasticsearch/cluster/NoMasterNodeIT.java b/server/src/test/java/org/elasticsearch/cluster/NoMasterNodeIT.java index a271f7415d41c..b8a5e26d5c9ab 100644 --- a/server/src/test/java/org/elasticsearch/cluster/NoMasterNodeIT.java +++ b/server/src/test/java/org/elasticsearch/cluster/NoMasterNodeIT.java @@ -139,7 +139,7 @@ public void testNoMasterActions() throws Exception { client().admin().cluster().prepareHealth().setWaitForGreenStatus().setWaitForNodes("2").execute().actionGet(); } - void checkUpdateAction(boolean autoCreateIndex, TimeValue timeout, ActionRequestBuilder builder) { + void checkUpdateAction(boolean autoCreateIndex, TimeValue timeout, ActionRequestBuilder builder) { // we clean the metadata when loosing a master, therefore all operations on indices will auto create it, if allowed try { builder.get(); @@ -154,7 +154,7 @@ void checkUpdateAction(boolean autoCreateIndex, TimeValue timeout, ActionRequest } } - void checkWriteAction(ActionRequestBuilder builder) { + void checkWriteAction(ActionRequestBuilder builder) { try { builder.get(); fail("Expected ClusterBlockException"); diff --git a/server/src/test/java/org/elasticsearch/persistent/TestPersistentTasksPlugin.java b/server/src/test/java/org/elasticsearch/persistent/TestPersistentTasksPlugin.java index 556d6d1983e63..63ef871c0e3f4 100644 --- a/server/src/test/java/org/elasticsearch/persistent/TestPersistentTasksPlugin.java +++ b/server/src/test/java/org/elasticsearch/persistent/TestPersistentTasksPlugin.java @@ -360,7 +360,7 @@ protected AllocatedPersistentTask createTask(long id, String type, String action } } - public static class TestTaskAction extends Action { + public static class TestTaskAction extends Action { public static final TestTaskAction INSTANCE = new TestTaskAction(); public static final String NAME = "cluster:admin/persistent/task_test"; @@ -373,11 +373,6 @@ private TestTaskAction() { public TestTasksResponse newResponse() { return new TestTasksResponse(); } - - @Override - public TestTasksRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new TestTasksRequestBuilder(client); - } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/client/NoOpClient.java b/test/framework/src/main/java/org/elasticsearch/test/client/NoOpClient.java index c393e19653fca..93cb3475a1249 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/client/NoOpClient.java +++ b/test/framework/src/main/java/org/elasticsearch/test/client/NoOpClient.java @@ -53,8 +53,8 @@ public NoOpClient(String testName) { @Override protected > - void doExecute(Action action, Request request, ActionListener listener) { + RequestBuilder extends ActionRequestBuilder> + void doExecute(Action action, Request request, ActionListener listener) { listener.onResponse(null); } diff --git a/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java b/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java index 723184410f247..30b24c0daa5a9 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java +++ b/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java @@ -490,14 +490,14 @@ public static T assertDisjunctionSubQuery(Query query, Class void assertThrows(ActionRequestBuilder builder, Class exceptionClass) { + public static void assertThrows(ActionRequestBuilder builder, Class exceptionClass) { assertThrows(builder.execute(), exceptionClass); } /** * Run the request from a given builder and check that it throws an exception of the right type, with a given {@link org.elasticsearch.rest.RestStatus} */ - public static void assertThrows(ActionRequestBuilder builder, Class exceptionClass, RestStatus status) { + public static void assertThrows(ActionRequestBuilder builder, Class exceptionClass, RestStatus status) { assertThrows(builder.execute(), exceptionClass, status); } @@ -506,7 +506,7 @@ public static void assertThrows(ActionRequestBuilder void assertThrows(ActionRequestBuilder builder, Class exceptionClass, String extraInfo) { + public static void assertThrows(ActionRequestBuilder builder, Class exceptionClass, String extraInfo) { assertThrows(builder.execute(), exceptionClass, extraInfo); } @@ -570,11 +570,11 @@ public static void assertThrows(ActionFuture future, Class } } - public static void assertThrows(ActionRequestBuilder builder, RestStatus status) { + public static void assertThrows(ActionRequestBuilder builder, RestStatus status) { assertThrows(builder.execute(), status); } - public static void assertThrows(ActionRequestBuilder builder, RestStatus status, String extraInfo) { + public static void assertThrows(ActionRequestBuilder builder, RestStatus status, String extraInfo) { assertThrows(builder.execute(), status, extraInfo); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/DeleteLicenseAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/DeleteLicenseAction.java index de356870fbbe8..309246ca9d760 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/DeleteLicenseAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/DeleteLicenseAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.license; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class DeleteLicenseAction extends Action { +public class DeleteLicenseAction extends Action { public static final DeleteLicenseAction INSTANCE = new DeleteLicenseAction(); public static final String NAME = "cluster:admin/xpack/license/delete"; @@ -21,9 +20,4 @@ private DeleteLicenseAction() { public DeleteLicenseResponse newResponse() { return new DeleteLicenseResponse(); } - - @Override - public DeleteLicenseRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new DeleteLicenseRequestBuilder(client, this); - } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetBasicStatusAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetBasicStatusAction.java index 5011ddf5782d0..75d5c2da10680 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetBasicStatusAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetBasicStatusAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.license; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class GetBasicStatusAction extends Action { +public class GetBasicStatusAction extends Action { public static final GetBasicStatusAction INSTANCE = new GetBasicStatusAction(); public static final String NAME = "cluster:admin/xpack/license/basic_status"; @@ -17,11 +16,6 @@ private GetBasicStatusAction() { super(NAME); } - @Override - public GetBasicStatusRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetBasicStatusRequestBuilder(client, this); - } - @Override public GetBasicStatusResponse newResponse() { return new GetBasicStatusResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetBasicStatusRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetBasicStatusRequestBuilder.java index ba973a95f3d6f..e56451c4a92ff 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetBasicStatusRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetBasicStatusRequestBuilder.java @@ -8,8 +8,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -class GetBasicStatusRequestBuilder extends ActionRequestBuilder { +class GetBasicStatusRequestBuilder extends ActionRequestBuilder { GetBasicStatusRequestBuilder(ElasticsearchClient client, GetBasicStatusAction action) { super(client, action, new GetBasicStatusRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetLicenseAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetLicenseAction.java index 472634107969a..be8d46e31d0b3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetLicenseAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetLicenseAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.license; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class GetLicenseAction extends Action { +public class GetLicenseAction extends Action { public static final GetLicenseAction INSTANCE = new GetLicenseAction(); public static final String NAME = "cluster:monitor/xpack/license/get"; @@ -21,9 +20,4 @@ private GetLicenseAction() { public GetLicenseResponse newResponse() { return new GetLicenseResponse(); } - - @Override - public GetLicenseRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetLicenseRequestBuilder(client, this); - } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetTrialStatusAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetTrialStatusAction.java index 2f690a35fc58e..619300b1d7791 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetTrialStatusAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetTrialStatusAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.license; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class GetTrialStatusAction extends Action { +public class GetTrialStatusAction extends Action { public static final GetTrialStatusAction INSTANCE = new GetTrialStatusAction(); public static final String NAME = "cluster:admin/xpack/license/trial_status"; @@ -17,11 +16,6 @@ private GetTrialStatusAction() { super(NAME); } - @Override - public GetTrialStatusRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetTrialStatusRequestBuilder(client, this); - } - @Override public GetTrialStatusResponse newResponse() { return new GetTrialStatusResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetTrialStatusRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetTrialStatusRequestBuilder.java index c9786418b639d..d220b476bc578 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetTrialStatusRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetTrialStatusRequestBuilder.java @@ -8,8 +8,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -class GetTrialStatusRequestBuilder extends ActionRequestBuilder { +class GetTrialStatusRequestBuilder extends ActionRequestBuilder { GetTrialStatusRequestBuilder(ElasticsearchClient client, GetTrialStatusAction action) { super(client, action, new GetTrialStatusRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicAction.java index eb55b1be00655..747632d9d1d8a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.license; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class PostStartBasicAction extends Action { +public class PostStartBasicAction extends Action { public static final PostStartBasicAction INSTANCE = new PostStartBasicAction(); public static final String NAME = "cluster:admin/xpack/license/start_basic"; @@ -17,11 +16,6 @@ private PostStartBasicAction() { super(NAME); } - @Override - public PostStartBasicRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new PostStartBasicRequestBuilder(client, this); - } - @Override public PostStartBasicResponse newResponse() { return new PostStartBasicResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicRequestBuilder.java index eb1ebb7b56c85..09591bff2e8ba 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicRequestBuilder.java @@ -8,8 +8,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -class PostStartBasicRequestBuilder extends ActionRequestBuilder { +class PostStartBasicRequestBuilder extends ActionRequestBuilder { PostStartBasicRequestBuilder(ElasticsearchClient client, PostStartBasicAction action) { super(client, action, new PostStartBasicRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartTrialAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartTrialAction.java index b0634ef22a9e1..c7817f73b91cb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartTrialAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartTrialAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.license; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class PostStartTrialAction extends Action { +public class PostStartTrialAction extends Action { public static final PostStartTrialAction INSTANCE = new PostStartTrialAction(); public static final String NAME = "cluster:admin/xpack/license/start_trial"; @@ -17,11 +16,6 @@ private PostStartTrialAction() { super(NAME); } - @Override - public PostStartTrialRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new PostStartTrialRequestBuilder(client, this); - } - @Override public PostStartTrialResponse newResponse() { return new PostStartTrialResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartTrialRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartTrialRequestBuilder.java index 6b0beba171bdd..8e12c879f997d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartTrialRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartTrialRequestBuilder.java @@ -8,8 +8,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -class PostStartTrialRequestBuilder extends ActionRequestBuilder { +class PostStartTrialRequestBuilder extends ActionRequestBuilder { PostStartTrialRequestBuilder(ElasticsearchClient client, PostStartTrialAction action) { super(client, action, new PostStartTrialRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseAction.java index 4aee591b9c547..b96f13190eddb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.license; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class PutLicenseAction extends Action { +public class PutLicenseAction extends Action { public static final PutLicenseAction INSTANCE = new PutLicenseAction(); public static final String NAME = "cluster:admin/xpack/license/put"; @@ -21,9 +20,4 @@ private PutLicenseAction() { public PutLicenseResponse newResponse() { return new PutLicenseResponse(); } - - @Override - public PutLicenseRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new PutLicenseRequestBuilder(client, this); - } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ClientHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ClientHelper.java index c73bb8576a7ad..8b6d72aac3ce8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ClientHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ClientHelper.java @@ -80,8 +80,8 @@ public static v * is wrapped to ensure the proper context is restored */ public static > void executeAsyncWithOrigin( - Client client, String origin, Action action, Request request, + RequestBuilder extends ActionRequestBuilder> void executeAsyncWithOrigin( + Client client, String origin, Action action, Request request, ActionListener listener) { final ThreadContext threadContext = client.threadPool().getThreadContext(); final Supplier supplier = threadContext.newRestorableContext(false); @@ -139,8 +139,8 @@ public static T executeWithHeaders(Map> void executeWithHeadersAsync( - Map headers, String origin, Client client, Action action, Request request, + RequestBuilder extends ActionRequestBuilder> void executeWithHeadersAsync( + Map headers, String origin, Client client, Action action, Request request, ActionListener listener) { Map filteredHeaders = headers.entrySet().stream().filter(e -> SECURITY_HEADER_FILTERS.contains(e.getKey())) @@ -177,8 +177,8 @@ private ClientWithOrigin(Client in, String origin) { @Override protected > void doExecute( - Action action, Request request, ActionListener listener) { + RequestBuilder extends ActionRequestBuilder> void doExecute( + Action action, Request request, ActionListener listener) { final Supplier supplier = in().threadPool().getThreadContext().newRestorableContext(false); try (ThreadContext.StoredContext ignore = in().threadPool().getThreadContext().stashContext()) { in().threadPool().getThreadContext().putTransient(ACTION_ORIGIN_TRANSIENT_NAME, origin); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackInfoAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackInfoAction.java index bdca705baff8f..585153000a24b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackInfoAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackInfoAction.java @@ -6,10 +6,9 @@ package org.elasticsearch.xpack.core.action; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.license.XPackInfoResponse; -public class XPackInfoAction extends Action { +public class XPackInfoAction extends Action { public static final String NAME = "cluster:monitor/xpack/info"; public static final XPackInfoAction INSTANCE = new XPackInfoAction(); @@ -18,11 +17,6 @@ public XPackInfoAction() { super(NAME); } - @Override - public XPackInfoRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new XPackInfoRequestBuilder(client); - } - @Override public XPackInfoResponse newResponse() { return new XPackInfoResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackInfoRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackInfoRequestBuilder.java index 6ee4fb925bde2..1d888325c3f2d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackInfoRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackInfoRequestBuilder.java @@ -11,7 +11,7 @@ import java.util.EnumSet; -public class XPackInfoRequestBuilder extends ActionRequestBuilder { +public class XPackInfoRequestBuilder extends ActionRequestBuilder { public XPackInfoRequestBuilder(ElasticsearchClient client) { this(client, XPackInfoAction.INSTANCE); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackUsageAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackUsageAction.java index 252283a1dfc7d..906aaf3f4dada 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackUsageAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackUsageAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.xpack.core.action; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class XPackUsageAction extends Action { +public class XPackUsageAction extends Action { public static final String NAME = "cluster:monitor/xpack/usage"; public static final XPackUsageAction INSTANCE = new XPackUsageAction(); @@ -17,11 +16,6 @@ public XPackUsageAction() { super(NAME); } - @Override - public XPackUsageRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new XPackUsageRequestBuilder(client); - } - @Override public XPackUsageResponse newResponse() { return new XPackUsageResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationInfoAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationInfoAction.java index a5eddbd37f8e2..d3b7bd1452901 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationInfoAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationInfoAction.java @@ -37,8 +37,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; -public class DeprecationInfoAction extends Action { +public class DeprecationInfoAction extends Action { public static final DeprecationInfoAction INSTANCE = new DeprecationInfoAction(); public static final String NAME = "cluster:admin/xpack/deprecation/info"; @@ -59,11 +58,6 @@ public static List filterChecks(List checks, Function { +public class GraphExploreAction extends Action { public static final GraphExploreAction INSTANCE = new GraphExploreAction(); public static final String NAME = "indices:data/read/xpack/graph/explore"; @@ -22,9 +21,4 @@ private GraphExploreAction() { public GraphExploreResponse newResponse() { return new GraphExploreResponse(); } - - @Override - public GraphExploreRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GraphExploreRequestBuilder(client, this); - } -} +} \ No newline at end of file diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/graph/action/GraphExploreRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/graph/action/GraphExploreRequestBuilder.java index c6044d1aabf12..d5e756f78a20e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/graph/action/GraphExploreRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/graph/action/GraphExploreRequestBuilder.java @@ -20,8 +20,7 @@ * * @see GraphExploreRequest */ -public class GraphExploreRequestBuilder extends ActionRequestBuilder { +public class GraphExploreRequestBuilder extends ActionRequestBuilder { public GraphExploreRequestBuilder(ElasticsearchClient client, GraphExploreAction action) { super(client, action, new GraphExploreRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/CloseJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/CloseJobAction.java index c66686136e7e5..3710f5b96f60c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/CloseJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/CloseJobAction.java @@ -27,7 +27,7 @@ import java.io.IOException; import java.util.Objects; -public class CloseJobAction extends Action { +public class CloseJobAction extends Action { public static final CloseJobAction INSTANCE = new CloseJobAction(); public static final String NAME = "cluster:admin/xpack/ml/job/close"; @@ -36,11 +36,6 @@ private CloseJobAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -204,7 +199,7 @@ public boolean equals(Object obj) { } } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client, CloseJobAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarAction.java index 2a01282d41115..4a7872ef66e8a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarAction.java @@ -19,8 +19,7 @@ import java.io.IOException; import java.util.Objects; -public class DeleteCalendarAction extends Action { +public class DeleteCalendarAction extends Action { public static final DeleteCalendarAction INSTANCE = new DeleteCalendarAction(); public static final String NAME = "cluster:admin/xpack/ml/calendars/delete"; @@ -29,11 +28,6 @@ private DeleteCalendarAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -88,8 +82,7 @@ public boolean equals(Object obj) { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client, DeleteCalendarAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarEventAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarEventAction.java index 01d5e3e37215b..2fa475ff5e877 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarEventAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarEventAction.java @@ -20,8 +20,7 @@ import java.io.IOException; import java.util.Objects; -public class DeleteCalendarEventAction extends Action { +public class DeleteCalendarEventAction extends Action { public static final DeleteCalendarEventAction INSTANCE = new DeleteCalendarEventAction(); public static final String NAME = "cluster:admin/xpack/ml/calendars/events/delete"; @@ -30,11 +29,6 @@ private DeleteCalendarEventAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -95,7 +89,7 @@ public boolean equals(Object obj) { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client, DeleteCalendarEventAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDatafeedAction.java index 6876294bdf301..c069a49117d36 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDatafeedAction.java @@ -23,8 +23,7 @@ import java.io.IOException; import java.util.Objects; -public class DeleteDatafeedAction extends Action { +public class DeleteDatafeedAction extends Action { public static final DeleteDatafeedAction INSTANCE = new DeleteDatafeedAction(); public static final String NAME = "cluster:admin/xpack/ml/datafeeds/delete"; @@ -33,11 +32,6 @@ private DeleteDatafeedAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteExpiredDataAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteExpiredDataAction.java index aeacf68fe18c7..56361cd7ed2a5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteExpiredDataAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteExpiredDataAction.java @@ -20,8 +20,7 @@ import java.io.IOException; import java.util.Objects; -public class DeleteExpiredDataAction extends Action { +public class DeleteExpiredDataAction extends Action { public static final DeleteExpiredDataAction INSTANCE = new DeleteExpiredDataAction(); public static final String NAME = "cluster:admin/xpack/ml/delete_expired_data"; @@ -30,11 +29,6 @@ private DeleteExpiredDataAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -50,7 +44,7 @@ public ActionRequestValidationException validate() { } } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client, DeleteExpiredDataAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteFilterAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteFilterAction.java index 86e343fda22cc..b214fd24648b8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteFilterAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteFilterAction.java @@ -20,7 +20,7 @@ import java.util.Objects; -public class DeleteFilterAction extends Action { +public class DeleteFilterAction extends Action { public static final DeleteFilterAction INSTANCE = new DeleteFilterAction(); public static final String NAME = "cluster:admin/xpack/ml/filters/delete"; @@ -29,11 +29,6 @@ private DeleteFilterAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteJobAction.java index 4fa264862dbaf..ee6f92a3ce74c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteJobAction.java @@ -24,7 +24,7 @@ import java.util.Map; import java.util.Objects; -public class DeleteJobAction extends Action { +public class DeleteJobAction extends Action { public static final DeleteJobAction INSTANCE = new DeleteJobAction(); public static final String NAME = "cluster:admin/xpack/ml/job/delete"; @@ -33,11 +33,6 @@ private DeleteJobAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteModelSnapshotAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteModelSnapshotAction.java index 39c497ab51ea6..ca21c5e9056f1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteModelSnapshotAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteModelSnapshotAction.java @@ -19,8 +19,7 @@ import java.io.IOException; -public class DeleteModelSnapshotAction extends Action { +public class DeleteModelSnapshotAction extends Action { public static final DeleteModelSnapshotAction INSTANCE = new DeleteModelSnapshotAction(); public static final String NAME = "cluster:admin/xpack/ml/job/model_snapshots/delete"; @@ -29,11 +28,6 @@ private DeleteModelSnapshotAction() { super(NAME); } - @Override - public DeleteModelSnapshotAction.RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public DeleteModelSnapshotAction.Response newResponse() { return new Response(); @@ -102,7 +96,7 @@ public void writeTo(StreamOutput out) throws IOException { } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client, DeleteModelSnapshotAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FinalizeJobExecutionAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FinalizeJobExecutionAction.java index 9259aa0c60473..019a52d16b3df 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FinalizeJobExecutionAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FinalizeJobExecutionAction.java @@ -16,8 +16,7 @@ import java.io.IOException; -public class FinalizeJobExecutionAction extends Action { +public class FinalizeJobExecutionAction extends Action { public static final FinalizeJobExecutionAction INSTANCE = new FinalizeJobExecutionAction(); public static final String NAME = "cluster:internal/xpack/ml/job/finalize_job_execution"; @@ -26,11 +25,6 @@ private FinalizeJobExecutionAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, INSTANCE); - } - @Override public Response newResponse() { return new Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FlushJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FlushJobAction.java index 2da2505a77170..206128a8784ca 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FlushJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FlushJobAction.java @@ -26,7 +26,7 @@ import java.util.Date; import java.util.Objects; -public class FlushJobAction extends Action { +public class FlushJobAction extends Action { public static final FlushJobAction INSTANCE = new FlushJobAction(); public static final String NAME = "cluster:admin/xpack/ml/job/flush"; @@ -35,11 +35,6 @@ private FlushJobAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -193,7 +188,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client, FlushJobAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ForecastJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ForecastJobAction.java index 4868a1e73da37..75ba8f195370c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ForecastJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ForecastJobAction.java @@ -24,8 +24,7 @@ import java.io.IOException; import java.util.Objects; -public class ForecastJobAction extends Action { +public class ForecastJobAction extends Action { public static final ForecastJobAction INSTANCE = new ForecastJobAction(); public static final String NAME = "cluster:admin/xpack/ml/job/forecast"; @@ -34,11 +33,6 @@ private ForecastJobAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -162,7 +156,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client, ForecastJobAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetBucketsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetBucketsAction.java index dec819613cb37..6abbd2dfbdfd9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetBucketsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetBucketsAction.java @@ -30,7 +30,7 @@ import java.io.IOException; import java.util.Objects; -public class GetBucketsAction extends Action { +public class GetBucketsAction extends Action { public static final GetBucketsAction INSTANCE = new GetBucketsAction(); public static final String NAME = "cluster:monitor/xpack/ml/job/results/buckets/get"; @@ -39,11 +39,6 @@ private GetBucketsAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(); @@ -294,7 +289,7 @@ public boolean equals(Object obj) { } } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsAction.java index 2fe993b513804..19cf114772d8a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsAction.java @@ -29,8 +29,7 @@ import java.io.IOException; import java.util.Objects; -public class GetCalendarEventsAction extends Action { +public class GetCalendarEventsAction extends Action { public static final GetCalendarEventsAction INSTANCE = new GetCalendarEventsAction(); public static final String NAME = "cluster:monitor/xpack/ml/calendars/events/get"; @@ -38,11 +37,6 @@ private GetCalendarEventsAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(); @@ -193,7 +187,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsAction.java index f11d9ccbf869a..60ab7adbbcedf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsAction.java @@ -29,7 +29,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; -public class GetCalendarsAction extends Action { +public class GetCalendarsAction extends Action { public static final GetCalendarsAction INSTANCE = new GetCalendarsAction(); public static final String NAME = "cluster:monitor/xpack/ml/calendars/get"; @@ -38,11 +38,6 @@ private GetCalendarsAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(); @@ -147,7 +142,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesAction.java index 84976c61e4517..3bb459013995d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesAction.java @@ -29,8 +29,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; -public class GetCategoriesAction extends -Action { +public class GetCategoriesAction extends Action { public static final GetCategoriesAction INSTANCE = new GetCategoriesAction(); public static final String NAME = "cluster:monitor/xpack/ml/job/results/categories/get"; @@ -39,11 +38,6 @@ private GetCategoriesAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -163,7 +157,7 @@ public int hashCode() { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client, GetCategoriesAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsAction.java index 3f71ac2dc027d..5bd6e96e79cf9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsAction.java @@ -25,8 +25,7 @@ import java.io.IOException; import java.util.Objects; -public class GetDatafeedsAction extends Action { +public class GetDatafeedsAction extends Action { public static final GetDatafeedsAction INSTANCE = new GetDatafeedsAction(); public static final String NAME = "cluster:monitor/xpack/ml/datafeeds/get"; @@ -37,11 +36,6 @@ private GetDatafeedsAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsStatsAction.java index 4219cb2a3ca8a..9dc2042d9cfd3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsStatsAction.java @@ -30,8 +30,7 @@ import java.util.Map; import java.util.Objects; -public class GetDatafeedsStatsAction extends Action { +public class GetDatafeedsStatsAction extends Action { public static final GetDatafeedsStatsAction INSTANCE = new GetDatafeedsStatsAction(); public static final String NAME = "cluster:monitor/xpack/ml/datafeeds/stats/get"; @@ -43,11 +42,6 @@ private GetDatafeedsStatsAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetFiltersAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetFiltersAction.java index 9d375ec0dfc7b..541366248ee7c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetFiltersAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetFiltersAction.java @@ -27,7 +27,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; -public class GetFiltersAction extends Action { +public class GetFiltersAction extends Action { public static final GetFiltersAction INSTANCE = new GetFiltersAction(); public static final String NAME = "cluster:admin/xpack/ml/filters/get"; @@ -36,11 +36,6 @@ private GetFiltersAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(); @@ -111,7 +106,7 @@ public boolean equals(Object obj) { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersAction.java index 39721b0c728f7..803bfda63ebc2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersAction.java @@ -29,7 +29,7 @@ import java.util.Objects; public class GetInfluencersAction -extends Action { +extends Action { public static final GetInfluencersAction INSTANCE = new GetInfluencersAction(); public static final String NAME = "cluster:monitor/xpack/ml/job/results/influencers/get"; @@ -38,11 +38,6 @@ private GetInfluencersAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(); @@ -224,7 +219,7 @@ public boolean equals(Object obj) { } } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsAction.java index f315783330e7d..8382345773450 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsAction.java @@ -25,7 +25,7 @@ import java.io.IOException; import java.util.Objects; -public class GetJobsAction extends Action { +public class GetJobsAction extends Action { public static final GetJobsAction INSTANCE = new GetJobsAction(); public static final String NAME = "cluster:monitor/xpack/ml/job/get"; @@ -34,11 +34,6 @@ private GetJobsAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsStatsAction.java index 37e41854f7b8b..c2c3c9b8d6c32 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsStatsAction.java @@ -39,7 +39,7 @@ import java.util.Map; import java.util.Objects; -public class GetJobsStatsAction extends Action { +public class GetJobsStatsAction extends Action { public static final GetJobsStatsAction INSTANCE = new GetJobsStatsAction(); public static final String NAME = "cluster:monitor/xpack/ml/job/stats/get"; @@ -53,11 +53,6 @@ private GetJobsStatsAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -144,7 +139,7 @@ public boolean equals(Object obj) { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client, GetJobsStatsAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsAction.java index 382b60a07d58d..3bd990577603b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsAction.java @@ -29,8 +29,7 @@ import java.io.IOException; import java.util.Objects; -public class GetModelSnapshotsAction -extends Action { +public class GetModelSnapshotsAction extends Action { public static final GetModelSnapshotsAction INSTANCE = new GetModelSnapshotsAction(); public static final String NAME = "cluster:monitor/xpack/ml/job/model_snapshots/get"; @@ -39,11 +38,6 @@ private GetModelSnapshotsAction() { super(NAME); } - @Override - public GetModelSnapshotsAction.RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public GetModelSnapshotsAction.Response newResponse() { return new Response(); @@ -280,7 +274,7 @@ public final String toString() { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client, GetModelSnapshotsAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsAction.java index ec1d5484255ed..81dad665577c8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsAction.java @@ -48,8 +48,7 @@ * the interval. *

*/ -public class GetOverallBucketsAction - extends Action { +public class GetOverallBucketsAction extends Action { public static final GetOverallBucketsAction INSTANCE = new GetOverallBucketsAction(); public static final String NAME = "cluster:monitor/xpack/ml/job/results/overall_buckets/get"; @@ -58,11 +57,6 @@ private GetOverallBucketsAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(); @@ -280,7 +274,7 @@ public boolean equals(Object other) { } } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetRecordsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetRecordsAction.java index 586a40af81a29..7d1fb839704af 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetRecordsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetRecordsAction.java @@ -29,7 +29,7 @@ import java.io.IOException; import java.util.Objects; -public class GetRecordsAction extends Action { +public class GetRecordsAction extends Action { public static final GetRecordsAction INSTANCE = new GetRecordsAction(); public static final String NAME = "cluster:monitor/xpack/ml/job/results/records/get"; @@ -38,11 +38,6 @@ private GetRecordsAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(); @@ -224,7 +219,7 @@ public boolean equals(Object obj) { } } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/IsolateDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/IsolateDatafeedAction.java index 98ca6c29f4b0b..7bafe5056af67 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/IsolateDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/IsolateDatafeedAction.java @@ -35,8 +35,7 @@ * task ensures the current datafeed task can complete inconsequentially while * the datafeed persistent task may be stopped or reassigned on another node. */ -public class IsolateDatafeedAction - extends Action { +public class IsolateDatafeedAction extends Action { public static final IsolateDatafeedAction INSTANCE = new IsolateDatafeedAction(); public static final String NAME = "cluster:internal/xpack/ml/datafeed/isolate"; @@ -45,11 +44,6 @@ private IsolateDatafeedAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -171,7 +165,7 @@ public void writeTo(StreamOutput out) throws IOException { } } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client, IsolateDatafeedAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/KillProcessAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/KillProcessAction.java index 48ee4432ff015..5edb988351b0e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/KillProcessAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/KillProcessAction.java @@ -16,8 +16,7 @@ import java.io.IOException; import java.util.Objects; -public class KillProcessAction extends Action { +public class KillProcessAction extends Action { public static final KillProcessAction INSTANCE = new KillProcessAction(); public static final String NAME = "cluster:internal/xpack/ml/job/kill/process"; @@ -26,17 +25,12 @@ private KillProcessAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client, KillProcessAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/MlInfoAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/MlInfoAction.java index 53a0758bcf807..38544e576171b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/MlInfoAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/MlInfoAction.java @@ -21,7 +21,7 @@ import java.util.Map; import java.util.Objects; -public class MlInfoAction extends Action { +public class MlInfoAction extends Action { public static final MlInfoAction INSTANCE = new MlInfoAction(); public static final String NAME = "cluster:monitor/xpack/ml/info/get"; @@ -30,11 +30,6 @@ private MlInfoAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -56,7 +51,7 @@ public ActionRequestValidationException validate() { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client, MlInfoAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/OpenJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/OpenJobAction.java index ffe82f2abe58d..d6e351f763787 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/OpenJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/OpenJobAction.java @@ -31,7 +31,7 @@ import java.io.IOException; import java.util.Objects; -public class OpenJobAction extends Action { +public class OpenJobAction extends Action { public static final OpenJobAction INSTANCE = new OpenJobAction(); public static final String NAME = "cluster:admin/xpack/ml/job/open"; @@ -41,11 +41,6 @@ private OpenJobAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -286,7 +281,7 @@ static boolean match(Task task, String expectedJobId) { } } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client, OpenJobAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PersistJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PersistJobAction.java index 71f65051464b2..f1d86dd784abe 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PersistJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PersistJobAction.java @@ -16,7 +16,7 @@ import java.io.IOException; import java.util.Objects; -public class PersistJobAction extends Action { +public class PersistJobAction extends Action { public static final PersistJobAction INSTANCE = new PersistJobAction(); public static final String NAME = "cluster:admin/xpack/ml/job/persist"; @@ -25,11 +25,6 @@ private PersistJobAction() { super(NAME); } - @Override - public PersistJobAction.RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -127,7 +122,7 @@ public int hashCode() { } } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client, PersistJobAction action) { super(client, action, new PersistJobAction.Request()); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventsAction.java index 82e9072751ee6..aa4fc9ee2ea44 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventsAction.java @@ -30,8 +30,7 @@ import java.util.Objects; import java.util.stream.Collectors; -public class PostCalendarEventsAction extends Action { +public class PostCalendarEventsAction extends Action { public static final PostCalendarEventsAction INSTANCE = new PostCalendarEventsAction(); public static final String NAME = "cluster:admin/xpack/ml/calendars/events/post"; @@ -41,11 +40,6 @@ private PostCalendarEventsAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(); @@ -134,7 +128,7 @@ public boolean equals(Object obj) { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostDataAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostDataAction.java index 9ba1bf574db8b..69dd7e69ca149 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostDataAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostDataAction.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.Objects; -public class PostDataAction extends Action { +public class PostDataAction extends Action { public static final PostDataAction INSTANCE = new PostDataAction(); public static final String NAME = "cluster:admin/xpack/ml/job/data/post"; @@ -33,17 +33,12 @@ private PostDataAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client, PostDataAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedAction.java index 15fbe43754831..46eb6578e86ec 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedAction.java @@ -25,8 +25,7 @@ import java.io.InputStream; import java.util.Objects; -public class PreviewDatafeedAction extends Action { +public class PreviewDatafeedAction extends Action { public static final PreviewDatafeedAction INSTANCE = new PreviewDatafeedAction(); public static final String NAME = "cluster:admin/xpack/ml/datafeeds/preview"; @@ -35,11 +34,6 @@ private PreviewDatafeedAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(); @@ -107,7 +101,7 @@ public boolean equals(Object obj) { } } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutCalendarAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutCalendarAction.java index 5644d05af049d..ace5869dc508d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutCalendarAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutCalendarAction.java @@ -28,7 +28,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; -public class PutCalendarAction extends Action { +public class PutCalendarAction extends Action { public static final PutCalendarAction INSTANCE = new PutCalendarAction(); public static final String NAME = "cluster:admin/xpack/ml/calendars/put"; @@ -36,11 +36,6 @@ private PutCalendarAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(); @@ -131,7 +126,7 @@ public boolean equals(Object obj) { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedAction.java index bb9b9be16e79a..5142abac08622 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedAction.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.util.Objects; -public class PutDatafeedAction extends Action { +public class PutDatafeedAction extends Action { public static final PutDatafeedAction INSTANCE = new PutDatafeedAction(); public static final String NAME = "cluster:admin/xpack/ml/datafeeds/put"; @@ -31,11 +31,6 @@ private PutDatafeedAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutFilterAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutFilterAction.java index a5d58d8576c8b..f11a7586aa6ac 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutFilterAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutFilterAction.java @@ -25,7 +25,7 @@ import java.util.Objects; -public class PutFilterAction extends Action { +public class PutFilterAction extends Action { public static final PutFilterAction INSTANCE = new PutFilterAction(); public static final String NAME = "cluster:admin/xpack/ml/filters/put"; @@ -34,11 +34,6 @@ private PutFilterAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(); @@ -113,7 +108,7 @@ public boolean equals(Object obj) { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutJobAction.java index 57f4b040010b2..a556a58d50380 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutJobAction.java @@ -25,7 +25,7 @@ import java.util.List; import java.util.Objects; -public class PutJobAction extends Action { +public class PutJobAction extends Action { public static final PutJobAction INSTANCE = new PutJobAction(); public static final String NAME = "cluster:admin/xpack/ml/job/put"; @@ -34,11 +34,6 @@ private PutJobAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotAction.java index 67b362a3359a5..d5b14abd6f9c8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotAction.java @@ -30,7 +30,7 @@ import java.util.Objects; public class RevertModelSnapshotAction -extends Action { +extends Action { public static final RevertModelSnapshotAction INSTANCE = new RevertModelSnapshotAction(); public static final String NAME = "cluster:admin/xpack/ml/job/model_snapshots/revert"; @@ -39,11 +39,6 @@ private RevertModelSnapshotAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public Response newResponse() { return new Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedAction.java index cd37354f42e4d..fc8c17f462a8a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedAction.java @@ -33,8 +33,7 @@ import java.util.Objects; import java.util.function.LongSupplier; -public class StartDatafeedAction - extends Action { +public class StartDatafeedAction extends Action { public static final ParseField START_TIME = new ParseField("start"); public static final ParseField END_TIME = new ParseField("end"); @@ -48,11 +47,6 @@ private StartDatafeedAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -313,7 +307,7 @@ public int hashCode() { } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client, StartDatafeedAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedAction.java index b59677f283378..4df27e1b984a2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedAction.java @@ -29,8 +29,7 @@ import java.io.IOException; import java.util.Objects; -public class StopDatafeedAction - extends Action { +public class StopDatafeedAction extends Action { public static final StopDatafeedAction INSTANCE = new StopDatafeedAction(); public static final String NAME = "cluster:admin/xpack/ml/datafeed/stop"; @@ -40,11 +39,6 @@ private StopDatafeedAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -235,7 +229,7 @@ public void writeTo(StreamOutput out) throws IOException { } } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client, StopDatafeedAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateCalendarJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateCalendarJobAction.java index d1a453c7e164a..dfe6499d2c4e8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateCalendarJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateCalendarJobAction.java @@ -18,8 +18,7 @@ import java.io.IOException; import java.util.Objects; -public class UpdateCalendarJobAction extends Action { +public class UpdateCalendarJobAction extends Action { public static final UpdateCalendarJobAction INSTANCE = new UpdateCalendarJobAction(); public static final String NAME = "cluster:admin/xpack/ml/calendars/jobs/update"; @@ -27,11 +26,6 @@ private UpdateCalendarJobAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public PutCalendarAction.Response newResponse() { return new PutCalendarAction.Response(); @@ -108,7 +102,7 @@ public boolean equals(Object obj) { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedAction.java index 588fb264190be..8ed170b8603b2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedAction.java @@ -20,8 +20,7 @@ import java.io.IOException; import java.util.Objects; -public class UpdateDatafeedAction extends Action { +public class UpdateDatafeedAction extends Action { public static final UpdateDatafeedAction INSTANCE = new UpdateDatafeedAction(); public static final String NAME = "cluster:admin/xpack/ml/datafeeds/update"; @@ -30,11 +29,6 @@ private UpdateDatafeedAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public PutDatafeedAction.Response newResponse() { return new PutDatafeedAction.Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateJobAction.java index 1fb387b0b6c2a..020d4c22ee31f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateJobAction.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.Objects; -public class UpdateJobAction extends Action { +public class UpdateJobAction extends Action { public static final UpdateJobAction INSTANCE = new UpdateJobAction(); public static final String NAME = "cluster:admin/xpack/ml/job/update"; @@ -32,11 +32,6 @@ private UpdateJobAction() { super(NAME); } - @Override - public UpdateJobAction.RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new UpdateJobAction.RequestBuilder(client, this); - } - @Override public PutJobAction.Response newResponse() { return new PutJobAction.Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotAction.java index 6b62d148c948c..9703fed25ef9f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotAction.java @@ -29,8 +29,7 @@ import java.io.IOException; import java.util.Objects; -public class UpdateModelSnapshotAction extends Action { +public class UpdateModelSnapshotAction extends Action { public static final UpdateModelSnapshotAction INSTANCE = new UpdateModelSnapshotAction(); public static final String NAME = "cluster:admin/xpack/ml/job/model_snapshots/update"; @@ -39,11 +38,6 @@ private UpdateModelSnapshotAction() { super(NAME); } - @Override - public UpdateModelSnapshotAction.RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public UpdateModelSnapshotAction.Response newResponse() { return new Response(); @@ -236,7 +230,7 @@ public final String toString() { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client, UpdateModelSnapshotAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateProcessAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateProcessAction.java index 31ba85232d504..b99a0b7400782 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateProcessAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateProcessAction.java @@ -24,8 +24,7 @@ import java.util.List; import java.util.Objects; -public class UpdateProcessAction extends - Action { +public class UpdateProcessAction extends Action { public static final UpdateProcessAction INSTANCE = new UpdateProcessAction(); public static final String NAME = "cluster:internal/xpack/ml/job/update/process"; @@ -34,17 +33,12 @@ private UpdateProcessAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client, UpdateProcessAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorAction.java index 13948fc5fdc8f..9e8b2d69efa5a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorAction.java @@ -21,8 +21,7 @@ import java.io.IOException; import java.util.Objects; -public class ValidateDetectorAction -extends Action { +public class ValidateDetectorAction extends Action { public static final ValidateDetectorAction INSTANCE = new ValidateDetectorAction(); public static final String NAME = "cluster:admin/xpack/ml/job/validate/detector"; @@ -31,17 +30,12 @@ protected ValidateDetectorAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, INSTANCE); - } - @Override public Response newResponse() { return new Response(); } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { protected RequestBuilder(ElasticsearchClient client, ValidateDetectorAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigAction.java index e0cde4f9358c9..f8b9eef9ffeb7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigAction.java @@ -22,8 +22,7 @@ import java.util.List; import java.util.Objects; -public class ValidateJobConfigAction -extends Action { +public class ValidateJobConfigAction extends Action { public static final ValidateJobConfigAction INSTANCE = new ValidateJobConfigAction(); public static final String NAME = "cluster:admin/xpack/ml/job/validate"; @@ -32,17 +31,12 @@ protected ValidateJobConfigAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, INSTANCE); - } - @Override public Response newResponse() { return new Response(); } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { protected RequestBuilder(ElasticsearchClient client, ValidateJobConfigAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkAction.java index 24dc9be34731d..05ea4b8ed2c6d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.xpack.core.monitoring.action; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class MonitoringBulkAction extends Action { +public class MonitoringBulkAction extends Action { public static final MonitoringBulkAction INSTANCE = new MonitoringBulkAction(); public static final String NAME = "cluster:admin/xpack/monitoring/bulk"; @@ -17,11 +16,6 @@ private MonitoringBulkAction() { super(NAME); } - @Override - public MonitoringBulkRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new MonitoringBulkRequestBuilder(client); - } - @Override public MonitoringBulkResponse newResponse() { return new MonitoringBulkResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkRequestBuilder.java index e028b2ffc7d68..576505a2d2eb1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkRequestBuilder.java @@ -14,7 +14,7 @@ import java.io.IOException; public class MonitoringBulkRequestBuilder - extends ActionRequestBuilder { + extends ActionRequestBuilder { public MonitoringBulkRequestBuilder(ElasticsearchClient client) { super(client, MonitoringBulkAction.INSTANCE, new MonitoringBulkRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/DeleteRollupJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/DeleteRollupJobAction.java index 771f5e98d5c68..7093a7215ab4a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/DeleteRollupJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/DeleteRollupJobAction.java @@ -22,8 +22,7 @@ import java.io.IOException; import java.util.Objects; -public class DeleteRollupJobAction extends Action { +public class DeleteRollupJobAction extends Action { public static final DeleteRollupJobAction INSTANCE = new DeleteRollupJobAction(); public static final String NAME = "cluster:admin/xpack/rollup/delete"; @@ -32,11 +31,6 @@ private DeleteRollupJobAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, INSTANCE); - } - @Override public Response newResponse() { return new Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupCapsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupCapsAction.java index 83e9c7f8a5b42..55f0d6139ae50 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupCapsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupCapsAction.java @@ -28,8 +28,7 @@ import java.util.Map; import java.util.Objects; -public class GetRollupCapsAction extends Action { +public class GetRollupCapsAction extends Action { public static final GetRollupCapsAction INSTANCE = new GetRollupCapsAction(); public static final String NAME = "cluster:monitor/xpack/rollup/get/caps"; @@ -40,11 +39,6 @@ private GetRollupCapsAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, INSTANCE); - } - @Override public Response newResponse() { return new Response(); @@ -108,7 +102,7 @@ public boolean equals(Object obj) { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { protected RequestBuilder(ElasticsearchClient client, GetRollupCapsAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupJobsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupJobsAction.java index 2e8ed2852e27f..5372773867034 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupJobsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupJobsAction.java @@ -35,8 +35,7 @@ import java.util.List; import java.util.Objects; -public class GetRollupJobsAction extends Action { +public class GetRollupJobsAction extends Action { public static final GetRollupJobsAction INSTANCE = new GetRollupJobsAction(); public static final String NAME = "cluster:monitor/xpack/rollup/get"; @@ -49,11 +48,6 @@ private GetRollupJobsAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, INSTANCE); - } - @Override public Response newResponse() { return new Response(); @@ -131,7 +125,7 @@ public boolean equals(Object obj) { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { protected RequestBuilder(ElasticsearchClient client, GetRollupJobsAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/PutRollupJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/PutRollupJobAction.java index bb64d97f1c87d..6d28fb692948b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/PutRollupJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/PutRollupJobAction.java @@ -25,8 +25,7 @@ import java.util.Map; import java.util.Objects; -public class PutRollupJobAction extends Action { +public class PutRollupJobAction extends Action { public static final PutRollupJobAction INSTANCE = new PutRollupJobAction(); public static final String NAME = "cluster:admin/xpack/rollup/put"; @@ -35,11 +34,6 @@ private PutRollupJobAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, INSTANCE); - } - @Override public Response newResponse() { return new Response(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupSearchAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupSearchAction.java index b4d3d6efb7d47..c79eacb80ae02 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupSearchAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupSearchAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.ElasticsearchClient; -public class RollupSearchAction extends Action { +public class RollupSearchAction extends Action { public static final RollupSearchAction INSTANCE = new RollupSearchAction(); public static final String NAME = "indices:admin/xpack/rollup/search"; @@ -20,17 +20,12 @@ private RollupSearchAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client); - } - @Override public SearchResponse newResponse() { return new SearchResponse(); } - static class RequestBuilder extends ActionRequestBuilder { + static class RequestBuilder extends ActionRequestBuilder { RequestBuilder(ElasticsearchClient client) { super(client, INSTANCE, new SearchRequest()); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StartRollupJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StartRollupJobAction.java index 042dbd18d42d4..1c71653e85f92 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StartRollupJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StartRollupJobAction.java @@ -26,8 +26,7 @@ import java.util.Collections; import java.util.Objects; -public class StartRollupJobAction extends Action { +public class StartRollupJobAction extends Action { public static final StartRollupJobAction INSTANCE = new StartRollupJobAction(); public static final String NAME = "cluster:admin/xpack/rollup/start"; @@ -36,11 +35,6 @@ private StartRollupJobAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, INSTANCE); - } - @Override public Response newResponse() { return new Response(); @@ -100,7 +94,7 @@ public boolean equals(Object obj) { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { protected RequestBuilder(ElasticsearchClient client, StartRollupJobAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StopRollupJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StopRollupJobAction.java index cfb7da0bd9323..b54130fe1b1de 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StopRollupJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StopRollupJobAction.java @@ -25,8 +25,7 @@ import java.util.Collections; import java.util.Objects; -public class StopRollupJobAction extends Action { +public class StopRollupJobAction extends Action { public static final StopRollupJobAction INSTANCE = new StopRollupJobAction(); public static final String NAME = "cluster:admin/xpack/rollup/stop"; @@ -35,11 +34,6 @@ private StopRollupJobAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, INSTANCE); - } - @Override public Response newResponse() { return new Response(); @@ -99,7 +93,7 @@ public boolean equals(Object obj) { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { protected RequestBuilder(ElasticsearchClient client, StopRollupJobAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/realm/ClearRealmCacheAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/realm/ClearRealmCacheAction.java index 83e0334bc0b4a..a1c865a030651 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/realm/ClearRealmCacheAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/realm/ClearRealmCacheAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.xpack.core.security.action.realm; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ClearRealmCacheAction extends Action { +public class ClearRealmCacheAction extends Action { public static final ClearRealmCacheAction INSTANCE = new ClearRealmCacheAction(); public static final String NAME = "cluster:admin/xpack/security/realm/cache/clear"; @@ -17,11 +16,6 @@ protected ClearRealmCacheAction() { super(NAME); } - @Override - public ClearRealmCacheRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ClearRealmCacheRequestBuilder(client, this); - } - @Override public ClearRealmCacheResponse newResponse() { return new ClearRealmCacheResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/ClearRolesCacheAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/ClearRolesCacheAction.java index 68a385f2dfa1f..7eebd671ab1df 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/ClearRolesCacheAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/ClearRolesCacheAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.security.action.role; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * The action for clearing the cache used by native roles that are stored in an index. */ -public class ClearRolesCacheAction extends Action { +public class ClearRolesCacheAction extends Action { public static final ClearRolesCacheAction INSTANCE = new ClearRolesCacheAction(); public static final String NAME = "cluster:admin/xpack/security/roles/cache/clear"; @@ -20,11 +19,6 @@ protected ClearRolesCacheAction() { super(NAME); } - @Override - public ClearRolesCacheRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ClearRolesCacheRequestBuilder(client, this, new ClearRolesCacheRequest()); - } - @Override public ClearRolesCacheResponse newResponse() { return new ClearRolesCacheResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/DeleteRoleAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/DeleteRoleAction.java index f7148411c9df4..3261ea94f4515 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/DeleteRoleAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/DeleteRoleAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.security.action.role; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action for deleting a role from the security index */ -public class DeleteRoleAction extends Action { +public class DeleteRoleAction extends Action { public static final DeleteRoleAction INSTANCE = new DeleteRoleAction(); public static final String NAME = "cluster:admin/xpack/security/role/delete"; @@ -21,11 +20,6 @@ protected DeleteRoleAction() { super(NAME); } - @Override - public DeleteRoleRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new DeleteRoleRequestBuilder(client, this); - } - @Override public DeleteRoleResponse newResponse() { return new DeleteRoleResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/DeleteRoleRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/DeleteRoleRequestBuilder.java index ef1fab2d8e61b..1ac593d75f551 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/DeleteRoleRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/DeleteRoleRequestBuilder.java @@ -12,7 +12,7 @@ /** * A builder for requests to delete a role from the security index */ -public class DeleteRoleRequestBuilder extends ActionRequestBuilder +public class DeleteRoleRequestBuilder extends ActionRequestBuilder implements WriteRequestBuilder { public DeleteRoleRequestBuilder(ElasticsearchClient client) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/GetRolesAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/GetRolesAction.java index aa770ba160bc8..3489c2493e762 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/GetRolesAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/GetRolesAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.security.action.role; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action to retrieve a role from the security index */ -public class GetRolesAction extends Action { +public class GetRolesAction extends Action { public static final GetRolesAction INSTANCE = new GetRolesAction(); public static final String NAME = "cluster:admin/xpack/security/role/get"; @@ -21,11 +20,6 @@ protected GetRolesAction() { super(NAME); } - @Override - public GetRolesRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetRolesRequestBuilder(client, this); - } - @Override public GetRolesResponse newResponse() { return new GetRolesResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/GetRolesRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/GetRolesRequestBuilder.java index f630874609219..9d760026e57ea 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/GetRolesRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/GetRolesRequestBuilder.java @@ -11,7 +11,7 @@ /** * Builder for requests to retrieve a role from the security index */ -public class GetRolesRequestBuilder extends ActionRequestBuilder { +public class GetRolesRequestBuilder extends ActionRequestBuilder { public GetRolesRequestBuilder(ElasticsearchClient client) { this(client, GetRolesAction.INSTANCE); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleAction.java index 8a7461eaeff15..a9aa2c8f29aec 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.security.action.role; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action for adding a role to the security index */ -public class PutRoleAction extends Action { +public class PutRoleAction extends Action { public static final PutRoleAction INSTANCE = new PutRoleAction(); public static final String NAME = "cluster:admin/xpack/security/role/put"; @@ -21,11 +20,6 @@ protected PutRoleAction() { super(NAME); } - @Override - public PutRoleRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new PutRoleRequestBuilder(client, this); - } - @Override public PutRoleResponse newResponse() { return new PutRoleResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequestBuilder.java index 79142a7b5758a..25d443eda3fe9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequestBuilder.java @@ -19,7 +19,7 @@ /** * Builder for requests to add a role to the administrative index */ -public class PutRoleRequestBuilder extends ActionRequestBuilder +public class PutRoleRequestBuilder extends ActionRequestBuilder implements WriteRequestBuilder { public PutRoleRequestBuilder(ElasticsearchClient client) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/DeleteRoleMappingAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/DeleteRoleMappingAction.java index 79e99f3843491..db60837437492 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/DeleteRoleMappingAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/DeleteRoleMappingAction.java @@ -12,8 +12,7 @@ * Action for deleting a role-mapping from the * org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore */ -public class DeleteRoleMappingAction extends Action { +public class DeleteRoleMappingAction extends Action { public static final DeleteRoleMappingAction INSTANCE = new DeleteRoleMappingAction(); public static final String NAME = "cluster:admin/xpack/security/role_mapping/delete"; @@ -22,11 +21,6 @@ private DeleteRoleMappingAction() { super(NAME); } - @Override - public DeleteRoleMappingRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new DeleteRoleMappingRequestBuilder(client, this); - } - @Override public DeleteRoleMappingResponse newResponse() { return new DeleteRoleMappingResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/DeleteRoleMappingRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/DeleteRoleMappingRequestBuilder.java index 106e35896014e..2ca23d31f693a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/DeleteRoleMappingRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/DeleteRoleMappingRequestBuilder.java @@ -13,8 +13,7 @@ * A builder for requests to delete a role-mapping from the * org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore */ -public class DeleteRoleMappingRequestBuilder extends ActionRequestBuilder +public class DeleteRoleMappingRequestBuilder extends ActionRequestBuilder implements WriteRequestBuilder { public DeleteRoleMappingRequestBuilder(ElasticsearchClient client, diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/GetRoleMappingsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/GetRoleMappingsAction.java index 49ada117ae6a1..12797ed4d2b0f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/GetRoleMappingsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/GetRoleMappingsAction.java @@ -6,14 +6,13 @@ package org.elasticsearch.xpack.core.security.action.rolemapping; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action to retrieve one or more role-mappings from X-Pack security * see org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore */ -public class GetRoleMappingsAction extends Action { +public class GetRoleMappingsAction extends Action { public static final GetRoleMappingsAction INSTANCE = new GetRoleMappingsAction(); public static final String NAME = "cluster:admin/xpack/security/role_mapping/get"; @@ -22,11 +21,6 @@ private GetRoleMappingsAction() { super(NAME); } - @Override - public GetRoleMappingsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetRoleMappingsRequestBuilder(client, this); - } - @Override public GetRoleMappingsResponse newResponse() { return new GetRoleMappingsResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/GetRoleMappingsRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/GetRoleMappingsRequestBuilder.java index 1beaed5d4aea7..db4f8b7d88746 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/GetRoleMappingsRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/GetRoleMappingsRequestBuilder.java @@ -13,8 +13,7 @@ * * see org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore */ -public class GetRoleMappingsRequestBuilder extends ActionRequestBuilder { +public class GetRoleMappingsRequestBuilder extends ActionRequestBuilder { public GetRoleMappingsRequestBuilder(ElasticsearchClient client, GetRoleMappingsAction action) { super(client, action, new GetRoleMappingsRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingAction.java index 4e9b427c63acf..34b1e94d753d1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingAction.java @@ -11,8 +11,7 @@ /** * Action for adding a role to the security index */ -public class PutRoleMappingAction extends Action { +public class PutRoleMappingAction extends Action { public static final PutRoleMappingAction INSTANCE = new PutRoleMappingAction(); public static final String NAME = "cluster:admin/xpack/security/role_mapping/put"; @@ -21,11 +20,6 @@ private PutRoleMappingAction() { super(NAME); } - @Override - public PutRoleMappingRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new PutRoleMappingRequestBuilder(client, this); - } - @Override public PutRoleMappingResponse newResponse() { return new PutRoleMappingResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingRequestBuilder.java index 1054ab9daa0d7..c74952e9dfd09 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingRequestBuilder.java @@ -22,8 +22,7 @@ * * see org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore */ -public class PutRoleMappingRequestBuilder extends ActionRequestBuilder implements +public class PutRoleMappingRequestBuilder extends ActionRequestBuilder implements WriteRequestBuilder { public PutRoleMappingRequestBuilder(ElasticsearchClient client, PutRoleMappingAction action) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlAuthenticateAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlAuthenticateAction.java index 5169162920925..a1b8829b1eda7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlAuthenticateAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlAuthenticateAction.java @@ -11,8 +11,7 @@ /** * Action for authenticating using SAML assertions */ -public final class SamlAuthenticateAction - extends Action { +public final class SamlAuthenticateAction extends Action { public static final String NAME = "cluster:admin/xpack/security/saml/authenticate"; public static final SamlAuthenticateAction INSTANCE = new SamlAuthenticateAction(); @@ -21,11 +20,6 @@ private SamlAuthenticateAction() { super(NAME); } - @Override - public SamlAuthenticateRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SamlAuthenticateRequestBuilder(client); - } - @Override public SamlAuthenticateResponse newResponse() { return new SamlAuthenticateResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlAuthenticateRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlAuthenticateRequestBuilder.java index 8b8efb504c46e..17cff756e2622 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlAuthenticateRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlAuthenticateRequestBuilder.java @@ -14,7 +14,7 @@ * Request builder used to populate a {@link SamlAuthenticateRequest} */ public final class SamlAuthenticateRequestBuilder - extends ActionRequestBuilder { + extends ActionRequestBuilder { public SamlAuthenticateRequestBuilder(ElasticsearchClient client) { super(client, SamlAuthenticateAction.INSTANCE, new SamlAuthenticateRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlInvalidateSessionAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlInvalidateSessionAction.java index c9bbf3a6671ff..7efcdc7d16bac 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlInvalidateSessionAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlInvalidateSessionAction.java @@ -11,8 +11,7 @@ /** * Action to perform IdP-initiated logout for a SAML-SSO user */ -public final class SamlInvalidateSessionAction - extends Action { +public final class SamlInvalidateSessionAction extends Action { public static final String NAME = "cluster:admin/xpack/security/saml/invalidate"; public static final SamlInvalidateSessionAction INSTANCE = new SamlInvalidateSessionAction(); @@ -21,11 +20,6 @@ private SamlInvalidateSessionAction() { super(NAME); } - @Override - public SamlInvalidateSessionRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SamlInvalidateSessionRequestBuilder(client); - } - @Override public SamlInvalidateSessionResponse newResponse() { return new SamlInvalidateSessionResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlInvalidateSessionRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlInvalidateSessionRequestBuilder.java index 0d9b26a7b650f..10c2f3a539e3f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlInvalidateSessionRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlInvalidateSessionRequestBuilder.java @@ -12,7 +12,7 @@ * Request builder used to populate a {@link SamlInvalidateSessionRequest} */ public final class SamlInvalidateSessionRequestBuilder - extends ActionRequestBuilder { + extends ActionRequestBuilder { public SamlInvalidateSessionRequestBuilder(ElasticsearchClient client) { super(client, SamlInvalidateSessionAction.INSTANCE, new SamlInvalidateSessionRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlLogoutAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlLogoutAction.java index bc7b0ed257dd4..8c2cb6f4599d6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlLogoutAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlLogoutAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.security.action.saml; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action for initiating a logout process for a SAML-SSO user */ -public final class SamlLogoutAction extends Action { +public final class SamlLogoutAction extends Action { public static final String NAME = "cluster:admin/xpack/security/saml/logout"; public static final SamlLogoutAction INSTANCE = new SamlLogoutAction(); @@ -20,11 +19,6 @@ private SamlLogoutAction() { super(NAME); } - @Override - public SamlLogoutRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SamlLogoutRequestBuilder(client); - } - @Override public SamlLogoutResponse newResponse() { return new SamlLogoutResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlLogoutRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlLogoutRequestBuilder.java index 8d920a0368fd6..87a04582816b5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlLogoutRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlLogoutRequestBuilder.java @@ -11,8 +11,7 @@ /** * Request builder used to populate a {@link SamlLogoutRequest} */ -public final class SamlLogoutRequestBuilder extends ActionRequestBuilder { +public final class SamlLogoutRequestBuilder extends ActionRequestBuilder { public SamlLogoutRequestBuilder(ElasticsearchClient client) { super(client, SamlLogoutAction.INSTANCE, new SamlLogoutRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlPrepareAuthenticationAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlPrepareAuthenticationAction.java index bbc4cdbd7fd5d..9d80df1d96019 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlPrepareAuthenticationAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlPrepareAuthenticationAction.java @@ -11,8 +11,7 @@ /** * Action for initiating an authentication process using SAML assertions */ -public final class SamlPrepareAuthenticationAction - extends Action { +public final class SamlPrepareAuthenticationAction extends Action { public static final String NAME = "cluster:admin/xpack/security/saml/prepare"; public static final SamlPrepareAuthenticationAction INSTANCE = new SamlPrepareAuthenticationAction(); @@ -21,11 +20,6 @@ private SamlPrepareAuthenticationAction() { super(NAME); } - @Override - public SamlPrepareAuthenticationRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SamlPrepareAuthenticationRequestBuilder(client); - } - @Override public SamlPrepareAuthenticationResponse newResponse() { return new SamlPrepareAuthenticationResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlPrepareAuthenticationRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlPrepareAuthenticationRequestBuilder.java index 7474557a76d77..a3bf6f595b188 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlPrepareAuthenticationRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlPrepareAuthenticationRequestBuilder.java @@ -12,7 +12,7 @@ * Request builder used to populate a {@link SamlPrepareAuthenticationRequest} */ public final class SamlPrepareAuthenticationRequestBuilder extends ActionRequestBuilder { + SamlPrepareAuthenticationResponse> { public SamlPrepareAuthenticationRequestBuilder(ElasticsearchClient client) { super(client, SamlPrepareAuthenticationAction.INSTANCE, new SamlPrepareAuthenticationRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenAction.java index 98a312b7fcc34..9f2e937151ced 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.security.action.token; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action for creating a new token */ -public final class CreateTokenAction extends Action { +public final class CreateTokenAction extends Action { public static final String NAME = "cluster:admin/xpack/security/token/create"; public static final CreateTokenAction INSTANCE = new CreateTokenAction(); @@ -20,11 +19,6 @@ private CreateTokenAction() { super(NAME); } - @Override - public CreateTokenRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new CreateTokenRequestBuilder(client, INSTANCE); - } - @Override public CreateTokenResponse newResponse() { return new CreateTokenResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenRequestBuilder.java index 314a0aaf4aa2d..d94744dff373f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenRequestBuilder.java @@ -15,10 +15,9 @@ * Request builder used to populate a {@link CreateTokenRequest} */ public final class CreateTokenRequestBuilder - extends ActionRequestBuilder { + extends ActionRequestBuilder { - public CreateTokenRequestBuilder(ElasticsearchClient client, - Action action) { + public CreateTokenRequestBuilder(ElasticsearchClient client, Action action) { super(client, action, new CreateTokenRequest()); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenAction.java index 5f199876d6a99..eca864546b222 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.security.action.token; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action for invalidating a given token */ -public final class InvalidateTokenAction extends Action { +public final class InvalidateTokenAction extends Action { public static final String NAME = "cluster:admin/xpack/security/token/invalidate"; public static final InvalidateTokenAction INSTANCE = new InvalidateTokenAction(); @@ -20,11 +19,6 @@ private InvalidateTokenAction() { super(NAME); } - @Override - public InvalidateTokenRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new InvalidateTokenRequestBuilder(client); - } - @Override public InvalidateTokenResponse newResponse() { return new InvalidateTokenResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenRequestBuilder.java index 861757aff3c02..f77f6c6533271 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenRequestBuilder.java @@ -12,7 +12,7 @@ * Request builder that is used to populate a {@link InvalidateTokenRequest} */ public final class InvalidateTokenRequestBuilder - extends ActionRequestBuilder { + extends ActionRequestBuilder { public InvalidateTokenRequestBuilder(ElasticsearchClient client) { super(client, InvalidateTokenAction.INSTANCE, new InvalidateTokenRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/RefreshTokenAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/RefreshTokenAction.java index a322f3fa847ad..c847aa32898d3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/RefreshTokenAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/RefreshTokenAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.xpack.core.security.action.token; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public final class RefreshTokenAction extends Action { +public final class RefreshTokenAction extends Action { public static final String NAME = "cluster:admin/xpack/security/token/refresh"; public static final RefreshTokenAction INSTANCE = new RefreshTokenAction(); @@ -17,11 +16,6 @@ private RefreshTokenAction() { super(NAME); } - @Override - public CreateTokenRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new CreateTokenRequestBuilder(client, INSTANCE); - } - @Override public CreateTokenResponse newResponse() { return new CreateTokenResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateAction.java index b109ae0861a86..05c53063eb16d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.xpack.core.security.action.user; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class AuthenticateAction extends Action { +public class AuthenticateAction extends Action { public static final String NAME = "cluster:admin/xpack/security/user/authenticate"; public static final AuthenticateAction INSTANCE = new AuthenticateAction(); @@ -17,11 +16,6 @@ public AuthenticateAction() { super(NAME); } - @Override - public AuthenticateRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new AuthenticateRequestBuilder(client); - } - @Override public AuthenticateResponse newResponse() { return new AuthenticateResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateRequestBuilder.java index da3ce7956b84e..5cf54d2deb240 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateRequestBuilder.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ElasticsearchClient; public class AuthenticateRequestBuilder - extends ActionRequestBuilder { + extends ActionRequestBuilder { public AuthenticateRequestBuilder(ElasticsearchClient client) { this(client, AuthenticateAction.INSTANCE); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/ChangePasswordAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/ChangePasswordAction.java index 44b31e3f3ded6..23bfff8d80124 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/ChangePasswordAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/ChangePasswordAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.xpack.core.security.action.user; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class ChangePasswordAction extends Action { +public class ChangePasswordAction extends Action { public static final ChangePasswordAction INSTANCE = new ChangePasswordAction(); public static final String NAME = "cluster:admin/xpack/security/user/change_password"; @@ -17,11 +16,6 @@ protected ChangePasswordAction() { super(NAME); } - @Override - public ChangePasswordRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ChangePasswordRequestBuilder(client); - } - @Override public ChangePasswordResponse newResponse() { return new ChangePasswordResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/ChangePasswordRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/ChangePasswordRequestBuilder.java index b7ff68118e3cb..48f71d2cffcae 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/ChangePasswordRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/ChangePasswordRequestBuilder.java @@ -29,7 +29,7 @@ * Request to change a user's password. */ public class ChangePasswordRequestBuilder - extends ActionRequestBuilder + extends ActionRequestBuilder implements WriteRequestBuilder { public ChangePasswordRequestBuilder(ElasticsearchClient client) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/DeleteUserAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/DeleteUserAction.java index 54f99f923dbd9..a62381b6ecc6b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/DeleteUserAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/DeleteUserAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.security.action.user; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action for deleting a native user. */ -public class DeleteUserAction extends Action { +public class DeleteUserAction extends Action { public static final DeleteUserAction INSTANCE = new DeleteUserAction(); public static final String NAME = "cluster:admin/xpack/security/user/delete"; @@ -20,11 +19,6 @@ protected DeleteUserAction() { super(NAME); } - @Override - public DeleteUserRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new DeleteUserRequestBuilder(client, this); - } - @Override public DeleteUserResponse newResponse() { return new DeleteUserResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/DeleteUserRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/DeleteUserRequestBuilder.java index 1eecf5cf36b86..d95fa127317ed 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/DeleteUserRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/DeleteUserRequestBuilder.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.support.WriteRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -public class DeleteUserRequestBuilder extends ActionRequestBuilder +public class DeleteUserRequestBuilder extends ActionRequestBuilder implements WriteRequestBuilder { public DeleteUserRequestBuilder(ElasticsearchClient client) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersAction.java index 4b9bf56fb7b91..5c9142671f4b2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.security.action.user; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action for retrieving a user from the security index */ -public class GetUsersAction extends Action { +public class GetUsersAction extends Action { public static final GetUsersAction INSTANCE = new GetUsersAction(); public static final String NAME = "cluster:admin/xpack/security/user/get"; @@ -20,11 +19,6 @@ protected GetUsersAction() { super(NAME); } - @Override - public GetUsersRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetUsersRequestBuilder(client, this); - } - @Override public GetUsersResponse newResponse() { return new GetUsersResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersRequestBuilder.java index 6226146dd7cf4..d339ac8a11946 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersRequestBuilder.java @@ -8,7 +8,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -public class GetUsersRequestBuilder extends ActionRequestBuilder { +public class GetUsersRequestBuilder extends ActionRequestBuilder { public GetUsersRequestBuilder(ElasticsearchClient client) { this(client, GetUsersAction.INSTANCE); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesAction.java index 5df11a349a724..5db27db93ec91 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesAction.java @@ -6,14 +6,13 @@ package org.elasticsearch.xpack.core.security.action.user; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; /** * This action is testing whether a user has the specified * {@link RoleDescriptor.IndicesPrivileges privileges} */ -public class HasPrivilegesAction extends Action { +public class HasPrivilegesAction extends Action { public static final HasPrivilegesAction INSTANCE = new HasPrivilegesAction(); public static final String NAME = "cluster:admin/xpack/security/user/has_privileges"; @@ -22,11 +21,6 @@ private HasPrivilegesAction() { super(NAME); } - @Override - public HasPrivilegesRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new HasPrivilegesRequestBuilder(client); - } - @Override public HasPrivilegesResponse newResponse() { return new HasPrivilegesResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesRequestBuilder.java index 2bf2bdb4d876e..4504a95962c13 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesRequestBuilder.java @@ -17,7 +17,7 @@ * Request builder for checking a user's privileges */ public class HasPrivilegesRequestBuilder - extends ActionRequestBuilder { + extends ActionRequestBuilder { public HasPrivilegesRequestBuilder(ElasticsearchClient client) { super(client, HasPrivilegesAction.INSTANCE, new HasPrivilegesRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserAction.java index 377fb57d00754..6009f89e69f40 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.security.action.user; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Action for putting (adding/updating) a native user. */ -public class PutUserAction extends Action { +public class PutUserAction extends Action { public static final PutUserAction INSTANCE = new PutUserAction(); public static final String NAME = "cluster:admin/xpack/security/user/put"; @@ -20,11 +19,6 @@ protected PutUserAction() { super(NAME); } - @Override - public PutUserRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new PutUserRequestBuilder(client, this); - } - @Override public PutUserResponse newResponse() { return new PutUserResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserRequestBuilder.java index 9974716055db6..60964a7490dac 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserRequestBuilder.java @@ -30,7 +30,7 @@ import java.util.Map; import java.util.Objects; -public class PutUserRequestBuilder extends ActionRequestBuilder +public class PutUserRequestBuilder extends ActionRequestBuilder implements WriteRequestBuilder { private final Hasher hasher = Hasher.BCRYPT; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/SetEnabledAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/SetEnabledAction.java index 53bb5463c9182..ec010cc17a9b2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/SetEnabledAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/SetEnabledAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.security.action.user; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * This action is for setting the enabled flag on a native or reserved user */ -public class SetEnabledAction extends Action { +public class SetEnabledAction extends Action { public static final SetEnabledAction INSTANCE = new SetEnabledAction(); public static final String NAME = "cluster:admin/xpack/security/user/set_enabled"; @@ -20,11 +19,6 @@ private SetEnabledAction() { super(NAME); } - @Override - public SetEnabledRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SetEnabledRequestBuilder(client); - } - @Override public SetEnabledResponse newResponse() { return new SetEnabledResponse(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/SetEnabledRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/SetEnabledRequestBuilder.java index 2f4381ade1114..b8298f09b9b79 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/SetEnabledRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/SetEnabledRequestBuilder.java @@ -12,7 +12,7 @@ /** * Request builder for setting a user as enabled or disabled */ -public class SetEnabledRequestBuilder extends ActionRequestBuilder +public class SetEnabledRequestBuilder extends ActionRequestBuilder implements WriteRequestBuilder { public SetEnabledRequestBuilder(ElasticsearchClient client) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/action/GetCertificateInfoAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/action/GetCertificateInfoAction.java index 54e7548b8038b..e4115887f66a9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/action/GetCertificateInfoAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/action/GetCertificateInfoAction.java @@ -25,8 +25,7 @@ * Action to obtain information about X.509 (SSL/TLS) certificates that are being used by X-Pack. * The primary use case is for tracking the expiry dates of certificates. */ -public class GetCertificateInfoAction - extends Action { +public class GetCertificateInfoAction extends Action { public static final GetCertificateInfoAction INSTANCE = new GetCertificateInfoAction(); public static final String NAME = "cluster:monitor/xpack/ssl/certificates/get"; @@ -35,11 +34,6 @@ private GetCertificateInfoAction() { super(NAME); } - @Override - public GetCertificateInfoAction.RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetCertificateInfoAction.RequestBuilder(client, this); - } - @Override public GetCertificateInfoAction.Response newResponse() { return new GetCertificateInfoAction.Response(); @@ -94,7 +88,7 @@ public void readFrom(StreamInput in) throws IOException { } } - public static class RequestBuilder extends ActionRequestBuilder { + public static class RequestBuilder extends ActionRequestBuilder { public RequestBuilder(ElasticsearchClient client, GetCertificateInfoAction action) { super(client, action, new Request()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/upgrade/actions/IndexUpgradeAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/upgrade/actions/IndexUpgradeAction.java index f5b5844e5f267..781cfe4d4d227 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/upgrade/actions/IndexUpgradeAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/upgrade/actions/IndexUpgradeAction.java @@ -26,8 +26,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; import static org.elasticsearch.xpack.core.upgrade.IndexUpgradeServiceFields.UPGRADE_INDEX_OPTIONS; -public class IndexUpgradeAction extends Action { +public class IndexUpgradeAction extends Action { public static final IndexUpgradeAction INSTANCE = new IndexUpgradeAction(); public static final String NAME = "cluster:admin/xpack/upgrade"; @@ -36,11 +35,6 @@ private IndexUpgradeAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public BulkByScrollResponse newResponse() { return new BulkByScrollResponse(); @@ -151,8 +145,8 @@ public boolean shouldCancelChildrenOnCancellation() { public static class RequestBuilder extends MasterNodeReadOperationRequestBuilder { - protected RequestBuilder(ElasticsearchClient client, IndexUpgradeAction action) { - super(client, action, new Request()); + public RequestBuilder(ElasticsearchClient client) { + super(client, INSTANCE, new Request()); } public RequestBuilder setIndex(String index) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/upgrade/actions/IndexUpgradeInfoAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/upgrade/actions/IndexUpgradeInfoAction.java index 74df1caecdde0..bfa6de10b1b28 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/upgrade/actions/IndexUpgradeInfoAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/upgrade/actions/IndexUpgradeInfoAction.java @@ -26,8 +26,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; -public class IndexUpgradeInfoAction extends Action { +public class IndexUpgradeInfoAction extends Action { public static final IndexUpgradeInfoAction INSTANCE = new IndexUpgradeInfoAction(); public static final String NAME = "cluster:admin/xpack/upgrade/info"; @@ -36,11 +35,6 @@ private IndexUpgradeInfoAction() { super(NAME); } - @Override - public RequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new RequestBuilder(client, this); - } - @Override public Response newResponse() { return new Response(); @@ -183,8 +177,8 @@ public int hashCode() { public static class RequestBuilder extends MasterNodeReadOperationRequestBuilder { - protected RequestBuilder(ElasticsearchClient client, IndexUpgradeInfoAction action) { - super(client, action, new Request()); + public RequestBuilder(ElasticsearchClient client) { + super(client, INSTANCE, new Request()); } public RequestBuilder setIndices(String... indices) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/ack/AckWatchAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/ack/AckWatchAction.java index d895ae31c5014..d6a7259087462 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/ack/AckWatchAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/ack/AckWatchAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.watcher.transport.actions.ack; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * This action acks a watch in memory, and the index */ -public class AckWatchAction extends Action { +public class AckWatchAction extends Action { public static final AckWatchAction INSTANCE = new AckWatchAction(); public static final String NAME = "cluster:admin/xpack/watcher/watch/ack"; @@ -24,9 +23,4 @@ private AckWatchAction() { public AckWatchResponse newResponse() { return new AckWatchResponse(); } - - @Override - public AckWatchRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new AckWatchRequestBuilder(client); - } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/ack/AckWatchRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/ack/AckWatchRequestBuilder.java index 16e0d20eaf3f0..1c643d833532d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/ack/AckWatchRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/ack/AckWatchRequestBuilder.java @@ -11,7 +11,7 @@ /** * A ack watch action request builder. */ -public class AckWatchRequestBuilder extends ActionRequestBuilder { +public class AckWatchRequestBuilder extends ActionRequestBuilder { public AckWatchRequestBuilder(ElasticsearchClient client) { super(client, AckWatchAction.INSTANCE, new AckWatchRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/activate/ActivateWatchAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/activate/ActivateWatchAction.java index 2832b779c402c..8f6f10ced9097 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/activate/ActivateWatchAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/activate/ActivateWatchAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.watcher.transport.actions.activate; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * This action acks a watch in memory, and the index */ -public class ActivateWatchAction extends Action { +public class ActivateWatchAction extends Action { public static final ActivateWatchAction INSTANCE = new ActivateWatchAction(); public static final String NAME = "cluster:admin/xpack/watcher/watch/activate"; @@ -24,9 +23,4 @@ private ActivateWatchAction() { public ActivateWatchResponse newResponse() { return new ActivateWatchResponse(); } - - @Override - public ActivateWatchRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ActivateWatchRequestBuilder(client); - } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/activate/ActivateWatchRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/activate/ActivateWatchRequestBuilder.java index 0122b055ae060..1f9570c87c541 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/activate/ActivateWatchRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/activate/ActivateWatchRequestBuilder.java @@ -11,8 +11,7 @@ /** * A activate watch action request builder. */ -public class ActivateWatchRequestBuilder extends ActionRequestBuilder { +public class ActivateWatchRequestBuilder extends ActionRequestBuilder { public ActivateWatchRequestBuilder(ElasticsearchClient client) { super(client, ActivateWatchAction.INSTANCE, new ActivateWatchRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/delete/DeleteWatchAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/delete/DeleteWatchAction.java index ffbe6539f60d9..e40d6876f1c9f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/delete/DeleteWatchAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/delete/DeleteWatchAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.watcher.transport.actions.delete; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * This action deletes an watch from in memory, the scheduler and the index */ -public class DeleteWatchAction extends Action { +public class DeleteWatchAction extends Action { public static final DeleteWatchAction INSTANCE = new DeleteWatchAction(); public static final String NAME = "cluster:admin/xpack/watcher/watch/delete"; @@ -24,9 +23,4 @@ private DeleteWatchAction() { public DeleteWatchResponse newResponse() { return new DeleteWatchResponse(); } - - @Override - public DeleteWatchRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new DeleteWatchRequestBuilder(client); - } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/delete/DeleteWatchRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/delete/DeleteWatchRequestBuilder.java index 1ba3fe12ea47d..afea505aa4a91 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/delete/DeleteWatchRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/delete/DeleteWatchRequestBuilder.java @@ -11,8 +11,7 @@ /** * A delete document action request builder. */ -public class DeleteWatchRequestBuilder extends ActionRequestBuilder { +public class DeleteWatchRequestBuilder extends ActionRequestBuilder { public DeleteWatchRequestBuilder(ElasticsearchClient client) { super(client, DeleteWatchAction.INSTANCE, new DeleteWatchRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchAction.java index f8a8b009e44b7..5baa021d6f170 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchAction.java @@ -6,13 +6,12 @@ package org.elasticsearch.xpack.core.watcher.transport.actions.execute; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * This action executes a watch, either ignoring the schedule and condition or just the schedule and can execute a subset of the actions, * optionally persisting the history entry */ -public class ExecuteWatchAction extends Action { +public class ExecuteWatchAction extends Action { public static final ExecuteWatchAction INSTANCE = new ExecuteWatchAction(); public static final String NAME = "cluster:admin/xpack/watcher/watch/execute"; @@ -25,10 +24,4 @@ private ExecuteWatchAction() { public ExecuteWatchResponse newResponse() { return new ExecuteWatchResponse(); } - - @Override - public ExecuteWatchRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new ExecuteWatchRequestBuilder(client); - } - } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchRequestBuilder.java index ee1f94da3df0d..e67424462418d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchRequestBuilder.java @@ -19,8 +19,7 @@ /** * A execute watch action request builder. */ -public class ExecuteWatchRequestBuilder extends ActionRequestBuilder { +public class ExecuteWatchRequestBuilder extends ActionRequestBuilder { public ExecuteWatchRequestBuilder(ElasticsearchClient client) { super(client, ExecuteWatchAction.INSTANCE, new ExecuteWatchRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/get/GetWatchAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/get/GetWatchAction.java index a68223c6f6c53..c411c0dbeb3f9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/get/GetWatchAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/get/GetWatchAction.java @@ -5,12 +5,10 @@ */ package org.elasticsearch.xpack.core.watcher.transport.actions.get; -import org.elasticsearch.client.ElasticsearchClient; - /** * This action gets an watch by name */ -public class GetWatchAction extends org.elasticsearch.action.Action { +public class GetWatchAction extends org.elasticsearch.action.Action { public static final GetWatchAction INSTANCE = new GetWatchAction(); public static final String NAME = "cluster:monitor/xpack/watcher/watch/get"; @@ -23,9 +21,4 @@ private GetWatchAction() { public GetWatchResponse newResponse() { return new GetWatchResponse(); } - - @Override - public GetWatchRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new GetWatchRequestBuilder(client); - } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/get/GetWatchRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/get/GetWatchRequestBuilder.java index 178cebcaf7262..88fd5351aa852 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/get/GetWatchRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/get/GetWatchRequestBuilder.java @@ -11,8 +11,7 @@ /** * A delete document action request builder. */ -public class GetWatchRequestBuilder extends ActionRequestBuilder { +public class GetWatchRequestBuilder extends ActionRequestBuilder { public GetWatchRequestBuilder(ElasticsearchClient client, String id) { super(client, GetWatchAction.INSTANCE, new GetWatchRequest(id)); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/PutWatchAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/PutWatchAction.java index 9b0024ee43bd6..faf2faae182f9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/PutWatchAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/PutWatchAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.watcher.transport.actions.put; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * This action puts an watch into the watch index and adds it to the scheduler */ -public class PutWatchAction extends Action { +public class PutWatchAction extends Action { public static final PutWatchAction INSTANCE = new PutWatchAction(); public static final String NAME = "cluster:admin/xpack/watcher/watch/put"; @@ -24,9 +23,4 @@ private PutWatchAction() { public PutWatchResponse newResponse() { return new PutWatchResponse(); } - - @Override - public PutWatchRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new PutWatchRequestBuilder(client); - } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/PutWatchRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/PutWatchRequestBuilder.java index 3d9ad2a01ac5c..050ac38dbb00c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/PutWatchRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/PutWatchRequestBuilder.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.xpack.core.watcher.client.WatchSourceBuilder; -public class PutWatchRequestBuilder extends ActionRequestBuilder { +public class PutWatchRequestBuilder extends ActionRequestBuilder { public PutWatchRequestBuilder(ElasticsearchClient client) { super(client, PutWatchAction.INSTANCE, new PutWatchRequest()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/service/WatcherServiceAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/service/WatcherServiceAction.java index 05cddee273c73..a9682b2946d9a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/service/WatcherServiceAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/service/WatcherServiceAction.java @@ -6,10 +6,9 @@ package org.elasticsearch.xpack.core.watcher.transport.actions.service; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class WatcherServiceAction extends Action { +public class WatcherServiceAction extends Action { public static final WatcherServiceAction INSTANCE = new WatcherServiceAction(); public static final String NAME = "cluster:admin/xpack/watcher/service"; @@ -22,9 +21,4 @@ private WatcherServiceAction() { public WatcherServiceResponse newResponse() { return new WatcherServiceResponse(); } - - @Override - public WatcherServiceRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new WatcherServiceRequestBuilder(client); - } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/stats/WatcherStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/stats/WatcherStatsAction.java index 0c111090f5413..330b6ace97797 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/stats/WatcherStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/stats/WatcherStatsAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.core.watcher.transport.actions.stats; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * This Action gets the stats for the watcher plugin */ -public class WatcherStatsAction extends Action { +public class WatcherStatsAction extends Action { public static final WatcherStatsAction INSTANCE = new WatcherStatsAction(); public static final String NAME = "cluster:monitor/xpack/watcher/stats/dist"; @@ -24,10 +23,4 @@ private WatcherStatsAction() { public WatcherStatsResponse newResponse() { return new WatcherStatsResponse(); } - - @Override - public WatcherStatsRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new WatcherStatsRequestBuilder(client); - } - } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationDataExtractor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationDataExtractor.java index d83865b751f50..6f68239a765ff 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationDataExtractor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationDataExtractor.java @@ -121,7 +121,7 @@ private SearchRequestBuilder buildSearchRequest() { // in that bucket long histogramSearchStartTime = Math.max(0, context.start - getHistogramInterval()); - SearchRequestBuilder searchRequestBuilder = SearchAction.INSTANCE.newRequestBuilder(client) + SearchRequestBuilder searchRequestBuilder = new SearchRequestBuilder(client, SearchAction.INSTANCE) .setIndices(context.indices) .setTypes(context.types) .setSize(0) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/chunked/ChunkedDataExtractor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/chunked/ChunkedDataExtractor.java index 2e157c3d1e95a..3b772544821d6 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/chunked/ChunkedDataExtractor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/chunked/ChunkedDataExtractor.java @@ -108,7 +108,7 @@ private void setUpChunkedSearch() throws IOException { } private DataSummary requestDataSummary() throws IOException { - SearchRequestBuilder searchRequestBuilder = SearchAction.INSTANCE.newRequestBuilder(client) + SearchRequestBuilder searchRequestBuilder = new SearchRequestBuilder(client, SearchAction.INSTANCE) .setSize(0) .setIndices(context.indices) .setTypes(context.types) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/scroll/ScrollDataExtractor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/scroll/ScrollDataExtractor.java index 24174730e2d3b..bbd9f9ad533aa 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/scroll/ScrollDataExtractor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/scroll/ScrollDataExtractor.java @@ -13,6 +13,7 @@ import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchScrollAction; +import org.elasticsearch.action.search.SearchScrollRequestBuilder; import org.elasticsearch.client.Client; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.unit.TimeValue; @@ -104,7 +105,7 @@ protected SearchResponse executeSearchRequest(SearchRequestBuilder searchRequest } private SearchRequestBuilder buildSearchRequest(long start) { - SearchRequestBuilder searchRequestBuilder = SearchAction.INSTANCE.newRequestBuilder(client) + SearchRequestBuilder searchRequestBuilder = new SearchRequestBuilder(client, SearchAction.INSTANCE) .setScroll(SCROLL_TIMEOUT) .addSort(context.extractedFields.timeField(), SortOrder.ASC) .setIndices(context.indices) @@ -212,7 +213,7 @@ private void markScrollAsErrored() { protected SearchResponse executeSearchScrollRequest(String scrollId) { return ClientHelper.executeWithHeaders(context.headers, ClientHelper.ML_ORIGIN, client, - () -> SearchScrollAction.INSTANCE.newRequestBuilder(client) + () -> new SearchScrollRequestBuilder(client, SearchScrollAction.INSTANCE) .setScroll(SCROLL_TIMEOUT) .setScrollId(scrollId) .get()); diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenAction.java index e2cfb44a2580d..b6a443e990a49 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenAction.java @@ -72,7 +72,7 @@ public String getName() { protected RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client)throws IOException { try (XContentParser parser = request.contentParser()) { final CreateTokenRequest tokenRequest = PARSER.parse(parser, null); - final Action action = + final Action action = "refresh_token".equals(tokenRequest.getGrantType()) ? RefreshTokenAction.INSTANCE : CreateTokenAction.INSTANCE; return channel -> client.execute(action, tokenRequest, // this doesn't use the RestBuilderListener since we need to override the diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/saml/TransportSamlInvalidateSessionActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/saml/TransportSamlInvalidateSessionActionTests.java index 09a48a0eb1370..15361d997a161 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/saml/TransportSamlInvalidateSessionActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/saml/TransportSamlInvalidateSessionActionTests.java @@ -126,8 +126,8 @@ public void setup() throws Exception { @Override protected > - void doExecute(Action action, Request request, ActionListener listener) { + RequestBuilder extends ActionRequestBuilder> + void doExecute(Action action, Request request, ActionListener listener) { if (IndexAction.NAME.equals(action.name())) { assertThat(request, instanceOf(IndexRequest.class)); IndexRequest indexRequest = (IndexRequest) request; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailMutedTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailMutedTests.java index 33ba5741e087e..1a5adc2e5ef44 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailMutedTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailMutedTests.java @@ -71,8 +71,8 @@ class IClient extends FilterClient { @Override protected > void doExecute( - Action action, Request request, ActionListener listener) { + ActionRequestBuilder> void doExecute( + Action action, Request request, ActionListener listener) { clientCalled.set(true); } } diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStoreTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStoreTests.java index 59244bbc50975..ee570dcadda31 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStoreTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStoreTests.java @@ -75,9 +75,9 @@ public void setupMocks() { protected < Request extends ActionRequest, Response extends ActionResponse, - RequestBuilder extends ActionRequestBuilder + RequestBuilder extends ActionRequestBuilder > void doExecute( - Action action, + Action action, Request request, ActionListener listener) { requests.add(new Tuple<>(request, listener)); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/support/SecurityIndexManagerTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/support/SecurityIndexManagerTests.java index b5b67c7e7b2c1..7754d387f1527 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/support/SecurityIndexManagerTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/support/SecurityIndexManagerTests.java @@ -66,7 +66,7 @@ public class SecurityIndexManagerTests extends ESTestCase { public static final String INDEX_NAME = ".security"; private static final String TEMPLATE_NAME = "SecurityIndexManagerTests-template"; private SecurityIndexManager manager; - private Map, Map>> actions; + private Map, Map>> actions; @Before public void setUpManager() { @@ -82,8 +82,8 @@ public void setUpManager() { @Override protected > - void doExecute(Action action, Request request, + RequestBuilder extends ActionRequestBuilder> + void doExecute(Action action, Request request, ActionListener listener) { final Map> map = actions.getOrDefault(action, new HashMap<>()); map.put(request, listener); diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorAction.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorAction.java index f0b91640f981f..2c6daf2c4aef5 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorAction.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorAction.java @@ -6,10 +6,8 @@ package org.elasticsearch.xpack.sql.plugin; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class SqlClearCursorAction - extends Action { +public class SqlClearCursorAction extends Action { public static final SqlClearCursorAction INSTANCE = new SqlClearCursorAction(); public static final String NAME = "indices:data/read/sql/close_cursor"; @@ -18,11 +16,6 @@ private SqlClearCursorAction() { super(NAME); } - @Override - public SqlClearCursorRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SqlClearCursorRequestBuilder(client, this); - } - @Override public SqlClearCursorResponse newResponse() { return new SqlClearCursorResponse(); diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorRequestBuilder.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorRequestBuilder.java index 0767f02587c31..b7a1f383a2f8b 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorRequestBuilder.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorRequestBuilder.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ElasticsearchClient; public class SqlClearCursorRequestBuilder extends - ActionRequestBuilder { + ActionRequestBuilder { public SqlClearCursorRequestBuilder(ElasticsearchClient client, SqlClearCursorAction action) { super(client, action, new SqlClearCursorRequest()); diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryAction.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryAction.java index cbcf626adad55..82b233968d981 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryAction.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryAction.java @@ -6,9 +6,8 @@ package org.elasticsearch.xpack.sql.plugin; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class SqlQueryAction extends Action { +public class SqlQueryAction extends Action { public static final SqlQueryAction INSTANCE = new SqlQueryAction(); public static final String NAME = "indices:data/read/sql"; @@ -17,11 +16,6 @@ private SqlQueryAction() { super(NAME); } - @Override - public SqlQueryRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SqlQueryRequestBuilder(client, this); - } - @Override public SqlQueryResponse newResponse() { return new SqlQueryResponse(); diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryRequestBuilder.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryRequestBuilder.java index 1eddd09d89d35..812b72473ad14 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryRequestBuilder.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryRequestBuilder.java @@ -20,7 +20,7 @@ /** * The builder to build sql request */ -public class SqlQueryRequestBuilder extends ActionRequestBuilder { +public class SqlQueryRequestBuilder extends ActionRequestBuilder { public SqlQueryRequestBuilder(ElasticsearchClient client, SqlQueryAction action) { this(client, action, "", Collections.emptyList(), null, Protocol.TIME_ZONE, Protocol.FETCH_SIZE, Protocol.REQUEST_TIMEOUT, diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateAction.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateAction.java index 9bfee2d1c3433..3d44d26264eb3 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateAction.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateAction.java @@ -6,12 +6,11 @@ package org.elasticsearch.xpack.sql.plugin; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; /** * Sql action for translating SQL queries into ES requests */ -public class SqlTranslateAction extends Action { +public class SqlTranslateAction extends Action { public static final SqlTranslateAction INSTANCE = new SqlTranslateAction(); public static final String NAME = "indices:data/read/sql/translate"; @@ -20,11 +19,6 @@ private SqlTranslateAction() { super(NAME); } - @Override - public SqlTranslateRequestBuilder newRequestBuilder(ElasticsearchClient client) { - return new SqlTranslateRequestBuilder(client, this); - } - @Override public SqlTranslateResponse newResponse() { return new SqlTranslateResponse(); diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateRequestBuilder.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateRequestBuilder.java index d6d97c19297de..9b9b00ebde9f1 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateRequestBuilder.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateRequestBuilder.java @@ -20,8 +20,7 @@ /** * Builder for the request for the sql action for translating SQL queries into ES requests */ -public class SqlTranslateRequestBuilder extends ActionRequestBuilder { +public class SqlTranslateRequestBuilder extends ActionRequestBuilder { public SqlTranslateRequestBuilder(ElasticsearchClient client, SqlTranslateAction action) { this(client, action, Mode.PLAIN, null, null, Collections.emptyList(), Protocol.TIME_ZONE, Protocol.FETCH_SIZE, Protocol.REQUEST_TIMEOUT, Protocol.PAGE_TIMEOUT); diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlActionIT.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlActionIT.java index 22a7889f6247e..ef90e8ccd470e 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlActionIT.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlActionIT.java @@ -7,6 +7,7 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.WriteRequest; +import org.elasticsearch.xpack.sql.plugin.SqlQueryRequestBuilder; import org.elasticsearch.xpack.sql.proto.ColumnInfo; import org.elasticsearch.xpack.sql.plugin.SqlQueryAction; import org.elasticsearch.xpack.sql.plugin.SqlQueryResponse; @@ -31,7 +32,7 @@ public void testSqlAction() throws Exception { boolean dataBeforeCount = randomBoolean(); String columns = dataBeforeCount ? "data, count" : "count, data"; - SqlQueryResponse response = client().prepareExecute(SqlQueryAction.INSTANCE) + SqlQueryResponse response = new SqlQueryRequestBuilder(client(), SqlQueryAction.INSTANCE) .query("SELECT " + columns + " FROM test ORDER BY count").mode(Mode.JDBC).get(); assertThat(response.size(), equalTo(2L)); assertThat(response.columns(), hasSize(2)); diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorActionIT.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorActionIT.java index 7b747ffeb6727..643372a21fe0a 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorActionIT.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorActionIT.java @@ -9,8 +9,10 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.xpack.sql.plugin.SqlClearCursorAction; +import org.elasticsearch.xpack.sql.plugin.SqlClearCursorRequestBuilder; import org.elasticsearch.xpack.sql.plugin.SqlClearCursorResponse; import org.elasticsearch.xpack.sql.plugin.SqlQueryAction; +import org.elasticsearch.xpack.sql.plugin.SqlQueryRequestBuilder; import org.elasticsearch.xpack.sql.plugin.SqlQueryResponse; import org.elasticsearch.xpack.sql.session.Cursor; @@ -37,7 +39,7 @@ public void testSqlClearCursorAction() throws Exception { int fetchSize = randomIntBetween(5, 20); logger.info("Fetching {} records at a time", fetchSize); - SqlQueryResponse sqlQueryResponse = client().prepareExecute(SqlQueryAction.INSTANCE) + SqlQueryResponse sqlQueryResponse = new SqlQueryRequestBuilder(client(), SqlQueryAction.INSTANCE) .query("SELECT * FROM test").fetchSize(fetchSize).get(); assertEquals(fetchSize, sqlQueryResponse.size()); @@ -45,7 +47,7 @@ public void testSqlClearCursorAction() throws Exception { assertThat(sqlQueryResponse.cursor(), notNullValue()); assertThat(sqlQueryResponse.cursor(), not(equalTo(Cursor.EMPTY))); - SqlClearCursorResponse cleanCursorResponse = client().prepareExecute(SqlClearCursorAction.INSTANCE) + SqlClearCursorResponse cleanCursorResponse = new SqlClearCursorRequestBuilder(client(), SqlClearCursorAction.INSTANCE) .cursor(sqlQueryResponse.cursor()).get(); assertTrue(cleanCursorResponse.isSucceeded()); @@ -67,7 +69,7 @@ public void testAutoCursorCleanup() throws Exception { int fetchSize = randomIntBetween(5, 20); logger.info("Fetching {} records at a time", fetchSize); - SqlQueryResponse sqlQueryResponse = client().prepareExecute(SqlQueryAction.INSTANCE) + SqlQueryResponse sqlQueryResponse = new SqlQueryRequestBuilder(client(), SqlQueryAction.INSTANCE) .query("SELECT * FROM test").fetchSize(fetchSize).get(); assertEquals(fetchSize, sqlQueryResponse.size()); @@ -77,12 +79,12 @@ public void testAutoCursorCleanup() throws Exception { long fetched = sqlQueryResponse.size(); do { - sqlQueryResponse = client().prepareExecute(SqlQueryAction.INSTANCE).cursor(sqlQueryResponse.cursor()).get(); + sqlQueryResponse = new SqlQueryRequestBuilder(client(), SqlQueryAction.INSTANCE).cursor(sqlQueryResponse.cursor()).get(); fetched += sqlQueryResponse.size(); } while (sqlQueryResponse.cursor().equals("") == false); assertEquals(indexSize, fetched); - SqlClearCursorResponse cleanCursorResponse = client().prepareExecute(SqlClearCursorAction.INSTANCE) + SqlClearCursorResponse cleanCursorResponse = new SqlClearCursorRequestBuilder(client(), SqlClearCursorAction.INSTANCE) .cursor(sqlQueryResponse.cursor()).get(); assertFalse(cleanCursorResponse.isSucceeded()); diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlDisabledIT.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlDisabledIT.java index a9fc420a8353b..395a2b673f946 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlDisabledIT.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlDisabledIT.java @@ -8,6 +8,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.sql.plugin.SqlQueryAction; +import org.elasticsearch.xpack.sql.plugin.SqlQueryRequestBuilder; import static org.hamcrest.CoreMatchers.either; import static org.hamcrest.CoreMatchers.startsWith; @@ -32,7 +33,7 @@ protected Settings transportClientSettings() { public void testSqlAction() throws Exception { Throwable throwable = expectThrows(Throwable.class, - () -> client().prepareExecute(SqlQueryAction.INSTANCE).query("SHOW tables").get()); + () -> new SqlQueryRequestBuilder(client(), SqlQueryAction.INSTANCE).query("SHOW tables").get()); assertThat(throwable.getMessage(), either(startsWith("no proxy found for action")) // disabled on client .or(startsWith("failed to find action")) // disabled on proxy client diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlLicenseIT.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlLicenseIT.java index 8988f70672ac6..27597c93fd0ee 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlLicenseIT.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlLicenseIT.java @@ -21,8 +21,10 @@ import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; import org.elasticsearch.transport.Netty4Plugin; import org.elasticsearch.xpack.sql.plugin.SqlQueryAction; +import org.elasticsearch.xpack.sql.plugin.SqlQueryRequestBuilder; import org.elasticsearch.xpack.sql.plugin.SqlQueryResponse; import org.elasticsearch.xpack.sql.plugin.SqlTranslateAction; +import org.elasticsearch.xpack.sql.plugin.SqlTranslateRequestBuilder; import org.elasticsearch.xpack.sql.plugin.SqlTranslateResponse; import org.hamcrest.Matchers; import org.junit.Before; @@ -118,11 +120,11 @@ public void testSqlQueryActionLicense() throws Exception { disableSqlLicensing(); ElasticsearchSecurityException e = expectThrows(ElasticsearchSecurityException.class, - () -> client().prepareExecute(SqlQueryAction.INSTANCE).query("SELECT * FROM test").get()); + () -> new SqlQueryRequestBuilder(client(), SqlQueryAction.INSTANCE).query("SELECT * FROM test").get()); assertThat(e.getMessage(), equalTo("current license is non-compliant for [sql]")); enableSqlLicensing(); - SqlQueryResponse response = client().prepareExecute(SqlQueryAction.INSTANCE).query("SELECT * FROM test").get(); + SqlQueryResponse response = new SqlQueryRequestBuilder(client(), SqlQueryAction.INSTANCE).query("SELECT * FROM test").get(); assertThat(response.size(), Matchers.equalTo(2L)); } @@ -132,11 +134,12 @@ public void testSqlQueryActionJdbcModeLicense() throws Exception { disableJdbcLicensing(); ElasticsearchSecurityException e = expectThrows(ElasticsearchSecurityException.class, - () -> client().prepareExecute(SqlQueryAction.INSTANCE).query("SELECT * FROM test").mode("jdbc").get()); + () -> new SqlQueryRequestBuilder(client(), SqlQueryAction.INSTANCE).query("SELECT * FROM test").mode("jdbc").get()); assertThat(e.getMessage(), equalTo("current license is non-compliant for [jdbc]")); enableJdbcLicensing(); - SqlQueryResponse response = client().prepareExecute(SqlQueryAction.INSTANCE).query("SELECT * FROM test").mode("jdbc").get(); + SqlQueryResponse response = new SqlQueryRequestBuilder(client(), SqlQueryAction.INSTANCE) + .query("SELECT * FROM test").mode("jdbc").get(); assertThat(response.size(), Matchers.equalTo(2L)); } @@ -145,11 +148,12 @@ public void testSqlTranslateActionLicense() throws Exception { disableSqlLicensing(); ElasticsearchSecurityException e = expectThrows(ElasticsearchSecurityException.class, - () -> client().prepareExecute(SqlTranslateAction.INSTANCE).query("SELECT * FROM test").get()); + () -> new SqlTranslateRequestBuilder(client(), SqlTranslateAction.INSTANCE).query("SELECT * FROM test").get()); assertThat(e.getMessage(), equalTo("current license is non-compliant for [sql]")); enableSqlLicensing(); - SqlTranslateResponse response = client().prepareExecute(SqlTranslateAction.INSTANCE).query("SELECT * FROM test").get(); + SqlTranslateResponse response = new SqlTranslateRequestBuilder(client(), SqlTranslateAction.INSTANCE) + .query("SELECT * FROM test").get(); SearchSourceBuilder source = response.source(); assertThat(source.docValueFields(), Matchers.contains( new DocValueFieldsContext.FieldAndFormat("count", DocValueFieldsContext.USE_DEFAULT_FORMAT))); diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateActionIT.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateActionIT.java index a4c440eb9dfad..2ef7c084d110d 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateActionIT.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateActionIT.java @@ -12,6 +12,7 @@ import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.search.sort.SortBuilders; import org.elasticsearch.xpack.sql.plugin.SqlTranslateAction; +import org.elasticsearch.xpack.sql.plugin.SqlTranslateRequestBuilder; import org.elasticsearch.xpack.sql.plugin.SqlTranslateResponse; import static java.util.Collections.singletonList; @@ -30,7 +31,7 @@ public void testSqlTranslateAction() throws Exception { boolean columnOrder = randomBoolean(); String columns = columnOrder ? "data, count" : "count, data"; - SqlTranslateResponse response = client().prepareExecute(SqlTranslateAction.INSTANCE) + SqlTranslateResponse response = new SqlTranslateRequestBuilder(client(), SqlTranslateAction.INSTANCE) .query("SELECT " + columns + " FROM test ORDER BY count").get(); SearchSourceBuilder source = response.source(); FetchSourceContext fetch = source.fetchSource(); diff --git a/x-pack/plugin/upgrade/src/test/java/org/elasticsearch/xpack/upgrade/IndexUpgradeIT.java b/x-pack/plugin/upgrade/src/test/java/org/elasticsearch/xpack/upgrade/IndexUpgradeIT.java index ef5c3acc3d238..870261d251546 100644 --- a/x-pack/plugin/upgrade/src/test/java/org/elasticsearch/xpack/upgrade/IndexUpgradeIT.java +++ b/x-pack/plugin/upgrade/src/test/java/org/elasticsearch/xpack/upgrade/IndexUpgradeIT.java @@ -41,7 +41,7 @@ public void testIndexUpgradeInfo() { // Testing only negative case here, the positive test is done in bwcTests assertAcked(client().admin().indices().prepareCreate("test").get()); ensureYellow("test"); - Response response = client().prepareExecute(IndexUpgradeInfoAction.INSTANCE).setIndices("test").get(); + Response response = new IndexUpgradeInfoAction.RequestBuilder(client()).setIndices("test").get(); assertThat(response.getActions().entrySet(), empty()); } @@ -54,10 +54,10 @@ public void testIndexUpgradeInfoLicense() throws Exception { ensureYellow("test"); disableLicensing(); ElasticsearchSecurityException e = expectThrows(ElasticsearchSecurityException.class, - () -> client().prepareExecute(IndexUpgradeInfoAction.INSTANCE).setIndices("test").get()); + () -> new IndexUpgradeInfoAction.RequestBuilder(client()).setIndices("test").get()); assertThat(e.getMessage(), equalTo("current license is non-compliant for [upgrade]")); enableLicensing(); - Response response = client().prepareExecute(IndexUpgradeInfoAction.INSTANCE).setIndices("test").get(); + Response response = new IndexUpgradeInfoAction.RequestBuilder(client()).setIndices("test").get(); assertThat(response.getActions().entrySet(), empty()); } @@ -73,7 +73,7 @@ public void testUpToDateIndexUpgrade() throws Exception { ensureYellow(testIndex); IllegalStateException ex = expectThrows(IllegalStateException.class, - () -> client().prepareExecute(IndexUpgradeAction.INSTANCE).setIndex(testIndex).get()); + () -> new IndexUpgradeAction.RequestBuilder(client()).setIndex(testIndex).get()); assertThat(ex.getMessage(), equalTo("Index [" + testIndex + "] cannot be upgraded")); SearchResponse searchResponse = client().prepareSearch(testIndex).get(); @@ -132,10 +132,10 @@ public void testInternalUpgradePrePostChecks() throws Exception { public void testIndexUpgradeInfoOnEmptyCluster() { // On empty cluster asking for all indices shouldn't fail since no indices means nothing needs to be upgraded - Response response = client().prepareExecute(IndexUpgradeInfoAction.INSTANCE).setIndices("_all").get(); + Response response = new IndexUpgradeInfoAction.RequestBuilder(client()).setIndices("_all").get(); assertThat(response.getActions().entrySet(), empty()); // but calling on a particular index should fail - assertThrows(client().prepareExecute(IndexUpgradeInfoAction.INSTANCE).setIndices("test"), IndexNotFoundException.class); + assertThrows(new IndexUpgradeInfoAction.RequestBuilder(client()).setIndices("test"), IndexNotFoundException.class); } } diff --git a/x-pack/plugin/upgrade/src/test/java/org/elasticsearch/xpack/upgrade/IndexUpgradeTasksIT.java b/x-pack/plugin/upgrade/src/test/java/org/elasticsearch/xpack/upgrade/IndexUpgradeTasksIT.java index c3f371a74b71d..abc157119b4cf 100644 --- a/x-pack/plugin/upgrade/src/test/java/org/elasticsearch/xpack/upgrade/IndexUpgradeTasksIT.java +++ b/x-pack/plugin/upgrade/src/test/java/org/elasticsearch/xpack/upgrade/IndexUpgradeTasksIT.java @@ -171,13 +171,12 @@ public void testParentTasksDuringUpgrade() throws Exception { ensureYellow("test"); - IndexUpgradeInfoAction.Response infoResponse = client().prepareExecute(IndexUpgradeInfoAction.INSTANCE).setIndices("test").get(); + IndexUpgradeInfoAction.Response infoResponse = new IndexUpgradeInfoAction.RequestBuilder(client()).setIndices("test").get(); assertThat(infoResponse.getActions().keySet(), contains("test")); assertThat(infoResponse.getActions().get("test"), equalTo(UpgradeActionRequired.UPGRADE)); - ActionFuture upgradeResponse = - client().prepareExecute(IndexUpgradeAction.INSTANCE).setIndex("test").execute(); + ActionFuture upgradeResponse = new IndexUpgradeAction.RequestBuilder(client()).setIndex("test").execute(); assertThat(mockUpgradePlugin.upgradeCalledLatch.await(10, TimeUnit.SECONDS), equalTo(true)); diff --git a/x-pack/qa/reindex-tests-with-security/src/test/java/org/elasticsearch/xpack/security/ReindexWithSecurityIT.java b/x-pack/qa/reindex-tests-with-security/src/test/java/org/elasticsearch/xpack/security/ReindexWithSecurityIT.java index d21900ba47a5b..bcea8338515fa 100644 --- a/x-pack/qa/reindex-tests-with-security/src/test/java/org/elasticsearch/xpack/security/ReindexWithSecurityIT.java +++ b/x-pack/qa/reindex-tests-with-security/src/test/java/org/elasticsearch/xpack/security/ReindexWithSecurityIT.java @@ -13,8 +13,11 @@ import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.reindex.DeleteByQueryAction; +import org.elasticsearch.index.reindex.DeleteByQueryRequestBuilder; import org.elasticsearch.index.reindex.ReindexAction; +import org.elasticsearch.index.reindex.ReindexRequestBuilder; import org.elasticsearch.index.reindex.UpdateByQueryAction; +import org.elasticsearch.index.reindex.UpdateByQueryRequestBuilder; import org.elasticsearch.test.SecurityIntegTestCase; import org.elasticsearch.xpack.core.security.SecurityField; @@ -45,20 +48,20 @@ public void doAssertXPackIsInstalled() { public void testDeleteByQuery() { createIndicesWithRandomAliases("test1", "test2", "test3"); - BulkByScrollResponse response = DeleteByQueryAction.INSTANCE.newRequestBuilder(client()) + BulkByScrollResponse response = new DeleteByQueryRequestBuilder(client(), DeleteByQueryAction.INSTANCE) .source("test1", "test2") .filter(QueryBuilders.matchAllQuery()) .get(); assertNotNull(response); - response = DeleteByQueryAction.INSTANCE.newRequestBuilder(client()) + response = new DeleteByQueryRequestBuilder(client(), DeleteByQueryAction.INSTANCE) .source("test*") .filter(QueryBuilders.matchAllQuery()) .get(); assertNotNull(response); IndexNotFoundException e = expectThrows(IndexNotFoundException.class, - () -> DeleteByQueryAction.INSTANCE.newRequestBuilder(client()) + () -> new DeleteByQueryRequestBuilder(client(), DeleteByQueryAction.INSTANCE) .source("test1", "index1") .filter(QueryBuilders.matchAllQuery()) .get()); @@ -68,29 +71,30 @@ public void testDeleteByQuery() { public void testUpdateByQuery() { createIndicesWithRandomAliases("test1", "test2", "test3"); - BulkByScrollResponse response = UpdateByQueryAction.INSTANCE.newRequestBuilder(client()).source("test1", "test2").get(); + BulkByScrollResponse response = new UpdateByQueryRequestBuilder(client(), UpdateByQueryAction.INSTANCE) + .source("test1", "test2").get(); assertNotNull(response); - response = UpdateByQueryAction.INSTANCE.newRequestBuilder(client()).source("test*").get(); + response = new UpdateByQueryRequestBuilder(client(), UpdateByQueryAction.INSTANCE).source("test*").get(); assertNotNull(response); IndexNotFoundException e = expectThrows(IndexNotFoundException.class, - () -> UpdateByQueryAction.INSTANCE.newRequestBuilder(client()).source("test1", "index1").get()); + () -> new UpdateByQueryRequestBuilder(client(), UpdateByQueryAction.INSTANCE).source("test1", "index1").get()); assertEquals("no such index", e.getMessage()); } public void testReindex() { createIndicesWithRandomAliases("test1", "test2", "test3", "dest"); - BulkByScrollResponse response = ReindexAction.INSTANCE.newRequestBuilder(client()).source("test1", "test2") + BulkByScrollResponse response = new ReindexRequestBuilder(client(), ReindexAction.INSTANCE).source("test1", "test2") .destination("dest").get(); assertNotNull(response); - response = ReindexAction.INSTANCE.newRequestBuilder(client()).source("test*").destination("dest").get(); + response = new ReindexRequestBuilder(client(), ReindexAction.INSTANCE).source("test*").destination("dest").get(); assertNotNull(response); IndexNotFoundException e = expectThrows(IndexNotFoundException.class, - () -> ReindexAction.INSTANCE.newRequestBuilder(client()).source("test1", "index1").destination("dest").get()); + () -> new ReindexRequestBuilder(client(), ReindexAction.INSTANCE).source("test1", "index1").destination("dest").get()); assertEquals("no such index", e.getMessage()); } } diff --git a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/30_ml_jobs_crud.yml b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/30_ml_jobs_crud.yml index 4458b51744802..daf2f913fff0a 100644 --- a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/30_ml_jobs_crud.yml +++ b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/30_ml_jobs_crud.yml @@ -7,6 +7,9 @@ setup: --- "Test get old cluster job": + - skip: + version: "all" + reason: "@AwaitsFix: https://github.com/elastic/elasticsearch/issues/30982" - do: xpack.ml.get_jobs: job_id: old-cluster-job