151 lines
8.0 KiB
Java
Raw Normal View History

2010-02-17 09:28:06 +02:00
/*
2011-12-06 02:42:25 +02:00
* Licensed to ElasticSearch and Shay Banon under one
2010-02-17 09:28:06 +02:00
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
2011-12-06 02:42:25 +02:00
* regarding copyright ownership. ElasticSearch licenses this
2010-02-17 09:28:06 +02:00
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.rest.action;
2011-12-06 02:42:25 +02:00
import com.google.common.collect.Lists;
import org.elasticsearch.common.inject.AbstractModule;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.action.admin.cluster.health.RestClusterHealthAction;
2010-02-17 09:28:06 +02:00
import org.elasticsearch.rest.action.admin.cluster.node.info.RestNodesInfoAction;
import org.elasticsearch.rest.action.admin.cluster.node.restart.RestNodesRestartAction;
import org.elasticsearch.rest.action.admin.cluster.node.shutdown.RestNodesShutdownAction;
2010-05-09 09:59:43 +03:00
import org.elasticsearch.rest.action.admin.cluster.node.stats.RestNodesStatsAction;
2011-10-16 19:02:32 +02:00
import org.elasticsearch.rest.action.admin.cluster.reroute.RestClusterRerouteAction;
import org.elasticsearch.rest.action.admin.cluster.settings.RestClusterGetSettingsAction;
import org.elasticsearch.rest.action.admin.cluster.settings.RestClusterUpdateSettingsAction;
2010-02-17 09:28:06 +02:00
import org.elasticsearch.rest.action.admin.cluster.state.RestClusterStateAction;
import org.elasticsearch.rest.action.admin.indices.alias.RestGetIndicesAliasesAction;
2010-03-25 02:00:53 +02:00
import org.elasticsearch.rest.action.admin.indices.alias.RestIndicesAliasesAction;
import org.elasticsearch.rest.action.admin.indices.analyze.RestAnalyzeAction;
import org.elasticsearch.rest.action.admin.indices.cache.clear.RestClearIndicesCacheAction;
import org.elasticsearch.rest.action.admin.indices.close.RestCloseIndexAction;
2010-02-17 09:28:06 +02:00
import org.elasticsearch.rest.action.admin.indices.create.RestCreateIndexAction;
import org.elasticsearch.rest.action.admin.indices.delete.RestDeleteIndexAction;
2011-06-12 12:01:29 +03:00
import org.elasticsearch.rest.action.admin.indices.exists.RestIndicesExistsAction;
2010-02-17 09:28:06 +02:00
import org.elasticsearch.rest.action.admin.indices.flush.RestFlushAction;
import org.elasticsearch.rest.action.admin.indices.gateway.snapshot.RestGatewaySnapshotAction;
import org.elasticsearch.rest.action.admin.indices.mapping.delete.RestDeleteMappingAction;
import org.elasticsearch.rest.action.admin.indices.mapping.get.RestGetMappingAction;
2010-02-21 16:49:42 +02:00
import org.elasticsearch.rest.action.admin.indices.mapping.put.RestPutMappingAction;
import org.elasticsearch.rest.action.admin.indices.open.RestOpenIndexAction;
2010-02-17 09:28:06 +02:00
import org.elasticsearch.rest.action.admin.indices.optimize.RestOptimizeAction;
import org.elasticsearch.rest.action.admin.indices.refresh.RestRefreshAction;
import org.elasticsearch.rest.action.admin.indices.segments.RestIndicesSegmentsAction;
import org.elasticsearch.rest.action.admin.indices.settings.RestGetSettingsAction;
import org.elasticsearch.rest.action.admin.indices.settings.RestUpdateSettingsAction;
import org.elasticsearch.rest.action.admin.indices.stats.RestIndicesStatsAction;
2010-02-17 09:28:06 +02:00
import org.elasticsearch.rest.action.admin.indices.status.RestIndicesStatusAction;
2010-11-26 15:45:18 +02:00
import org.elasticsearch.rest.action.admin.indices.template.delete.RestDeleteIndexTemplateAction;
import org.elasticsearch.rest.action.admin.indices.template.get.RestGetIndexTemplateAction;
import org.elasticsearch.rest.action.admin.indices.template.put.RestPutIndexTemplateAction;
import org.elasticsearch.rest.action.admin.indices.validate.query.RestValidateQueryAction;
2010-09-15 12:22:07 +02:00
import org.elasticsearch.rest.action.bulk.RestBulkAction;
2010-02-17 09:28:06 +02:00
import org.elasticsearch.rest.action.count.RestCountAction;
import org.elasticsearch.rest.action.delete.RestDeleteAction;
import org.elasticsearch.rest.action.deletebyquery.RestDeleteByQueryAction;
import org.elasticsearch.rest.action.get.RestGetAction;
2011-06-27 22:23:49 +03:00
import org.elasticsearch.rest.action.get.RestMultiGetAction;
2010-02-17 09:28:06 +02:00
import org.elasticsearch.rest.action.index.RestIndexAction;
import org.elasticsearch.rest.action.main.RestMainAction;
import org.elasticsearch.rest.action.mlt.RestMoreLikeThisAction;
2011-01-13 16:20:31 +02:00
import org.elasticsearch.rest.action.percolate.RestPercolateAction;
2010-02-17 09:28:06 +02:00
import org.elasticsearch.rest.action.search.RestSearchAction;
2010-03-21 01:14:49 +02:00
import org.elasticsearch.rest.action.search.RestSearchScrollAction;
import org.elasticsearch.rest.action.update.RestUpdateAction;
2010-02-17 09:28:06 +02:00
import java.util.List;
2010-02-17 09:28:06 +02:00
/**
2011-12-06 02:42:25 +02:00
*
2010-02-17 09:28:06 +02:00
*/
public class RestActionModule extends AbstractModule {
private List<Class<? extends BaseRestHandler>> restPluginsActions = Lists.newArrayList();
public RestActionModule(List<Class<? extends BaseRestHandler>> restPluginsActions) {
this.restPluginsActions = restPluginsActions;
}
2010-02-17 09:28:06 +02:00
2011-12-06 02:42:25 +02:00
@Override
protected void configure() {
for (Class<? extends BaseRestHandler> restAction : restPluginsActions) {
bind(restAction).asEagerSingleton();
}
2010-02-17 09:28:06 +02:00
bind(RestMainAction.class).asEagerSingleton();
bind(RestNodesInfoAction.class).asEagerSingleton();
2010-05-09 09:59:43 +03:00
bind(RestNodesStatsAction.class).asEagerSingleton();
bind(RestNodesShutdownAction.class).asEagerSingleton();
bind(RestNodesRestartAction.class).asEagerSingleton();
2010-02-17 09:28:06 +02:00
bind(RestClusterStateAction.class).asEagerSingleton();
bind(RestClusterHealthAction.class).asEagerSingleton();
bind(RestClusterUpdateSettingsAction.class).asEagerSingleton();
bind(RestClusterGetSettingsAction.class).asEagerSingleton();
2011-10-16 19:02:32 +02:00
bind(RestClusterRerouteAction.class).asEagerSingleton();
2010-02-17 09:28:06 +02:00
2011-06-12 12:01:29 +03:00
bind(RestIndicesExistsAction.class).asEagerSingleton();
bind(RestIndicesStatsAction.class).asEagerSingleton();
2010-02-17 09:28:06 +02:00
bind(RestIndicesStatusAction.class).asEagerSingleton();
bind(RestIndicesSegmentsAction.class).asEagerSingleton();
bind(RestGetIndicesAliasesAction.class).asEagerSingleton();
2010-03-25 02:00:53 +02:00
bind(RestIndicesAliasesAction.class).asEagerSingleton();
2010-02-17 09:28:06 +02:00
bind(RestCreateIndexAction.class).asEagerSingleton();
bind(RestDeleteIndexAction.class).asEagerSingleton();
bind(RestCloseIndexAction.class).asEagerSingleton();
bind(RestOpenIndexAction.class).asEagerSingleton();
bind(RestUpdateSettingsAction.class).asEagerSingleton();
bind(RestGetSettingsAction.class).asEagerSingleton();
bind(RestAnalyzeAction.class).asEagerSingleton();
2010-11-26 15:45:18 +02:00
bind(RestGetIndexTemplateAction.class).asEagerSingleton();
bind(RestPutIndexTemplateAction.class).asEagerSingleton();
bind(RestDeleteIndexTemplateAction.class).asEagerSingleton();
2010-02-17 09:28:06 +02:00
2010-02-21 16:49:42 +02:00
bind(RestPutMappingAction.class).asEagerSingleton();
bind(RestDeleteMappingAction.class).asEagerSingleton();
bind(RestGetMappingAction.class).asEagerSingleton();
2010-02-17 09:28:06 +02:00
bind(RestGatewaySnapshotAction.class).asEagerSingleton();
bind(RestRefreshAction.class).asEagerSingleton();
bind(RestFlushAction.class).asEagerSingleton();
bind(RestOptimizeAction.class).asEagerSingleton();
bind(RestClearIndicesCacheAction.class).asEagerSingleton();
2010-02-17 09:28:06 +02:00
bind(RestIndexAction.class).asEagerSingleton();
bind(RestGetAction.class).asEagerSingleton();
2011-06-27 22:23:49 +03:00
bind(RestMultiGetAction.class).asEagerSingleton();
2010-02-17 09:28:06 +02:00
bind(RestDeleteAction.class).asEagerSingleton();
bind(RestDeleteByQueryAction.class).asEagerSingleton();
bind(RestCountAction.class).asEagerSingleton();
2010-09-15 12:22:07 +02:00
bind(RestBulkAction.class).asEagerSingleton();
bind(RestUpdateAction.class).asEagerSingleton();
bind(RestPercolateAction.class).asEagerSingleton();
2010-02-17 09:28:06 +02:00
bind(RestSearchAction.class).asEagerSingleton();
2010-03-21 01:14:49 +02:00
bind(RestSearchScrollAction.class).asEagerSingleton();
bind(RestValidateQueryAction.class).asEagerSingleton();
bind(RestMoreLikeThisAction.class).asEagerSingleton();
2010-02-17 09:28:06 +02:00
}
}