From 0c8377a0bd9f5bd37754a11f8dd484fc8dc83fb3 Mon Sep 17 00:00:00 2001 From: jaymode Date: Fri, 25 Sep 2015 09:13:01 -0400 Subject: [PATCH] rename the RenderSearchTemplateAction to be a cluster level action The RenderSearchTemplateAction is currently a "indices" action, but the action does not really apply to indices, it is more of a general action that is used to validate the search template. With our current categorization of actions, `cluster:` and `indices:`, `cluster:` is a more appropriate type as this action is not associated with indices. The classes are also moved to a cluster package. --- .../main/java/org/elasticsearch/action/ActionModule.java | 4 ++-- .../validate/template/RenderSearchTemplateAction.java | 4 ++-- .../validate/template/RenderSearchTemplateRequest.java | 2 +- .../template/RenderSearchTemplateRequestBuilder.java | 2 +- .../validate/template/RenderSearchTemplateResponse.java | 2 +- .../template/TransportRenderSearchTemplateAction.java | 2 +- core/src/main/java/org/elasticsearch/client/Client.java | 3 --- .../java/org/elasticsearch/client/IndicesAdminClient.java | 6 +++--- .../org/elasticsearch/client/support/AbstractClient.java | 8 ++++---- .../validate/template/RestRenderSearchTemplateAction.java | 4 ++-- .../elasticsearch/validate/RenderSearchTemplateIT.java | 2 +- 11 files changed, 18 insertions(+), 21 deletions(-) rename core/src/main/java/org/elasticsearch/action/admin/{indices => cluster}/validate/template/RenderSearchTemplateAction.java (92%) rename core/src/main/java/org/elasticsearch/action/admin/{indices => cluster}/validate/template/RenderSearchTemplateRequest.java (97%) rename core/src/main/java/org/elasticsearch/action/admin/{indices => cluster}/validate/template/RenderSearchTemplateRequestBuilder.java (96%) rename core/src/main/java/org/elasticsearch/action/admin/{indices => cluster}/validate/template/RenderSearchTemplateResponse.java (97%) rename core/src/main/java/org/elasticsearch/action/admin/{indices => cluster}/validate/template/TransportRenderSearchTemplateAction.java (97%) diff --git a/core/src/main/java/org/elasticsearch/action/ActionModule.java b/core/src/main/java/org/elasticsearch/action/ActionModule.java index cc41cc0ee8f..f8634b1c618 100644 --- a/core/src/main/java/org/elasticsearch/action/ActionModule.java +++ b/core/src/main/java/org/elasticsearch/action/ActionModule.java @@ -121,8 +121,8 @@ import org.elasticsearch.action.admin.indices.upgrade.post.UpgradeAction; import org.elasticsearch.action.admin.indices.upgrade.post.UpgradeSettingsAction; import org.elasticsearch.action.admin.indices.validate.query.TransportValidateQueryAction; import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryAction; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateAction; -import org.elasticsearch.action.admin.indices.validate.template.TransportRenderSearchTemplateAction; +import org.elasticsearch.action.admin.cluster.validate.template.RenderSearchTemplateAction; +import org.elasticsearch.action.admin.cluster.validate.template.TransportRenderSearchTemplateAction; import org.elasticsearch.action.admin.indices.warmer.delete.DeleteWarmerAction; import org.elasticsearch.action.admin.indices.warmer.delete.TransportDeleteWarmerAction; import org.elasticsearch.action.admin.indices.warmer.get.GetWarmersAction; diff --git a/core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/RenderSearchTemplateAction.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/RenderSearchTemplateAction.java similarity index 92% rename from core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/RenderSearchTemplateAction.java rename to core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/RenderSearchTemplateAction.java index 0cc71589576..427d0c4dc64 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/RenderSearchTemplateAction.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/RenderSearchTemplateAction.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.validate.template; +package org.elasticsearch.action.admin.cluster.validate.template; import org.elasticsearch.action.Action; import org.elasticsearch.client.ElasticsearchClient; @@ -25,7 +25,7 @@ import org.elasticsearch.client.ElasticsearchClient; public class RenderSearchTemplateAction extends Action { public static final RenderSearchTemplateAction INSTANCE = new RenderSearchTemplateAction(); - public static final String NAME = "indices:admin/render/template/search"; + public static final String NAME = "cluster:admin/render/template/search"; public RenderSearchTemplateAction() { super(NAME); diff --git a/core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/RenderSearchTemplateRequest.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/RenderSearchTemplateRequest.java similarity index 97% rename from core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/RenderSearchTemplateRequest.java rename to core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/RenderSearchTemplateRequest.java index bde255f2f7d..a51090e1402 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/RenderSearchTemplateRequest.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/RenderSearchTemplateRequest.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.validate.template; +package org.elasticsearch.action.admin.cluster.validate.template; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; diff --git a/core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/RenderSearchTemplateRequestBuilder.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/RenderSearchTemplateRequestBuilder.java similarity index 96% rename from core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/RenderSearchTemplateRequestBuilder.java rename to core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/RenderSearchTemplateRequestBuilder.java index 493dc7edc34..f7e3da111b2 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/RenderSearchTemplateRequestBuilder.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/RenderSearchTemplateRequestBuilder.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.validate.template; +package org.elasticsearch.action.admin.cluster.validate.template; import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; diff --git a/core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/RenderSearchTemplateResponse.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/RenderSearchTemplateResponse.java similarity index 97% rename from core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/RenderSearchTemplateResponse.java rename to core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/RenderSearchTemplateResponse.java index 2d3ca018ed2..d14a9a4f06a 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/RenderSearchTemplateResponse.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/RenderSearchTemplateResponse.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.validate.template; +package org.elasticsearch.action.admin.cluster.validate.template; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.bytes.BytesReference; diff --git a/core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/TransportRenderSearchTemplateAction.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/TransportRenderSearchTemplateAction.java similarity index 97% rename from core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/TransportRenderSearchTemplateAction.java rename to core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/TransportRenderSearchTemplateAction.java index e9208ecb02c..5fe8297a6ba 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/indices/validate/template/TransportRenderSearchTemplateAction.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/validate/template/TransportRenderSearchTemplateAction.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.validate.template; +package org.elasticsearch.action.admin.cluster.validate.template; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; diff --git a/core/src/main/java/org/elasticsearch/client/Client.java b/core/src/main/java/org/elasticsearch/client/Client.java index eafac2b6509..6e0b0b27fd9 100644 --- a/core/src/main/java/org/elasticsearch/client/Client.java +++ b/core/src/main/java/org/elasticsearch/client/Client.java @@ -21,9 +21,6 @@ package org.elasticsearch.client; import org.elasticsearch.action.ActionFuture; import org.elasticsearch.action.ActionListener; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateRequest; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateRequestBuilder; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateResponse; import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.bulk.BulkRequestBuilder; import org.elasticsearch.action.bulk.BulkResponse; diff --git a/core/src/main/java/org/elasticsearch/client/IndicesAdminClient.java b/core/src/main/java/org/elasticsearch/client/IndicesAdminClient.java index 755bf333e59..3915f9c57a8 100644 --- a/core/src/main/java/org/elasticsearch/client/IndicesAdminClient.java +++ b/core/src/main/java/org/elasticsearch/client/IndicesAdminClient.java @@ -105,9 +105,9 @@ import org.elasticsearch.action.admin.indices.upgrade.post.UpgradeResponse; import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryRequest; import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryRequestBuilder; import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryResponse; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateRequest; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateRequestBuilder; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateResponse; +import org.elasticsearch.action.admin.cluster.validate.template.RenderSearchTemplateRequest; +import org.elasticsearch.action.admin.cluster.validate.template.RenderSearchTemplateRequestBuilder; +import org.elasticsearch.action.admin.cluster.validate.template.RenderSearchTemplateResponse; import org.elasticsearch.action.admin.indices.warmer.delete.DeleteWarmerRequest; import org.elasticsearch.action.admin.indices.warmer.delete.DeleteWarmerRequestBuilder; import org.elasticsearch.action.admin.indices.warmer.delete.DeleteWarmerResponse; diff --git a/core/src/main/java/org/elasticsearch/client/support/AbstractClient.java b/core/src/main/java/org/elasticsearch/client/support/AbstractClient.java index f9abf2f0437..4e6c6c38172 100644 --- a/core/src/main/java/org/elasticsearch/client/support/AbstractClient.java +++ b/core/src/main/java/org/elasticsearch/client/support/AbstractClient.java @@ -208,10 +208,10 @@ import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryAction import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryRequest; import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryRequestBuilder; import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryResponse; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateAction; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateRequest; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateRequestBuilder; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateResponse; +import org.elasticsearch.action.admin.cluster.validate.template.RenderSearchTemplateAction; +import org.elasticsearch.action.admin.cluster.validate.template.RenderSearchTemplateRequest; +import org.elasticsearch.action.admin.cluster.validate.template.RenderSearchTemplateRequestBuilder; +import org.elasticsearch.action.admin.cluster.validate.template.RenderSearchTemplateResponse; import org.elasticsearch.action.admin.indices.warmer.delete.DeleteWarmerAction; import org.elasticsearch.action.admin.indices.warmer.delete.DeleteWarmerRequest; import org.elasticsearch.action.admin.indices.warmer.delete.DeleteWarmerRequestBuilder; diff --git a/core/src/main/java/org/elasticsearch/rest/action/admin/indices/validate/template/RestRenderSearchTemplateAction.java b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/validate/template/RestRenderSearchTemplateAction.java index 7e75dc17cf1..fe808d6fc2a 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/admin/indices/validate/template/RestRenderSearchTemplateAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/validate/template/RestRenderSearchTemplateAction.java @@ -20,8 +20,8 @@ package org.elasticsearch.rest.action.admin.indices.validate.template; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateRequest; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateResponse; +import org.elasticsearch.action.admin.cluster.validate.template.RenderSearchTemplateRequest; +import org.elasticsearch.action.admin.cluster.validate.template.RenderSearchTemplateResponse; import org.elasticsearch.client.Client; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.inject.Inject; diff --git a/core/src/test/java/org/elasticsearch/validate/RenderSearchTemplateIT.java b/core/src/test/java/org/elasticsearch/validate/RenderSearchTemplateIT.java index b22dff7c761..1160c67476a 100644 --- a/core/src/test/java/org/elasticsearch/validate/RenderSearchTemplateIT.java +++ b/core/src/test/java/org/elasticsearch/validate/RenderSearchTemplateIT.java @@ -19,7 +19,7 @@ package org.elasticsearch.validate; -import org.elasticsearch.action.admin.indices.validate.template.RenderSearchTemplateResponse; +import org.elasticsearch.action.admin.cluster.validate.template.RenderSearchTemplateResponse; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings;