From 470b685fa973548ffa919b0de6670a62ac73a097 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 15 Jul 2013 14:55:46 +0200 Subject: [PATCH] Renamed IndicesGetAliases* classes to begin with GetAliases* --- .../elasticsearch/action/ActionModule.java | 6 ++--- .../alias/exists/AliasesExistAction.java | 4 ++-- .../exists/AliasesExistRequestBuilder.java | 4 ++-- .../exists/TransportAliasesExistAction.java | 10 ++++---- ...er.java => BaseAliasesRequestBuilder.java} | 6 ++--- ...iasesAction.java => GetAliasesAction.java} | 14 +++++------ ...sesRequest.java => GetAliasesRequest.java} | 14 +++++------ ...der.java => GetAliasesRequestBuilder.java} | 6 ++--- ...sResponse.java => GetAliasesResponse.java} | 6 ++--- ...on.java => TransportGetAliasesAction.java} | 18 +++++++------- .../client/IndicesAdminClient.java | 16 ++++++------- .../support/AbstractIndicesAdminClient.java | 24 +++++++++---------- .../rest/action/RestActionModule.java | 4 ++-- ...sAction.java => RestGetAliasesAction.java} | 14 +++++------ .../alias/head/RestAliasesExistAction.java | 4 ++-- .../aliases/IndexAliasesTests.java | 4 ++-- 16 files changed, 77 insertions(+), 77 deletions(-) rename src/main/java/org/elasticsearch/action/admin/indices/alias/get/{BaseIndicesAliasesRequestBuilder.java => BaseAliasesRequestBuilder.java} (81%) rename src/main/java/org/elasticsearch/action/admin/indices/alias/get/{IndicesGetAliasesAction.java => GetAliasesAction.java} (68%) rename src/main/java/org/elasticsearch/action/admin/indices/alias/get/{IndicesGetAliasesRequest.java => GetAliasesRequest.java} (85%) rename src/main/java/org/elasticsearch/action/admin/indices/alias/get/{IndicesGetAliasesRequestBuilder.java => GetAliasesRequestBuilder.java} (77%) rename src/main/java/org/elasticsearch/action/admin/indices/alias/get/{IndicesGetAliasesResponse.java => GetAliasesResponse.java} (93%) rename src/main/java/org/elasticsearch/action/admin/indices/alias/get/{TransportIndicesGetAliasesAction.java => TransportGetAliasesAction.java} (75%) rename src/main/java/org/elasticsearch/rest/action/admin/indices/alias/get/{RestIndicesGetAliasesAction.java => RestGetAliasesAction.java} (87%) diff --git a/src/main/java/org/elasticsearch/action/ActionModule.java b/src/main/java/org/elasticsearch/action/ActionModule.java index 5ab2c177d99..93e7c333dd1 100644 --- a/src/main/java/org/elasticsearch/action/ActionModule.java +++ b/src/main/java/org/elasticsearch/action/ActionModule.java @@ -44,8 +44,8 @@ import org.elasticsearch.action.admin.indices.alias.IndicesAliasesAction; import org.elasticsearch.action.admin.indices.alias.TransportIndicesAliasesAction; import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistAction; import org.elasticsearch.action.admin.indices.alias.exists.TransportAliasesExistAction; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesAction; -import org.elasticsearch.action.admin.indices.alias.get.TransportIndicesGetAliasesAction; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesAction; +import org.elasticsearch.action.admin.indices.alias.get.TransportGetAliasesAction; import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction; import org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction; import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheAction; @@ -213,7 +213,7 @@ public class ActionModule extends AbstractModule { registerAction(PutWarmerAction.INSTANCE, TransportPutWarmerAction.class); registerAction(DeleteWarmerAction.INSTANCE, TransportDeleteWarmerAction.class); registerAction(GetWarmersAction.INSTANCE, TransportGetWarmersAction.class); - registerAction(IndicesGetAliasesAction.INSTANCE, TransportIndicesGetAliasesAction.class); + registerAction(GetAliasesAction.INSTANCE, TransportGetAliasesAction.class); registerAction(AliasesExistAction.INSTANCE, TransportAliasesExistAction.class); registerAction(IndexAction.INSTANCE, TransportIndexAction.class); diff --git a/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/AliasesExistAction.java b/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/AliasesExistAction.java index d75e5484b06..89e7d851690 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/AliasesExistAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/AliasesExistAction.java @@ -20,12 +20,12 @@ package org.elasticsearch.action.admin.indices.alias.exists; import org.elasticsearch.action.admin.indices.IndicesAction; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesRequest; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest; import org.elasticsearch.client.IndicesAdminClient; /** */ -public class AliasesExistAction extends IndicesAction { +public class AliasesExistAction extends IndicesAction { public static final AliasesExistAction INSTANCE = new AliasesExistAction(); public static final String NAME = "indices/exists/aliases"; diff --git a/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/AliasesExistRequestBuilder.java b/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/AliasesExistRequestBuilder.java index 2ea231cf653..76349fdfc68 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/AliasesExistRequestBuilder.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/AliasesExistRequestBuilder.java @@ -20,12 +20,12 @@ package org.elasticsearch.action.admin.indices.alias.exists; import org.elasticsearch.action.ActionListener; -import org.elasticsearch.action.admin.indices.alias.get.BaseIndicesAliasesRequestBuilder; +import org.elasticsearch.action.admin.indices.alias.get.BaseAliasesRequestBuilder; import org.elasticsearch.client.IndicesAdminClient; /** */ -public class AliasesExistRequestBuilder extends BaseIndicesAliasesRequestBuilder { +public class AliasesExistRequestBuilder extends BaseAliasesRequestBuilder { public AliasesExistRequestBuilder(IndicesAdminClient client, String... aliases) { super(client, aliases); diff --git a/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/TransportAliasesExistAction.java b/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/TransportAliasesExistAction.java index e3e03f788a6..3d9817ccee2 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/TransportAliasesExistAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/alias/exists/TransportAliasesExistAction.java @@ -19,7 +19,7 @@ package org.elasticsearch.action.admin.indices.alias.exists; import org.elasticsearch.ElasticSearchException; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesRequest; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest; import org.elasticsearch.action.support.master.TransportMasterNodeOperationAction; import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.ClusterState; @@ -30,7 +30,7 @@ import org.elasticsearch.transport.TransportService; /** */ -public class TransportAliasesExistAction extends TransportMasterNodeOperationAction { +public class TransportAliasesExistAction extends TransportMasterNodeOperationAction { @Inject public TransportAliasesExistAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool) { @@ -48,8 +48,8 @@ public class TransportAliasesExistAction extends TransportMasterNodeOperationAct } @Override - protected IndicesGetAliasesRequest newRequest() { - return new IndicesGetAliasesRequest(); + protected GetAliasesRequest newRequest() { + return new GetAliasesRequest(); } @Override @@ -58,7 +58,7 @@ public class TransportAliasesExistAction extends TransportMasterNodeOperationAct } @Override - protected AliasesExistResponse masterOperation(IndicesGetAliasesRequest request, ClusterState state) throws ElasticSearchException { + protected AliasesExistResponse masterOperation(GetAliasesRequest request, ClusterState state) throws ElasticSearchException { String[] concreteIndices = state.metaData().concreteIndices(request.indices(), request.ignoreIndices(), true); request.indices(concreteIndices); diff --git a/src/main/java/org/elasticsearch/action/admin/indices/alias/get/BaseIndicesAliasesRequestBuilder.java b/src/main/java/org/elasticsearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java similarity index 81% rename from src/main/java/org/elasticsearch/action/admin/indices/alias/get/BaseIndicesAliasesRequestBuilder.java rename to src/main/java/org/elasticsearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java index ee9d31fc3c7..e6f0872e595 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/alias/get/BaseIndicesAliasesRequestBuilder.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java @@ -27,10 +27,10 @@ import org.elasticsearch.client.internal.InternalIndicesAdminClient; /** */ -public abstract class BaseIndicesAliasesRequestBuilder> extends MasterNodeOperationRequestBuilder { +public abstract class BaseAliasesRequestBuilder> extends MasterNodeOperationRequestBuilder { - public BaseIndicesAliasesRequestBuilder(IndicesAdminClient client, String... aliases) { - super((InternalIndicesAdminClient) client, new IndicesGetAliasesRequest(aliases)); + public BaseAliasesRequestBuilder(IndicesAdminClient client, String... aliases) { + super((InternalIndicesAdminClient) client, new GetAliasesRequest(aliases)); } @SuppressWarnings("unchecked") diff --git a/src/main/java/org/elasticsearch/action/admin/indices/alias/get/IndicesGetAliasesAction.java b/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesAction.java similarity index 68% rename from src/main/java/org/elasticsearch/action/admin/indices/alias/get/IndicesGetAliasesAction.java rename to src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesAction.java index fec0f19203a..a278cfab3bb 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/alias/get/IndicesGetAliasesAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesAction.java @@ -24,22 +24,22 @@ import org.elasticsearch.client.IndicesAdminClient; /** */ -public class IndicesGetAliasesAction extends IndicesAction { +public class GetAliasesAction extends IndicesAction { - public static final IndicesGetAliasesAction INSTANCE = new IndicesGetAliasesAction(); + public static final GetAliasesAction INSTANCE = new GetAliasesAction(); public static final String NAME = "indices/get/aliases"; - private IndicesGetAliasesAction() { + private GetAliasesAction() { super(NAME); } @Override - public IndicesGetAliasesRequestBuilder newRequestBuilder(IndicesAdminClient client) { - return new IndicesGetAliasesRequestBuilder(client); + public GetAliasesRequestBuilder newRequestBuilder(IndicesAdminClient client) { + return new GetAliasesRequestBuilder(client); } @Override - public IndicesGetAliasesResponse newResponse() { - return new IndicesGetAliasesResponse(); + public GetAliasesResponse newResponse() { + return new GetAliasesResponse(); } } diff --git a/src/main/java/org/elasticsearch/action/admin/indices/alias/get/IndicesGetAliasesRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesRequest.java similarity index 85% rename from src/main/java/org/elasticsearch/action/admin/indices/alias/get/IndicesGetAliasesRequest.java rename to src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesRequest.java index dceb989c5cd..157df71033f 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/alias/get/IndicesGetAliasesRequest.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesRequest.java @@ -31,35 +31,35 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; /** */ -public class IndicesGetAliasesRequest extends MasterNodeOperationRequest { +public class GetAliasesRequest extends MasterNodeOperationRequest { private String[] indices = Strings.EMPTY_ARRAY; private String[] aliases = Strings.EMPTY_ARRAY; private IgnoreIndices ignoreIndices = IgnoreIndices.NONE; - public IndicesGetAliasesRequest(String[] aliases) { + public GetAliasesRequest(String[] aliases) { this.aliases = aliases; } - public IndicesGetAliasesRequest(String alias) { + public GetAliasesRequest(String alias) { this.aliases = new String[]{alias}; } - public IndicesGetAliasesRequest() { + public GetAliasesRequest() { } - public IndicesGetAliasesRequest indices(String... indices) { + public GetAliasesRequest indices(String... indices) { this.indices = indices; return this; } - public IndicesGetAliasesRequest aliases(String... aliases) { + public GetAliasesRequest aliases(String... aliases) { this.aliases = aliases; return this; } - public IndicesGetAliasesRequest ignoreIndices(IgnoreIndices ignoreIndices) { + public GetAliasesRequest ignoreIndices(IgnoreIndices ignoreIndices) { this.ignoreIndices = ignoreIndices; return this; } diff --git a/src/main/java/org/elasticsearch/action/admin/indices/alias/get/IndicesGetAliasesRequestBuilder.java b/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesRequestBuilder.java similarity index 77% rename from src/main/java/org/elasticsearch/action/admin/indices/alias/get/IndicesGetAliasesRequestBuilder.java rename to src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesRequestBuilder.java index 16c63f62ef0..38f7d26563d 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/alias/get/IndicesGetAliasesRequestBuilder.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesRequestBuilder.java @@ -24,14 +24,14 @@ import org.elasticsearch.client.IndicesAdminClient; /** */ -public class IndicesGetAliasesRequestBuilder extends BaseIndicesAliasesRequestBuilder { +public class GetAliasesRequestBuilder extends BaseAliasesRequestBuilder { - public IndicesGetAliasesRequestBuilder(IndicesAdminClient client, String... aliases) { + public GetAliasesRequestBuilder(IndicesAdminClient client, String... aliases) { super(client, aliases); } @Override - protected void doExecute(ActionListener listener) { + protected void doExecute(ActionListener listener) { ((IndicesAdminClient) client).getAliases(request, listener); } diff --git a/src/main/java/org/elasticsearch/action/admin/indices/alias/get/IndicesGetAliasesResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponse.java similarity index 93% rename from src/main/java/org/elasticsearch/action/admin/indices/alias/get/IndicesGetAliasesResponse.java rename to src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponse.java index 06fc8ca3c30..7b612d5a778 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/alias/get/IndicesGetAliasesResponse.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponse.java @@ -32,15 +32,15 @@ import java.util.Map; /** */ -public class IndicesGetAliasesResponse extends ActionResponse { +public class GetAliasesResponse extends ActionResponse { private Map> aliases = new HashMap>(); - public IndicesGetAliasesResponse(Map> aliases) { + public GetAliasesResponse(Map> aliases) { this.aliases = aliases; } - IndicesGetAliasesResponse() { + GetAliasesResponse() { } diff --git a/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportIndicesGetAliasesAction.java b/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java similarity index 75% rename from src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportIndicesGetAliasesAction.java rename to src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java index bcdc4d0ddaa..692f501076b 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportIndicesGetAliasesAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java @@ -34,16 +34,16 @@ import java.util.Map; /** */ -public class TransportIndicesGetAliasesAction extends TransportMasterNodeOperationAction { +public class TransportGetAliasesAction extends TransportMasterNodeOperationAction { @Inject - public TransportIndicesGetAliasesAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool) { + public TransportGetAliasesAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool) { super(settings, transportService, clusterService, threadPool); } @Override protected String transportAction() { - return IndicesGetAliasesAction.NAME; + return GetAliasesAction.NAME; } @Override @@ -52,17 +52,17 @@ public class TransportIndicesGetAliasesAction extends TransportMasterNodeOperati } @Override - protected IndicesGetAliasesRequest newRequest() { - return new IndicesGetAliasesRequest(); + protected GetAliasesRequest newRequest() { + return new GetAliasesRequest(); } @Override - protected IndicesGetAliasesResponse newResponse() { - return new IndicesGetAliasesResponse(); + protected GetAliasesResponse newResponse() { + return new GetAliasesResponse(); } @Override - protected IndicesGetAliasesResponse masterOperation(IndicesGetAliasesRequest request, ClusterState state) throws ElasticSearchException { + protected GetAliasesResponse masterOperation(GetAliasesRequest request, ClusterState state) throws ElasticSearchException { String[] concreteIndices = state.metaData().concreteIndices(request.indices(), request.ignoreIndices(), true); request.indices(concreteIndices); @@ -71,7 +71,7 @@ public class TransportIndicesGetAliasesAction extends TransportMasterNodeOperati if (result.isEmpty()) { throw new AliasMissingException(request.aliases()); } - return new IndicesGetAliasesResponse(result); + return new GetAliasesResponse(result); } } diff --git a/src/main/java/org/elasticsearch/client/IndicesAdminClient.java b/src/main/java/org/elasticsearch/client/IndicesAdminClient.java index 2f7c4732666..d27a789548b 100644 --- a/src/main/java/org/elasticsearch/client/IndicesAdminClient.java +++ b/src/main/java/org/elasticsearch/client/IndicesAdminClient.java @@ -26,9 +26,9 @@ import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequestBuilder import org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse; import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistRequestBuilder; import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistResponse; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesRequest; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesRequestBuilder; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesResponse; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequestBuilder; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse; import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest; import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequestBuilder; import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse; @@ -498,7 +498,7 @@ public interface IndicesAdminClient { * * @param request The result future */ - ActionFuture getAliases(IndicesGetAliasesRequest request); + ActionFuture getAliases(GetAliasesRequest request); /** * Get specific index aliases that exists in particular indices and / or by name. @@ -506,12 +506,12 @@ public interface IndicesAdminClient { * @param request The index aliases request * @param listener A listener to be notified with a result */ - void getAliases(IndicesGetAliasesRequest request, ActionListener listener); + void getAliases(GetAliasesRequest request, ActionListener listener); /** * Get specific index aliases that exists in particular indices and / or by name. */ - IndicesGetAliasesRequestBuilder prepareGetAliases(String... aliases); + GetAliasesRequestBuilder prepareGetAliases(String... aliases); /** * Allows to check to existence of aliases from indices. @@ -523,7 +523,7 @@ public interface IndicesAdminClient { * * @param request The result future */ - ActionFuture aliasesExist(IndicesGetAliasesRequest request); + ActionFuture aliasesExist(GetAliasesRequest request); /** * Check the existence of specified index aliases. @@ -531,7 +531,7 @@ public interface IndicesAdminClient { * @param request The index aliases request * @param listener A listener to be notified with a result */ - void aliasesExist(IndicesGetAliasesRequest request, ActionListener listener); + void aliasesExist(GetAliasesRequest request, ActionListener listener); /** * Clear indices cache. diff --git a/src/main/java/org/elasticsearch/client/support/AbstractIndicesAdminClient.java b/src/main/java/org/elasticsearch/client/support/AbstractIndicesAdminClient.java index ebe2d3d8fea..66cffa472d8 100644 --- a/src/main/java/org/elasticsearch/client/support/AbstractIndicesAdminClient.java +++ b/src/main/java/org/elasticsearch/client/support/AbstractIndicesAdminClient.java @@ -28,10 +28,10 @@ import org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse; import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistAction; import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistRequestBuilder; import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistResponse; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesAction; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesRequest; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesRequestBuilder; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesResponse; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesAction; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequestBuilder; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse; import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction; import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest; import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequestBuilder; @@ -191,18 +191,18 @@ public abstract class AbstractIndicesAdminClient implements InternalIndicesAdmin } @Override - public ActionFuture getAliases(IndicesGetAliasesRequest request) { - return execute(IndicesGetAliasesAction.INSTANCE, request); + public ActionFuture getAliases(GetAliasesRequest request) { + return execute(GetAliasesAction.INSTANCE, request); } @Override - public void getAliases(IndicesGetAliasesRequest request, ActionListener listener) { - execute(IndicesGetAliasesAction.INSTANCE, request, listener); + public void getAliases(GetAliasesRequest request, ActionListener listener) { + execute(GetAliasesAction.INSTANCE, request, listener); } @Override - public IndicesGetAliasesRequestBuilder prepareGetAliases(String... aliases) { - return new IndicesGetAliasesRequestBuilder(this, aliases); + public GetAliasesRequestBuilder prepareGetAliases(String... aliases) { + return new GetAliasesRequestBuilder(this, aliases); } @Override @@ -211,12 +211,12 @@ public abstract class AbstractIndicesAdminClient implements InternalIndicesAdmin } @Override - public void aliasesExist(IndicesGetAliasesRequest request, ActionListener listener) { + public void aliasesExist(GetAliasesRequest request, ActionListener listener) { execute(AliasesExistAction.INSTANCE, request, listener); } @Override - public ActionFuture aliasesExist(IndicesGetAliasesRequest request) { + public ActionFuture aliasesExist(GetAliasesRequest request) { return execute(AliasesExistAction.INSTANCE, request); } diff --git a/src/main/java/org/elasticsearch/rest/action/RestActionModule.java b/src/main/java/org/elasticsearch/rest/action/RestActionModule.java index f7d2ae9adb5..91d05c898b5 100644 --- a/src/main/java/org/elasticsearch/rest/action/RestActionModule.java +++ b/src/main/java/org/elasticsearch/rest/action/RestActionModule.java @@ -36,7 +36,7 @@ import org.elasticsearch.rest.action.admin.cluster.state.RestClusterStateAction; import org.elasticsearch.rest.action.admin.indices.alias.RestGetIndicesAliasesAction; import org.elasticsearch.rest.action.admin.indices.alias.RestIndicesAliasesAction; import org.elasticsearch.rest.action.admin.indices.alias.delete.RestIndexDeleteAliasesAction; -import org.elasticsearch.rest.action.admin.indices.alias.get.RestIndicesGetAliasesAction; +import org.elasticsearch.rest.action.admin.indices.alias.get.RestGetAliasesAction; import org.elasticsearch.rest.action.admin.indices.alias.head.RestAliasesExistAction; import org.elasticsearch.rest.action.admin.indices.alias.put.RestIndexPutAliasAction; import org.elasticsearch.rest.action.admin.indices.analyze.RestAnalyzeAction; @@ -127,7 +127,7 @@ public class RestActionModule extends AbstractModule { bind(RestIndicesStatusAction.class).asEagerSingleton(); bind(RestIndicesSegmentsAction.class).asEagerSingleton(); bind(RestGetIndicesAliasesAction.class).asEagerSingleton(); - bind(RestIndicesGetAliasesAction.class).asEagerSingleton(); + bind(RestGetAliasesAction.class).asEagerSingleton(); bind(RestAliasesExistAction.class).asEagerSingleton(); bind(RestIndexDeleteAliasesAction.class).asEagerSingleton(); bind(RestIndexPutAliasAction.class).asEagerSingleton(); diff --git a/src/main/java/org/elasticsearch/rest/action/admin/indices/alias/get/RestIndicesGetAliasesAction.java b/src/main/java/org/elasticsearch/rest/action/admin/indices/alias/get/RestGetAliasesAction.java similarity index 87% rename from src/main/java/org/elasticsearch/rest/action/admin/indices/alias/get/RestIndicesGetAliasesAction.java rename to src/main/java/org/elasticsearch/rest/action/admin/indices/alias/get/RestGetAliasesAction.java index f6aaae4e563..f3e71d8ce57 100644 --- a/src/main/java/org/elasticsearch/rest/action/admin/indices/alias/get/RestIndicesGetAliasesAction.java +++ b/src/main/java/org/elasticsearch/rest/action/admin/indices/alias/get/RestGetAliasesAction.java @@ -20,8 +20,8 @@ package org.elasticsearch.rest.action.admin.indices.alias.get; import org.elasticsearch.action.ActionListener; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesRequest; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesResponse; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse; import org.elasticsearch.action.support.IgnoreIndices; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.metadata.AliasMetaData; @@ -44,10 +44,10 @@ import static org.elasticsearch.rest.RestStatus.OK; /** */ -public class RestIndicesGetAliasesAction extends BaseRestHandler { +public class RestGetAliasesAction extends BaseRestHandler { @Inject - public RestIndicesGetAliasesAction(Settings settings, Client client, RestController controller) { + public RestGetAliasesAction(Settings settings, Client client, RestController controller) { super(settings, client); controller.registerHandler(GET, "/_alias/{name}", this); controller.registerHandler(GET, "/{index}/_alias/{name}", this); @@ -57,17 +57,17 @@ public class RestIndicesGetAliasesAction extends BaseRestHandler { public void handleRequest(final RestRequest request, final RestChannel channel) { String[] aliases = request.paramAsStringArray("name", Strings.EMPTY_ARRAY); final String[] indices = RestActions.splitIndices(request.param("index")); - IndicesGetAliasesRequest getAliasesRequest = new IndicesGetAliasesRequest(aliases); + GetAliasesRequest getAliasesRequest = new GetAliasesRequest(aliases); getAliasesRequest.indices(indices); if (request.hasParam("ignore_indices")) { getAliasesRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices"))); } - client.admin().indices().getAliases(getAliasesRequest, new ActionListener() { + client.admin().indices().getAliases(getAliasesRequest, new ActionListener() { @Override - public void onResponse(IndicesGetAliasesResponse response) { + public void onResponse(GetAliasesResponse response) { try { XContentBuilder builder = RestXContentBuilder.restContentBuilder(request); builder.startObject(); diff --git a/src/main/java/org/elasticsearch/rest/action/admin/indices/alias/head/RestAliasesExistAction.java b/src/main/java/org/elasticsearch/rest/action/admin/indices/alias/head/RestAliasesExistAction.java index b4a01613b67..c3508f61db6 100644 --- a/src/main/java/org/elasticsearch/rest/action/admin/indices/alias/head/RestAliasesExistAction.java +++ b/src/main/java/org/elasticsearch/rest/action/admin/indices/alias/head/RestAliasesExistAction.java @@ -22,7 +22,7 @@ package org.elasticsearch.rest.action.admin.indices.alias.head; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistResponse; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesRequest; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest; import org.elasticsearch.action.support.IgnoreIndices; import org.elasticsearch.client.Client; import org.elasticsearch.common.Strings; @@ -50,7 +50,7 @@ public class RestAliasesExistAction extends BaseRestHandler { public void handleRequest(final RestRequest request, final RestChannel channel) { String[] aliases = request.paramAsStringArray("name", Strings.EMPTY_ARRAY); final String[] indices = RestActions.splitIndices(request.param("index")); - IndicesGetAliasesRequest getAliasesRequest = new IndicesGetAliasesRequest(aliases); + GetAliasesRequest getAliasesRequest = new GetAliasesRequest(aliases); getAliasesRequest.indices(indices); if (request.hasParam("ignore_indices")) { diff --git a/src/test/java/org/elasticsearch/test/integration/aliases/IndexAliasesTests.java b/src/test/java/org/elasticsearch/test/integration/aliases/IndexAliasesTests.java index 2c57a7616a5..7ef8095d36a 100644 --- a/src/test/java/org/elasticsearch/test/integration/aliases/IndexAliasesTests.java +++ b/src/test/java/org/elasticsearch/test/integration/aliases/IndexAliasesTests.java @@ -23,7 +23,7 @@ import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus; import org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse; import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistResponse; -import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesResponse; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.cluster.ClusterState; @@ -616,7 +616,7 @@ public class IndexAliasesTests extends AbstractSharedClusterTest { assertThat(indicesAliasesResponse.isAcknowledged(), equalTo(true)); logger.info("--> getting alias1"); - IndicesGetAliasesResponse getResponse = client().admin().indices().prepareGetAliases("alias1").execute().actionGet(); + GetAliasesResponse getResponse = client().admin().indices().prepareGetAliases("alias1").execute().actionGet(); assertThat(getResponse, notNullValue()); assertThat(getResponse.getAliases().size(), equalTo(1)); assertThat(getResponse.getAliases().get("foobar").size(), equalTo(1));