Renamed IndicesGetAliases* classes to begin with GetAliases*

This commit is contained in:
Martijn van Groningen 2013-07-15 14:55:46 +02:00
parent f28ff2becc
commit 470b685fa9
16 changed files with 77 additions and 77 deletions

View File

@ -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.TransportIndicesAliasesAction;
import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistAction; 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.exists.TransportAliasesExistAction;
import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesAction; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesAction;
import org.elasticsearch.action.admin.indices.alias.get.TransportIndicesGetAliasesAction; import org.elasticsearch.action.admin.indices.alias.get.TransportGetAliasesAction;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction; import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction;
import org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction; import org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction;
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheAction; import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheAction;
@ -213,7 +213,7 @@ public class ActionModule extends AbstractModule {
registerAction(PutWarmerAction.INSTANCE, TransportPutWarmerAction.class); registerAction(PutWarmerAction.INSTANCE, TransportPutWarmerAction.class);
registerAction(DeleteWarmerAction.INSTANCE, TransportDeleteWarmerAction.class); registerAction(DeleteWarmerAction.INSTANCE, TransportDeleteWarmerAction.class);
registerAction(GetWarmersAction.INSTANCE, TransportGetWarmersAction.class); registerAction(GetWarmersAction.INSTANCE, TransportGetWarmersAction.class);
registerAction(IndicesGetAliasesAction.INSTANCE, TransportIndicesGetAliasesAction.class); registerAction(GetAliasesAction.INSTANCE, TransportGetAliasesAction.class);
registerAction(AliasesExistAction.INSTANCE, TransportAliasesExistAction.class); registerAction(AliasesExistAction.INSTANCE, TransportAliasesExistAction.class);
registerAction(IndexAction.INSTANCE, TransportIndexAction.class); registerAction(IndexAction.INSTANCE, TransportIndexAction.class);

View File

@ -20,12 +20,12 @@
package org.elasticsearch.action.admin.indices.alias.exists; package org.elasticsearch.action.admin.indices.alias.exists;
import org.elasticsearch.action.admin.indices.IndicesAction; 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; import org.elasticsearch.client.IndicesAdminClient;
/** /**
*/ */
public class AliasesExistAction extends IndicesAction<IndicesGetAliasesRequest, AliasesExistResponse, AliasesExistRequestBuilder> { public class AliasesExistAction extends IndicesAction<GetAliasesRequest, AliasesExistResponse, AliasesExistRequestBuilder> {
public static final AliasesExistAction INSTANCE = new AliasesExistAction(); public static final AliasesExistAction INSTANCE = new AliasesExistAction();
public static final String NAME = "indices/exists/aliases"; public static final String NAME = "indices/exists/aliases";

View File

@ -20,12 +20,12 @@
package org.elasticsearch.action.admin.indices.alias.exists; package org.elasticsearch.action.admin.indices.alias.exists;
import org.elasticsearch.action.ActionListener; 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; import org.elasticsearch.client.IndicesAdminClient;
/** /**
*/ */
public class AliasesExistRequestBuilder extends BaseIndicesAliasesRequestBuilder<AliasesExistResponse, AliasesExistRequestBuilder> { public class AliasesExistRequestBuilder extends BaseAliasesRequestBuilder<AliasesExistResponse, AliasesExistRequestBuilder> {
public AliasesExistRequestBuilder(IndicesAdminClient client, String... aliases) { public AliasesExistRequestBuilder(IndicesAdminClient client, String... aliases) {
super(client, aliases); super(client, aliases);

View File

@ -19,7 +19,7 @@
package org.elasticsearch.action.admin.indices.alias.exists; package org.elasticsearch.action.admin.indices.alias.exists;
import org.elasticsearch.ElasticSearchException; 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.action.support.master.TransportMasterNodeOperationAction;
import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
@ -30,7 +30,7 @@ import org.elasticsearch.transport.TransportService;
/** /**
*/ */
public class TransportAliasesExistAction extends TransportMasterNodeOperationAction<IndicesGetAliasesRequest, AliasesExistResponse> { public class TransportAliasesExistAction extends TransportMasterNodeOperationAction<GetAliasesRequest, AliasesExistResponse> {
@Inject @Inject
public TransportAliasesExistAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool) { public TransportAliasesExistAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool) {
@ -48,8 +48,8 @@ public class TransportAliasesExistAction extends TransportMasterNodeOperationAct
} }
@Override @Override
protected IndicesGetAliasesRequest newRequest() { protected GetAliasesRequest newRequest() {
return new IndicesGetAliasesRequest(); return new GetAliasesRequest();
} }
@Override @Override
@ -58,7 +58,7 @@ public class TransportAliasesExistAction extends TransportMasterNodeOperationAct
} }
@Override @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); String[] concreteIndices = state.metaData().concreteIndices(request.indices(), request.ignoreIndices(), true);
request.indices(concreteIndices); request.indices(concreteIndices);

View File

@ -27,10 +27,10 @@ import org.elasticsearch.client.internal.InternalIndicesAdminClient;
/** /**
*/ */
public abstract class BaseIndicesAliasesRequestBuilder<Response extends ActionResponse, Builder extends BaseIndicesAliasesRequestBuilder<Response, Builder>> extends MasterNodeOperationRequestBuilder<IndicesGetAliasesRequest, Response, Builder> { public abstract class BaseAliasesRequestBuilder<Response extends ActionResponse, Builder extends BaseAliasesRequestBuilder<Response, Builder>> extends MasterNodeOperationRequestBuilder<GetAliasesRequest, Response, Builder> {
public BaseIndicesAliasesRequestBuilder(IndicesAdminClient client, String... aliases) { public BaseAliasesRequestBuilder(IndicesAdminClient client, String... aliases) {
super((InternalIndicesAdminClient) client, new IndicesGetAliasesRequest(aliases)); super((InternalIndicesAdminClient) client, new GetAliasesRequest(aliases));
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")

View File

@ -24,22 +24,22 @@ import org.elasticsearch.client.IndicesAdminClient;
/** /**
*/ */
public class IndicesGetAliasesAction extends IndicesAction<IndicesGetAliasesRequest, IndicesGetAliasesResponse, IndicesGetAliasesRequestBuilder> { public class GetAliasesAction extends IndicesAction<GetAliasesRequest, GetAliasesResponse, GetAliasesRequestBuilder> {
public static final IndicesGetAliasesAction INSTANCE = new IndicesGetAliasesAction(); public static final GetAliasesAction INSTANCE = new GetAliasesAction();
public static final String NAME = "indices/get/aliases"; public static final String NAME = "indices/get/aliases";
private IndicesGetAliasesAction() { private GetAliasesAction() {
super(NAME); super(NAME);
} }
@Override @Override
public IndicesGetAliasesRequestBuilder newRequestBuilder(IndicesAdminClient client) { public GetAliasesRequestBuilder newRequestBuilder(IndicesAdminClient client) {
return new IndicesGetAliasesRequestBuilder(client); return new GetAliasesRequestBuilder(client);
} }
@Override @Override
public IndicesGetAliasesResponse newResponse() { public GetAliasesResponse newResponse() {
return new IndicesGetAliasesResponse(); return new GetAliasesResponse();
} }
} }

View File

@ -31,35 +31,35 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
/** /**
*/ */
public class IndicesGetAliasesRequest extends MasterNodeOperationRequest<IndicesGetAliasesRequest> { public class GetAliasesRequest extends MasterNodeOperationRequest<GetAliasesRequest> {
private String[] indices = Strings.EMPTY_ARRAY; private String[] indices = Strings.EMPTY_ARRAY;
private String[] aliases = Strings.EMPTY_ARRAY; private String[] aliases = Strings.EMPTY_ARRAY;
private IgnoreIndices ignoreIndices = IgnoreIndices.NONE; private IgnoreIndices ignoreIndices = IgnoreIndices.NONE;
public IndicesGetAliasesRequest(String[] aliases) { public GetAliasesRequest(String[] aliases) {
this.aliases = aliases; this.aliases = aliases;
} }
public IndicesGetAliasesRequest(String alias) { public GetAliasesRequest(String alias) {
this.aliases = new String[]{alias}; this.aliases = new String[]{alias};
} }
public IndicesGetAliasesRequest() { public GetAliasesRequest() {
} }
public IndicesGetAliasesRequest indices(String... indices) { public GetAliasesRequest indices(String... indices) {
this.indices = indices; this.indices = indices;
return this; return this;
} }
public IndicesGetAliasesRequest aliases(String... aliases) { public GetAliasesRequest aliases(String... aliases) {
this.aliases = aliases; this.aliases = aliases;
return this; return this;
} }
public IndicesGetAliasesRequest ignoreIndices(IgnoreIndices ignoreIndices) { public GetAliasesRequest ignoreIndices(IgnoreIndices ignoreIndices) {
this.ignoreIndices = ignoreIndices; this.ignoreIndices = ignoreIndices;
return this; return this;
} }

View File

@ -24,14 +24,14 @@ import org.elasticsearch.client.IndicesAdminClient;
/** /**
*/ */
public class IndicesGetAliasesRequestBuilder extends BaseIndicesAliasesRequestBuilder<IndicesGetAliasesResponse, IndicesGetAliasesRequestBuilder> { public class GetAliasesRequestBuilder extends BaseAliasesRequestBuilder<GetAliasesResponse, GetAliasesRequestBuilder> {
public IndicesGetAliasesRequestBuilder(IndicesAdminClient client, String... aliases) { public GetAliasesRequestBuilder(IndicesAdminClient client, String... aliases) {
super(client, aliases); super(client, aliases);
} }
@Override @Override
protected void doExecute(ActionListener<IndicesGetAliasesResponse> listener) { protected void doExecute(ActionListener<GetAliasesResponse> listener) {
((IndicesAdminClient) client).getAliases(request, listener); ((IndicesAdminClient) client).getAliases(request, listener);
} }

View File

@ -32,15 +32,15 @@ import java.util.Map;
/** /**
*/ */
public class IndicesGetAliasesResponse extends ActionResponse { public class GetAliasesResponse extends ActionResponse {
private Map<String, List<AliasMetaData>> aliases = new HashMap<String, List<AliasMetaData>>(); private Map<String, List<AliasMetaData>> aliases = new HashMap<String, List<AliasMetaData>>();
public IndicesGetAliasesResponse(Map<String, List<AliasMetaData>> aliases) { public GetAliasesResponse(Map<String, List<AliasMetaData>> aliases) {
this.aliases = aliases; this.aliases = aliases;
} }
IndicesGetAliasesResponse() { GetAliasesResponse() {
} }

View File

@ -34,16 +34,16 @@ import java.util.Map;
/** /**
*/ */
public class TransportIndicesGetAliasesAction extends TransportMasterNodeOperationAction<IndicesGetAliasesRequest, IndicesGetAliasesResponse> { public class TransportGetAliasesAction extends TransportMasterNodeOperationAction<GetAliasesRequest, GetAliasesResponse> {
@Inject @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); super(settings, transportService, clusterService, threadPool);
} }
@Override @Override
protected String transportAction() { protected String transportAction() {
return IndicesGetAliasesAction.NAME; return GetAliasesAction.NAME;
} }
@Override @Override
@ -52,17 +52,17 @@ public class TransportIndicesGetAliasesAction extends TransportMasterNodeOperati
} }
@Override @Override
protected IndicesGetAliasesRequest newRequest() { protected GetAliasesRequest newRequest() {
return new IndicesGetAliasesRequest(); return new GetAliasesRequest();
} }
@Override @Override
protected IndicesGetAliasesResponse newResponse() { protected GetAliasesResponse newResponse() {
return new IndicesGetAliasesResponse(); return new GetAliasesResponse();
} }
@Override @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); String[] concreteIndices = state.metaData().concreteIndices(request.indices(), request.ignoreIndices(), true);
request.indices(concreteIndices); request.indices(concreteIndices);
@ -71,7 +71,7 @@ public class TransportIndicesGetAliasesAction extends TransportMasterNodeOperati
if (result.isEmpty()) { if (result.isEmpty()) {
throw new AliasMissingException(request.aliases()); throw new AliasMissingException(request.aliases());
} }
return new IndicesGetAliasesResponse(result); return new GetAliasesResponse(result);
} }
} }

View File

@ -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.IndicesAliasesResponse;
import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistRequestBuilder; 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.exists.AliasesExistResponse;
import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesRequest; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest;
import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesRequestBuilder; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequestBuilder;
import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesResponse; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest; import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequestBuilder; import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequestBuilder;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse; import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse;
@ -498,7 +498,7 @@ public interface IndicesAdminClient {
* *
* @param request The result future * @param request The result future
*/ */
ActionFuture<IndicesGetAliasesResponse> getAliases(IndicesGetAliasesRequest request); ActionFuture<GetAliasesResponse> getAliases(GetAliasesRequest request);
/** /**
* Get specific index aliases that exists in particular indices and / or by name. * 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 request The index aliases request
* @param listener A listener to be notified with a result * @param listener A listener to be notified with a result
*/ */
void getAliases(IndicesGetAliasesRequest request, ActionListener<IndicesGetAliasesResponse> listener); void getAliases(GetAliasesRequest request, ActionListener<GetAliasesResponse> listener);
/** /**
* Get specific index aliases that exists in particular indices and / or by name. * 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. * Allows to check to existence of aliases from indices.
@ -523,7 +523,7 @@ public interface IndicesAdminClient {
* *
* @param request The result future * @param request The result future
*/ */
ActionFuture<AliasesExistResponse> aliasesExist(IndicesGetAliasesRequest request); ActionFuture<AliasesExistResponse> aliasesExist(GetAliasesRequest request);
/** /**
* Check the existence of specified index aliases. * Check the existence of specified index aliases.
@ -531,7 +531,7 @@ public interface IndicesAdminClient {
* @param request The index aliases request * @param request The index aliases request
* @param listener A listener to be notified with a result * @param listener A listener to be notified with a result
*/ */
void aliasesExist(IndicesGetAliasesRequest request, ActionListener<AliasesExistResponse> listener); void aliasesExist(GetAliasesRequest request, ActionListener<AliasesExistResponse> listener);
/** /**
* Clear indices cache. * Clear indices cache.

View File

@ -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.AliasesExistAction;
import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistRequestBuilder; 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.exists.AliasesExistResponse;
import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesAction; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesAction;
import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesRequest; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest;
import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesRequestBuilder; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequestBuilder;
import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesResponse; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction; import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest; import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequestBuilder; import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequestBuilder;
@ -191,18 +191,18 @@ public abstract class AbstractIndicesAdminClient implements InternalIndicesAdmin
} }
@Override @Override
public ActionFuture<IndicesGetAliasesResponse> getAliases(IndicesGetAliasesRequest request) { public ActionFuture<GetAliasesResponse> getAliases(GetAliasesRequest request) {
return execute(IndicesGetAliasesAction.INSTANCE, request); return execute(GetAliasesAction.INSTANCE, request);
} }
@Override @Override
public void getAliases(IndicesGetAliasesRequest request, ActionListener<IndicesGetAliasesResponse> listener) { public void getAliases(GetAliasesRequest request, ActionListener<GetAliasesResponse> listener) {
execute(IndicesGetAliasesAction.INSTANCE, request, listener); execute(GetAliasesAction.INSTANCE, request, listener);
} }
@Override @Override
public IndicesGetAliasesRequestBuilder prepareGetAliases(String... aliases) { public GetAliasesRequestBuilder prepareGetAliases(String... aliases) {
return new IndicesGetAliasesRequestBuilder(this, aliases); return new GetAliasesRequestBuilder(this, aliases);
} }
@Override @Override
@ -211,12 +211,12 @@ public abstract class AbstractIndicesAdminClient implements InternalIndicesAdmin
} }
@Override @Override
public void aliasesExist(IndicesGetAliasesRequest request, ActionListener<AliasesExistResponse> listener) { public void aliasesExist(GetAliasesRequest request, ActionListener<AliasesExistResponse> listener) {
execute(AliasesExistAction.INSTANCE, request, listener); execute(AliasesExistAction.INSTANCE, request, listener);
} }
@Override @Override
public ActionFuture<AliasesExistResponse> aliasesExist(IndicesGetAliasesRequest request) { public ActionFuture<AliasesExistResponse> aliasesExist(GetAliasesRequest request) {
return execute(AliasesExistAction.INSTANCE, request); return execute(AliasesExistAction.INSTANCE, request);
} }

View File

@ -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.RestGetIndicesAliasesAction;
import org.elasticsearch.rest.action.admin.indices.alias.RestIndicesAliasesAction; 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.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.head.RestAliasesExistAction;
import org.elasticsearch.rest.action.admin.indices.alias.put.RestIndexPutAliasAction; import org.elasticsearch.rest.action.admin.indices.alias.put.RestIndexPutAliasAction;
import org.elasticsearch.rest.action.admin.indices.analyze.RestAnalyzeAction; import org.elasticsearch.rest.action.admin.indices.analyze.RestAnalyzeAction;
@ -127,7 +127,7 @@ public class RestActionModule extends AbstractModule {
bind(RestIndicesStatusAction.class).asEagerSingleton(); bind(RestIndicesStatusAction.class).asEagerSingleton();
bind(RestIndicesSegmentsAction.class).asEagerSingleton(); bind(RestIndicesSegmentsAction.class).asEagerSingleton();
bind(RestGetIndicesAliasesAction.class).asEagerSingleton(); bind(RestGetIndicesAliasesAction.class).asEagerSingleton();
bind(RestIndicesGetAliasesAction.class).asEagerSingleton(); bind(RestGetAliasesAction.class).asEagerSingleton();
bind(RestAliasesExistAction.class).asEagerSingleton(); bind(RestAliasesExistAction.class).asEagerSingleton();
bind(RestIndexDeleteAliasesAction.class).asEagerSingleton(); bind(RestIndexDeleteAliasesAction.class).asEagerSingleton();
bind(RestIndexPutAliasAction.class).asEagerSingleton(); bind(RestIndexPutAliasAction.class).asEagerSingleton();

View File

@ -20,8 +20,8 @@
package org.elasticsearch.rest.action.admin.indices.alias.get; package org.elasticsearch.rest.action.admin.indices.alias.get;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesRequest; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest;
import org.elasticsearch.action.admin.indices.alias.get.IndicesGetAliasesResponse; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse;
import org.elasticsearch.action.support.IgnoreIndices; import org.elasticsearch.action.support.IgnoreIndices;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.metadata.AliasMetaData; 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 @Inject
public RestIndicesGetAliasesAction(Settings settings, Client client, RestController controller) { public RestGetAliasesAction(Settings settings, Client client, RestController controller) {
super(settings, client); super(settings, client);
controller.registerHandler(GET, "/_alias/{name}", this); controller.registerHandler(GET, "/_alias/{name}", this);
controller.registerHandler(GET, "/{index}/_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) { public void handleRequest(final RestRequest request, final RestChannel channel) {
String[] aliases = request.paramAsStringArray("name", Strings.EMPTY_ARRAY); String[] aliases = request.paramAsStringArray("name", Strings.EMPTY_ARRAY);
final String[] indices = RestActions.splitIndices(request.param("index")); final String[] indices = RestActions.splitIndices(request.param("index"));
IndicesGetAliasesRequest getAliasesRequest = new IndicesGetAliasesRequest(aliases); GetAliasesRequest getAliasesRequest = new GetAliasesRequest(aliases);
getAliasesRequest.indices(indices); getAliasesRequest.indices(indices);
if (request.hasParam("ignore_indices")) { if (request.hasParam("ignore_indices")) {
getAliasesRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices"))); getAliasesRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
} }
client.admin().indices().getAliases(getAliasesRequest, new ActionListener<IndicesGetAliasesResponse>() { client.admin().indices().getAliases(getAliasesRequest, new ActionListener<GetAliasesResponse>() {
@Override @Override
public void onResponse(IndicesGetAliasesResponse response) { public void onResponse(GetAliasesResponse response) {
try { try {
XContentBuilder builder = RestXContentBuilder.restContentBuilder(request); XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
builder.startObject(); builder.startObject();

View File

@ -22,7 +22,7 @@ package org.elasticsearch.rest.action.admin.indices.alias.head;
import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistResponse; 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.action.support.IgnoreIndices;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
@ -50,7 +50,7 @@ public class RestAliasesExistAction extends BaseRestHandler {
public void handleRequest(final RestRequest request, final RestChannel channel) { public void handleRequest(final RestRequest request, final RestChannel channel) {
String[] aliases = request.paramAsStringArray("name", Strings.EMPTY_ARRAY); String[] aliases = request.paramAsStringArray("name", Strings.EMPTY_ARRAY);
final String[] indices = RestActions.splitIndices(request.param("index")); final String[] indices = RestActions.splitIndices(request.param("index"));
IndicesGetAliasesRequest getAliasesRequest = new IndicesGetAliasesRequest(aliases); GetAliasesRequest getAliasesRequest = new GetAliasesRequest(aliases);
getAliasesRequest.indices(indices); getAliasesRequest.indices(indices);
if (request.hasParam("ignore_indices")) { if (request.hasParam("ignore_indices")) {

View File

@ -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.cluster.health.ClusterHealthStatus;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse; import org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse;
import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistResponse; 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.index.IndexResponse;
import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
@ -616,7 +616,7 @@ public class IndexAliasesTests extends AbstractSharedClusterTest {
assertThat(indicesAliasesResponse.isAcknowledged(), equalTo(true)); assertThat(indicesAliasesResponse.isAcknowledged(), equalTo(true));
logger.info("--> getting alias1"); 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, notNullValue());
assertThat(getResponse.getAliases().size(), equalTo(1)); assertThat(getResponse.getAliases().size(), equalTo(1));
assertThat(getResponse.getAliases().get("foobar").size(), equalTo(1)); assertThat(getResponse.getAliases().get("foobar").size(), equalTo(1));