Remove unnecessary generic params from action classes (#126364)

Transport actions have associated request and response classes. However,
the base type restrictions are not necessary to duplicate when creating
a map of transport actions. Relatedly, the ActionHandler class doesn't
actually need strongly typed action type and classes since they are lost
when shoved into the node client map. This commit removes these type
restrictions and generic parameters.
This commit is contained in:
Ryan Ernst 2025-04-07 16:22:56 -07:00 committed by GitHub
parent 9feac7833e
commit 991e80d56e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
77 changed files with 629 additions and 782 deletions

View file

@ -8,8 +8,6 @@
*/
package org.elasticsearch.plugin.noop;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.search.SearchResponse;
@ -41,10 +39,10 @@ public class NoopPlugin extends Plugin implements ActionPlugin {
public static final ActionType<BulkResponse> NOOP_BULK_ACTION = new ActionType<>("mock:data/write/bulk");
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return Arrays.asList(
new ActionHandler<>(NOOP_BULK_ACTION, TransportNoopBulkAction.class),
new ActionHandler<>(NOOP_SEARCH_ACTION, TransportNoopSearchAction.class)
new ActionHandler(NOOP_BULK_ACTION, TransportNoopBulkAction.class),
new ActionHandler(NOOP_SEARCH_ACTION, TransportNoopSearchAction.class)
);
}

View file

@ -10,8 +10,6 @@ package org.elasticsearch.datastreams;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.datastreams.CreateDataStreamAction;
import org.elasticsearch.action.datastreams.DataStreamsStatsAction;
import org.elasticsearch.action.datastreams.DeleteDataStreamAction;
@ -225,24 +223,24 @@ public class DataStreamsPlugin extends Plugin implements ActionPlugin, HealthPlu
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>();
actions.add(new ActionHandler<>(CreateDataStreamAction.INSTANCE, CreateDataStreamTransportAction.class));
actions.add(new ActionHandler<>(DeleteDataStreamAction.INSTANCE, DeleteDataStreamTransportAction.class));
actions.add(new ActionHandler<>(GetDataStreamAction.INSTANCE, TransportGetDataStreamsAction.class));
actions.add(new ActionHandler<>(DataStreamsStatsAction.INSTANCE, DataStreamsStatsTransportAction.class));
actions.add(new ActionHandler<>(MigrateToDataStreamAction.INSTANCE, MigrateToDataStreamTransportAction.class));
actions.add(new ActionHandler<>(PromoteDataStreamAction.INSTANCE, PromoteDataStreamTransportAction.class));
actions.add(new ActionHandler<>(ModifyDataStreamsAction.INSTANCE, ModifyDataStreamsTransportAction.class));
actions.add(new ActionHandler<>(PutDataStreamLifecycleAction.INSTANCE, TransportPutDataStreamLifecycleAction.class));
actions.add(new ActionHandler<>(GetDataStreamLifecycleAction.INSTANCE, TransportGetDataStreamLifecycleAction.class));
actions.add(new ActionHandler<>(DeleteDataStreamLifecycleAction.INSTANCE, TransportDeleteDataStreamLifecycleAction.class));
actions.add(new ActionHandler<>(ExplainDataStreamLifecycleAction.INSTANCE, TransportExplainDataStreamLifecycleAction.class));
actions.add(new ActionHandler<>(GetDataStreamLifecycleStatsAction.INSTANCE, TransportGetDataStreamLifecycleStatsAction.class));
public List<ActionHandler> getActions() {
List<ActionHandler> actions = new ArrayList<>();
actions.add(new ActionHandler(CreateDataStreamAction.INSTANCE, CreateDataStreamTransportAction.class));
actions.add(new ActionHandler(DeleteDataStreamAction.INSTANCE, DeleteDataStreamTransportAction.class));
actions.add(new ActionHandler(GetDataStreamAction.INSTANCE, TransportGetDataStreamsAction.class));
actions.add(new ActionHandler(DataStreamsStatsAction.INSTANCE, DataStreamsStatsTransportAction.class));
actions.add(new ActionHandler(MigrateToDataStreamAction.INSTANCE, MigrateToDataStreamTransportAction.class));
actions.add(new ActionHandler(PromoteDataStreamAction.INSTANCE, PromoteDataStreamTransportAction.class));
actions.add(new ActionHandler(ModifyDataStreamsAction.INSTANCE, ModifyDataStreamsTransportAction.class));
actions.add(new ActionHandler(PutDataStreamLifecycleAction.INSTANCE, TransportPutDataStreamLifecycleAction.class));
actions.add(new ActionHandler(GetDataStreamLifecycleAction.INSTANCE, TransportGetDataStreamLifecycleAction.class));
actions.add(new ActionHandler(DeleteDataStreamLifecycleAction.INSTANCE, TransportDeleteDataStreamLifecycleAction.class));
actions.add(new ActionHandler(ExplainDataStreamLifecycleAction.INSTANCE, TransportExplainDataStreamLifecycleAction.class));
actions.add(new ActionHandler(GetDataStreamLifecycleStatsAction.INSTANCE, TransportGetDataStreamLifecycleStatsAction.class));
if (DataStream.isFailureStoreFeatureFlagEnabled()) {
actions.add(new ActionHandler<>(GetDataStreamOptionsAction.INSTANCE, TransportGetDataStreamOptionsAction.class));
actions.add(new ActionHandler<>(PutDataStreamOptionsAction.INSTANCE, TransportPutDataStreamOptionsAction.class));
actions.add(new ActionHandler<>(DeleteDataStreamOptionsAction.INSTANCE, TransportDeleteDataStreamOptionsAction.class));
actions.add(new ActionHandler(GetDataStreamOptionsAction.INSTANCE, TransportGetDataStreamOptionsAction.class));
actions.add(new ActionHandler(PutDataStreamOptionsAction.INSTANCE, TransportPutDataStreamOptionsAction.class));
actions.add(new ActionHandler(DeleteDataStreamOptionsAction.INSTANCE, TransportDeleteDataStreamOptionsAction.class));
}
return actions;
}

View file

@ -9,8 +9,6 @@
package org.elasticsearch.ingest.common;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@ -81,8 +79,8 @@ public class IngestCommonPlugin extends Plugin implements ActionPlugin, IngestPl
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return List.of(new ActionHandler<>(GrokProcessorGetAction.INSTANCE, GrokProcessorGetAction.TransportAction.class));
public List<ActionHandler> getActions() {
return List.of(new ActionHandler(GrokProcessorGetAction.INSTANCE, GrokProcessorGetAction.TransportAction.class));
}
@Override

View file

@ -10,8 +10,6 @@
package org.elasticsearch.ingest.geoip;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.cluster.NamedDiff;
import org.elasticsearch.cluster.metadata.IndexMetadata;
@ -182,12 +180,12 @@ public class IngestGeoIpPlugin extends Plugin
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(GeoIpStatsAction.INSTANCE, GeoIpStatsTransportAction.class),
new ActionHandler<>(GetDatabaseConfigurationAction.INSTANCE, TransportGetDatabaseConfigurationAction.class),
new ActionHandler<>(DeleteDatabaseConfigurationAction.INSTANCE, TransportDeleteDatabaseConfigurationAction.class),
new ActionHandler<>(PutDatabaseConfigurationAction.INSTANCE, TransportPutDatabaseConfigurationAction.class)
new ActionHandler(GeoIpStatsAction.INSTANCE, GeoIpStatsTransportAction.class),
new ActionHandler(GetDatabaseConfigurationAction.INSTANCE, TransportGetDatabaseConfigurationAction.class),
new ActionHandler(DeleteDatabaseConfigurationAction.INSTANCE, TransportDeleteDatabaseConfigurationAction.class),
new ActionHandler(PutDatabaseConfigurationAction.INSTANCE, TransportPutDatabaseConfigurationAction.class)
);
}

View file

@ -9,8 +9,6 @@
package org.elasticsearch.script.mustache;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
@ -49,10 +47,10 @@ public class MustachePlugin extends Plugin implements ScriptPlugin, ActionPlugin
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return Arrays.asList(
new ActionHandler<>(SEARCH_TEMPLATE_ACTION, TransportSearchTemplateAction.class),
new ActionHandler<>(MULTI_SEARCH_TEMPLATE_ACTION, TransportMultiSearchTemplateAction.class)
new ActionHandler(SEARCH_TEMPLATE_ACTION, TransportSearchTemplateAction.class),
new ActionHandler(MULTI_SEARCH_TEMPLATE_ACTION, TransportMultiSearchTemplateAction.class)
);
}

View file

@ -10,8 +10,6 @@
package org.elasticsearch.painless;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@ -164,10 +162,10 @@ public final class PainlessPlugin extends Plugin implements ScriptPlugin, Extens
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>();
actions.add(new ActionHandler<>(PainlessExecuteAction.INSTANCE, PainlessExecuteAction.TransportAction.class));
actions.add(new ActionHandler<>(PainlessContextAction.INSTANCE, PainlessContextAction.TransportAction.class));
public List<ActionHandler> getActions() {
List<ActionHandler> actions = new ArrayList<>();
actions.add(new ActionHandler(PainlessExecuteAction.INSTANCE, PainlessExecuteAction.TransportAction.class));
actions.add(new ActionHandler(PainlessContextAction.INSTANCE, PainlessContextAction.TransportAction.class));
return actions;
}

View file

@ -9,8 +9,6 @@
package org.elasticsearch.index.rankeval;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
@ -38,8 +36,8 @@ public class RankEvalPlugin extends Plugin implements ActionPlugin {
public static final ActionType<RankEvalResponse> ACTION = new ActionType<>("indices:data/read/rank_eval");
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return Arrays.asList(new ActionHandler<>(ACTION, TransportRankEvalAction.class));
public List<ActionHandler> getActions() {
return Arrays.asList(new ActionHandler(ACTION, TransportRankEvalAction.class));
}
@Override

View file

@ -9,8 +9,6 @@
package org.elasticsearch.reindex;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
@ -47,12 +45,12 @@ public class ReindexPlugin extends Plugin implements ActionPlugin {
public static final ActionType<ListTasksResponse> RETHROTTLE_ACTION = new ActionType<>("cluster:admin/reindex/rethrottle");
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return Arrays.asList(
new ActionHandler<>(ReindexAction.INSTANCE, TransportReindexAction.class),
new ActionHandler<>(UpdateByQueryAction.INSTANCE, TransportUpdateByQueryAction.class),
new ActionHandler<>(DeleteByQueryAction.INSTANCE, TransportDeleteByQueryAction.class),
new ActionHandler<>(RETHROTTLE_ACTION, TransportRethrottleAction.class)
new ActionHandler(ReindexAction.INSTANCE, TransportReindexAction.class),
new ActionHandler(UpdateByQueryAction.INSTANCE, TransportUpdateByQueryAction.class),
new ActionHandler(DeleteByQueryAction.INSTANCE, TransportDeleteByQueryAction.class),
new ActionHandler(RETHROTTLE_ACTION, TransportRethrottleAction.class)
);
}

View file

@ -9,8 +9,6 @@
package org.elasticsearch.rest.root;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
@ -49,7 +47,7 @@ public class MainRestPlugin extends Plugin implements ActionPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return List.of(new ActionHandler<>(MAIN_ACTION, TransportMainAction.class));
public List<ActionHandler> getActions() {
return List.of(new ActionHandler(MAIN_ACTION, TransportMainAction.class));
}
}

View file

@ -340,8 +340,8 @@ public class Netty4ChunkedContinuationsIT extends ESNetty4IntegTestCase {
private static final ActionType<YieldsContinuationsPlugin.Response> TYPE = new ActionType<>("test:yields_continuations");
@Override
public Collection<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return List.of(new ActionHandler<>(TYPE, TransportYieldsContinuationsAction.class));
public Collection<ActionHandler> getActions() {
return List.of(new ActionHandler(TYPE, TransportYieldsContinuationsAction.class));
}
public static class Request extends ActionRequest {
@ -521,8 +521,8 @@ public class Netty4ChunkedContinuationsIT extends ESNetty4IntegTestCase {
private static final ActionType<Response> TYPE = new ActionType<>("test:infinite_continuations");
@Override
public Collection<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return List.of(new ActionHandler<>(TYPE, TransportInfiniteContinuationsAction.class));
public Collection<ActionHandler> getActions() {
return List.of(new ActionHandler(TYPE, TransportInfiniteContinuationsAction.class));
}
public static class Request extends ActionRequest {

View file

@ -603,8 +603,8 @@ public class CancellableTasksIT extends ESIntegTestCase {
public static class TaskPlugin extends Plugin implements ActionPlugin {
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return Collections.singletonList(new ActionHandler<>(TransportTestAction.ACTION, TransportTestAction.class));
public List<ActionHandler> getActions() {
return Collections.singletonList(new ActionHandler(TransportTestAction.ACTION, TransportTestAction.class));
}
}

View file

@ -137,8 +137,8 @@ public class ListTasksIT extends ESSingleNodeTestCase {
volatile CyclicBarrier barrier;
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return List.of(new ActionHandler<>(TEST_ACTION, TestTransportAction.class));
public List<ActionHandler> getActions() {
return List.of(new ActionHandler(TEST_ACTION, TestTransportAction.class));
}
}

View file

@ -11,7 +11,6 @@ package org.elasticsearch.action.support.master;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
@ -230,8 +229,8 @@ public class TransportMasterNodeActionIT extends ESIntegTestCase {
public static final class TestActionPlugin extends Plugin implements ActionPlugin {
@Override
public Collection<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return List.of(new ActionHandler<>(TEST_ACTION_TYPE, TestTransportAction.class));
public Collection<ActionHandler> getActions() {
return List.of(new ActionHandler(TEST_ACTION_TYPE, TestTransportAction.class));
}
}

View file

@ -11,8 +11,6 @@ package org.elasticsearch.action.support.replication;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.PlainActionFuture;
@ -128,8 +126,8 @@ public class TransportReplicationActionBypassCircuitBreakerOnReplicaIT extends E
public TestPlugin() {}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return List.of(new ActionHandler<>(TestAction.TYPE, TestAction.class));
public List<ActionHandler> getActions() {
return List.of(new ActionHandler(TestAction.TYPE, TestAction.class));
}
}

View file

@ -10,8 +10,6 @@
package org.elasticsearch.action.support.replication;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.cluster.action.shard.ShardStateAction;
@ -141,8 +139,8 @@ public class TransportReplicationActionRetryOnClosedNodeIT extends ESIntegTestCa
public TestPlugin() {}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return List.of(new ActionHandler<>(TestAction.TYPE, TestAction.class));
public List<ActionHandler> getActions() {
return List.of(new ActionHandler(TestAction.TYPE, TestAction.class));
}
@Override

View file

@ -93,8 +93,8 @@ public class MockedRequestActionBasedRerankerIT extends AbstractRerankerIT {
public static class RerankerServicePlugin extends Plugin implements ActionPlugin {
@Override
public Collection<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return List.of(new ActionHandler<>(TEST_RERANKING_ACTION_TYPE, TestRerankingTransportAction.class));
public Collection<ActionHandler> getActions() {
return List.of(new ActionHandler(TEST_RERANKING_ACTION_TYPE, TestRerankingTransportAction.class));
}
}

View file

@ -443,7 +443,7 @@ public class ActionModule extends AbstractModule {
private final ClusterSettings clusterSettings;
private final SettingsFilter settingsFilter;
private final List<ActionPlugin> actionPlugins;
private final Map<String, ActionHandler<?, ?>> actions;
private final Map<String, ActionHandler> actions;
private final ActionFilters actionFilters;
private final IncrementalBulkService bulkService;
private final ProjectIdResolver projectIdResolver;
@ -605,18 +605,18 @@ public class ActionModule extends AbstractModule {
}
}
public Map<String, ActionHandler<?, ?>> getActions() {
public Map<String, ActionHandler> getActions() {
return actions;
}
static Map<String, ActionHandler<?, ?>> setupActions(List<ActionPlugin> actionPlugins) {
static Map<String, ActionHandler> setupActions(List<ActionPlugin> actionPlugins) {
// Subclass NamedRegistry for easy registration
class ActionRegistry extends NamedRegistry<ActionHandler<?, ?>> {
class ActionRegistry extends NamedRegistry<ActionHandler> {
ActionRegistry() {
super("action");
}
public void register(ActionHandler<?, ?> handler) {
public void register(ActionHandler handler) {
register(handler.getAction().name(), handler);
}
@ -624,7 +624,7 @@ public class ActionModule extends AbstractModule {
ActionType<Response> action,
Class<? extends TransportAction<Request, Response>> transportAction
) {
register(new ActionHandler<>(action, transportAction));
register(new ActionHandler(action, transportAction));
}
}
ActionRegistry actions = new ActionRegistry();
@ -1053,7 +1053,7 @@ public class ActionModule extends AbstractModule {
ActionType.class,
TransportAction.class
);
for (ActionHandler<?, ?> action : actions.values()) {
for (ActionHandler action : actions.values()) {
// bind the action as eager singleton, so the map binder one will reuse it
bind(action.getTransportAction()).asEagerSingleton();
transportActionsBinder.addBinding(action.getAction()).to(action.getTransportAction()).asEagerSingleton();

View file

@ -36,7 +36,7 @@ import java.util.function.Supplier;
*/
public class NodeClient extends AbstractClient {
private Map<ActionType<? extends ActionResponse>, TransportAction<? extends ActionRequest, ? extends ActionResponse>> actions;
private Map<ActionType<?>, TransportAction<?, ?>> actions;
private TaskManager taskManager;
@ -53,7 +53,7 @@ public class NodeClient extends AbstractClient {
}
public void initialize(
Map<ActionType<? extends ActionResponse>, TransportAction<? extends ActionRequest, ? extends ActionResponse>> actions,
Map<ActionType<?>, TransportAction<?, ?>> actions,
TaskManager taskManager,
Supplier<String> localNodeId,
Transport.Connection localConnection,

View file

@ -16,8 +16,6 @@ import org.apache.lucene.util.SetOnce;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.action.ActionModule;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.admin.cluster.repositories.reservedstate.ReservedRepositoryAction;
import org.elasticsearch.action.admin.indices.template.reservedstate.ReservedComposableIndexTemplateAction;
@ -1459,8 +1457,7 @@ class NodeConstruction {
// Due to Java's type erasure with generics, the injector can't give us exactly what we need, and we have
// to resort to some evil casting.
@SuppressWarnings("rawtypes")
Map<ActionType<? extends ActionResponse>, TransportAction<? extends ActionRequest, ? extends ActionResponse>> actions =
forciblyCast(injector.getInstance(new Key<Map<ActionType, TransportAction>>() {
Map<ActionType<?>, TransportAction<?, ?>> actions = forciblyCast(injector.getInstance(new Key<Map<ActionType, TransportAction>>() {
}));
client.initialize(

View file

@ -9,8 +9,6 @@
package org.elasticsearch.plugins;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.RequestValidators;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
@ -41,10 +39,10 @@ import java.util.function.Supplier;
* <pre>{@code
* {@literal @}Override
* public List<ActionHandler<?, ?>> getActions() {
* return List.of(new ActionHandler<>(ReindexAction.INSTANCE, TransportReindexAction.class),
* new ActionHandler<>(UpdateByQueryAction.INSTANCE, TransportUpdateByQueryAction.class),
* new ActionHandler<>(DeleteByQueryAction.INSTANCE, TransportDeleteByQueryAction.class),
* new ActionHandler<>(RethrottleAction.INSTANCE, TransportRethrottleAction.class));
* return List.of(new ActionHandler(ReindexAction.INSTANCE, TransportReindexAction.class),
* new ActionHandler(UpdateByQueryAction.INSTANCE, TransportUpdateByQueryAction.class),
* new ActionHandler(DeleteByQueryAction.INSTANCE, TransportDeleteByQueryAction.class),
* new ActionHandler(RethrottleAction.INSTANCE, TransportRethrottleAction.class));
* }
* }</pre>
*/
@ -52,7 +50,7 @@ public interface ActionPlugin {
/**
* Actions added by this plugin.
*/
default Collection<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
default Collection<ActionHandler> getActions() {
return Collections.emptyList();
}
@ -101,23 +99,23 @@ public interface ActionPlugin {
return Collections.emptyList();
}
final class ActionHandler<Request extends ActionRequest, Response extends ActionResponse> {
private final ActionType<Response> action;
private final Class<? extends TransportAction<Request, Response>> transportAction;
final class ActionHandler {
private final ActionType<?> action;
private final Class<? extends TransportAction<?, ?>> transportAction;
/**
* Create a record of an action, the {@linkplain TransportAction} that handles it.
*/
public ActionHandler(ActionType<Response> action, Class<? extends TransportAction<Request, Response>> transportAction) {
public ActionHandler(ActionType<?> action, Class<? extends TransportAction<?, ?>> transportAction) {
this.action = action;
this.transportAction = transportAction;
}
public ActionType<Response> getAction() {
public ActionType<?> getAction() {
return action;
}
public Class<? extends TransportAction<Request, Response>> getTransportAction() {
public Class<? extends TransportAction<?, ?>> getTransportAction() {
return transportAction;
}
@ -131,7 +129,7 @@ public interface ActionPlugin {
if (obj == null || obj.getClass() != ActionHandler.class) {
return false;
}
ActionHandler<?, ?> other = (ActionHandler<?, ?>) obj;
ActionHandler other = (ActionHandler) obj;
return Objects.equals(action, other.action) && Objects.equals(transportAction, other.transportAction);
}

View file

@ -65,18 +65,15 @@ public class ActionModuleTests extends ESTestCase {
public void testSetupActionsContainsKnownBuiltin() {
assertThat(
ActionModule.setupActions(emptyList()),
hasEntry(
TransportNodesInfoAction.TYPE.name(),
new ActionHandler<>(TransportNodesInfoAction.TYPE, TransportNodesInfoAction.class)
)
hasEntry(TransportNodesInfoAction.TYPE.name(), new ActionHandler(TransportNodesInfoAction.TYPE, TransportNodesInfoAction.class))
);
}
public void testPluginCantOverwriteBuiltinAction() {
ActionPlugin dupsMainAction = new ActionPlugin() {
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return singletonList(new ActionHandler<>(TransportNodesInfoAction.TYPE, TransportNodesInfoAction.class));
public List<ActionHandler> getActions() {
return singletonList(new ActionHandler(TransportNodesInfoAction.TYPE, TransportNodesInfoAction.class));
}
};
Exception e = expectThrows(IllegalArgumentException.class, () -> ActionModule.setupActions(singletonList(dupsMainAction)));
@ -101,13 +98,13 @@ public class ActionModuleTests extends ESTestCase {
final var action = new ActionType<>("fake");
ActionPlugin registersFakeAction = new ActionPlugin() {
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return singletonList(new ActionHandler<>(action, FakeTransportAction.class));
public List<ActionHandler> getActions() {
return singletonList(new ActionHandler(action, FakeTransportAction.class));
}
};
assertThat(
ActionModule.setupActions(singletonList(registersFakeAction)),
hasEntry("fake", new ActionHandler<>(action, FakeTransportAction.class))
hasEntry("fake", new ActionHandler(action, FakeTransportAction.class))
);
}

View file

@ -11,8 +11,6 @@ package org.elasticsearch.action.admin.cluster.node.tasks;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.FailedNodeException;
import org.elasticsearch.action.IndicesRequest;
@ -77,10 +75,10 @@ public class TestTaskPlugin extends Plugin implements ActionPlugin, NetworkPlugi
public static final ActionType<UnblockTestTasksResponse> UNBLOCK_TASK_ACTION = new ActionType<>("cluster:admin/tasks/testunblock");
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return Arrays.asList(
new ActionHandler<>(TEST_TASK_ACTION, TransportTestTaskAction.class),
new ActionHandler<>(UNBLOCK_TASK_ACTION, TransportUnblockTestTasksAction.class)
new ActionHandler(TEST_TASK_ACTION, TransportTestTaskAction.class),
new ActionHandler(UNBLOCK_TASK_ACTION, TransportUnblockTestTasksAction.class)
);
}

View file

@ -73,8 +73,8 @@ public class TransportActionFilterChainRefCountingTests extends ESSingleNodeTest
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return List.of(new ActionHandler<>(TYPE, TestAction.class));
public List<ActionHandler> getActions() {
return List.of(new ActionHandler(TYPE, TestAction.class));
}
@Override

View file

@ -24,7 +24,10 @@ import org.elasticsearch.tasks.TaskManager;
import org.elasticsearch.transport.Transport;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.mockito.Mockito.mock;
@ -36,23 +39,13 @@ public class NodeClientHeadersTests extends AbstractClientHeadersTestCase {
protected Client buildClient(Settings headersSettings, ActionType<?>[] testedActions) {
Settings settings = HEADER_SETTINGS;
TaskManager taskManager = new TaskManager(settings, threadPool, Collections.emptySet());
Actions actions = new Actions(testedActions, taskManager);
Map<ActionType<?>, TransportAction<?, ?>> actions = Stream.of(testedActions)
.collect(Collectors.toMap(Function.identity(), a -> new InternalTransportAction(a.name(), taskManager)));
NodeClient client = new NodeClient(settings, threadPool);
client.initialize(actions, taskManager, () -> "test", mock(Transport.Connection.class), null);
return client;
}
private static class Actions extends HashMap<
ActionType<? extends ActionResponse>,
TransportAction<? extends ActionRequest, ? extends ActionResponse>> {
private Actions(ActionType<?>[] actions, TaskManager taskManager) {
for (ActionType<?> action : actions) {
put(action, new InternalTransportAction(action.name(), taskManager));
}
}
}
private static class InternalTransportAction extends TransportAction<ActionRequest, ActionResponse> {
private InternalTransportAction(String actionName, TaskManager taskManager) {

View file

@ -12,7 +12,6 @@ package org.elasticsearch.indices.cluster;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.admin.cluster.reroute.ClusterRerouteRequest;
@ -265,8 +264,7 @@ public class ClusterStateChanges {
}
};
NodeClient client = new NodeClient(Settings.EMPTY, threadPool);
Map<ActionType<? extends ActionResponse>, TransportAction<? extends ActionRequest, ? extends ActionResponse>> actions =
new HashMap<>();
Map<ActionType<?>, TransportAction<?, ?>> actions = new HashMap<>();
actions.put(
TransportVerifyShardBeforeCloseAction.TYPE,
new TransportVerifyShardBeforeCloseAction(

View file

@ -10,7 +10,6 @@
package org.elasticsearch.indices.settings;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
@ -180,9 +179,9 @@ public class InternalOrPrivateSettingsPlugin extends Plugin implements ActionPlu
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return Collections.singletonList(
new ActionHandler<>(UpdateInternalOrPrivateAction.INSTANCE, TransportUpdateInternalOrPrivateAction.class)
new ActionHandler(UpdateInternalOrPrivateAction.INSTANCE, TransportUpdateInternalOrPrivateAction.class)
);
}

View file

@ -13,8 +13,6 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.FailedNodeException;
import org.elasticsearch.action.TaskOperationFailure;
@ -87,8 +85,8 @@ public class TestPersistentTasksPlugin extends Plugin implements ActionPlugin, P
);
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return Collections.singletonList(new ActionHandler<>(TEST_ACTION, TransportTestTaskAction.class));
public List<ActionHandler> getActions() {
return Collections.singletonList(new ActionHandler(TEST_ACTION, TransportTestTaskAction.class));
}
@Override

View file

@ -79,8 +79,7 @@ public class RestValidateQueryActionTests extends AbstractSearchTestCase {
protected void doExecute(Task task, ActionRequest request, ActionListener<ActionResponse> listener) {}
};
final Map<ActionType<? extends ActionResponse>, TransportAction<? extends ActionRequest, ? extends ActionResponse>> actions =
new HashMap<>();
final Map<ActionType<?>, TransportAction<?, ?>> actions = new HashMap<>();
actions.put(ValidateQueryAction.INSTANCE, transportAction);
client.initialize(actions, taskManager, () -> "local", mock(Transport.Connection.class), null);

View file

@ -13,8 +13,6 @@ import org.apache.logging.log4j.Level;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionRunnable;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.RequestValidators;
@ -2264,8 +2262,7 @@ public class SnapshotResiliencyTests extends ESTestCase {
threadPool
);
nodeConnectionsService = new NodeConnectionsService(clusterService.getSettings(), threadPool, transportService);
Map<ActionType<? extends ActionResponse>, TransportAction<? extends ActionRequest, ? extends ActionResponse>> actions =
new HashMap<>();
Map<ActionType<?>, TransportAction<?, ?>> actions = new HashMap<>();
actions.put(
GlobalCheckpointSyncAction.TYPE,
new GlobalCheckpointSyncAction(

View file

@ -10,8 +10,6 @@
package org.elasticsearch.multiproject;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@ -80,11 +78,11 @@ public class TestOnlyMultiProjectPlugin extends Plugin implements ActionPlugin {
}
@Override
public Collection<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public Collection<ActionHandler> getActions() {
if (multiProjectEnabled) {
return List.of(
new ActionHandler<>(PutProjectAction.INSTANCE, PutProjectAction.TransportPutProjectAction.class),
new ActionHandler<>(DeleteProjectAction.INSTANCE, DeleteProjectAction.TransportDeleteProjectAction.class)
new ActionHandler(PutProjectAction.INSTANCE, PutProjectAction.TransportPutProjectAction.class),
new ActionHandler(DeleteProjectAction.INSTANCE, DeleteProjectAction.TransportDeleteProjectAction.class)
);
} else {
return List.of();

View file

@ -54,7 +54,7 @@ public class NoOpNodeClient extends NodeClient {
@Override
public void initialize(
Map<ActionType<? extends ActionResponse>, TransportAction<? extends ActionRequest, ? extends ActionResponse>> actions,
Map<ActionType<?>, TransportAction<?, ?>> actions,
TaskManager taskManager,
Supplier<String> localNodeId,
Transport.Connection localConnection,

View file

@ -6,8 +6,6 @@
*/
package org.elasticsearch.xpack.analytics;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.index.mapper.Mapper;
@ -127,11 +125,11 @@ public class AnalyticsPlugin extends Plugin implements SearchPlugin, ActionPlugi
}
@Override
public List<ActionPlugin.ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionPlugin.ActionHandler> getActions() {
return List.of(
new ActionHandler<>(XPackUsageFeatureAction.ANALYTICS, AnalyticsUsageTransportAction.class),
new ActionHandler<>(XPackInfoFeatureAction.ANALYTICS, AnalyticsInfoTransportAction.class),
new ActionHandler<>(AnalyticsStatsAction.INSTANCE, TransportAnalyticsStatsAction.class)
new ActionHandler(XPackUsageFeatureAction.ANALYTICS, AnalyticsUsageTransportAction.class),
new ActionHandler(XPackInfoFeatureAction.ANALYTICS, AnalyticsInfoTransportAction.class),
new ActionHandler(AnalyticsStatsAction.INSTANCE, TransportAnalyticsStatsAction.class)
);
}

View file

@ -6,8 +6,6 @@
*/
package org.elasticsearch.xpack.search;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@ -36,11 +34,11 @@ import static org.elasticsearch.xpack.core.async.AsyncTaskMaintenanceService.ASY
public final class AsyncSearch extends Plugin implements ActionPlugin {
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return Arrays.asList(
new ActionHandler<>(SubmitAsyncSearchAction.INSTANCE, TransportSubmitAsyncSearchAction.class),
new ActionHandler<>(GetAsyncSearchAction.INSTANCE, TransportGetAsyncSearchAction.class),
new ActionHandler<>(GetAsyncStatusAction.INSTANCE, TransportGetAsyncStatusAction.class)
new ActionHandler(SubmitAsyncSearchAction.INSTANCE, TransportSubmitAsyncSearchAction.class),
new ActionHandler(GetAsyncSearchAction.INSTANCE, TransportGetAsyncSearchAction.class),
new ActionHandler(GetAsyncStatusAction.INSTANCE, TransportGetAsyncStatusAction.class)
);
}

View file

@ -8,8 +8,6 @@
package org.elasticsearch.xpack.autoscaling;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.NamedDiff;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
@ -121,12 +119,12 @@ public class Autoscaling extends Plugin implements ActionPlugin, ExtensiblePlugi
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(GetAutoscalingCapacityAction.INSTANCE, TransportGetAutoscalingCapacityAction.class),
new ActionHandler<>(DeleteAutoscalingPolicyAction.INSTANCE, TransportDeleteAutoscalingPolicyAction.class),
new ActionHandler<>(GetAutoscalingPolicyAction.INSTANCE, TransportGetAutoscalingPolicyAction.class),
new ActionHandler<>(PutAutoscalingPolicyAction.INSTANCE, TransportPutAutoscalingPolicyAction.class)
new ActionHandler(GetAutoscalingCapacityAction.INSTANCE, TransportGetAutoscalingCapacityAction.class),
new ActionHandler(DeleteAutoscalingPolicyAction.INSTANCE, TransportDeleteAutoscalingPolicyAction.class),
new ActionHandler(GetAutoscalingPolicyAction.INSTANCE, TransportGetAutoscalingPolicyAction.class),
new ActionHandler(PutAutoscalingPolicyAction.INSTANCE, TransportPutAutoscalingPolicyAction.class)
);
}

View file

@ -9,8 +9,6 @@ package org.elasticsearch.xpack.ccr;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.RequestValidators;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
@ -211,47 +209,47 @@ public class Ccr extends Plugin implements ActionPlugin, PersistentTaskPlugin, E
return Collections.singletonList(new ShardFollowTasksExecutor(client, threadPool, clusterService, settingsModule));
}
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
var usageAction = new ActionHandler<>(XPackUsageFeatureAction.CCR, CCRUsageTransportAction.class);
var infoAction = new ActionHandler<>(XPackInfoFeatureAction.CCR, CCRInfoTransportAction.class);
public List<ActionHandler> getActions() {
var usageAction = new ActionHandler(XPackUsageFeatureAction.CCR, CCRUsageTransportAction.class);
var infoAction = new ActionHandler(XPackInfoFeatureAction.CCR, CCRInfoTransportAction.class);
if (enabled == false) {
return Arrays.asList(usageAction, infoAction);
}
return Arrays.asList(
// internal actions
new ActionHandler<>(BulkShardOperationsAction.INSTANCE, TransportBulkShardOperationsAction.class),
new ActionHandler<>(ShardChangesAction.INSTANCE, ShardChangesAction.TransportAction.class),
new ActionHandler<>(
new ActionHandler(BulkShardOperationsAction.INSTANCE, TransportBulkShardOperationsAction.class),
new ActionHandler(ShardChangesAction.INSTANCE, ShardChangesAction.TransportAction.class),
new ActionHandler(
PutInternalCcrRepositoryAction.INSTANCE,
PutInternalCcrRepositoryAction.TransportPutInternalRepositoryAction.class
),
new ActionHandler<>(
new ActionHandler(
DeleteInternalCcrRepositoryAction.INSTANCE,
DeleteInternalCcrRepositoryAction.TransportDeleteInternalRepositoryAction.class
),
new ActionHandler<>(PutCcrRestoreSessionAction.INTERNAL_INSTANCE, PutCcrRestoreSessionAction.InternalTransportAction.class),
new ActionHandler<>(PutCcrRestoreSessionAction.INSTANCE, PutCcrRestoreSessionAction.TransportAction.class),
new ActionHandler<>(ClearCcrRestoreSessionAction.INTERNAL_INSTANCE, ClearCcrRestoreSessionAction.InternalTransportAction.class),
new ActionHandler<>(ClearCcrRestoreSessionAction.INSTANCE, ClearCcrRestoreSessionAction.TransportAction.class),
new ActionHandler<>(GetCcrRestoreFileChunkAction.INTERNAL_INSTANCE, GetCcrRestoreFileChunkAction.InternalTransportAction.class),
new ActionHandler<>(GetCcrRestoreFileChunkAction.INSTANCE, GetCcrRestoreFileChunkAction.TransportAction.class),
new ActionHandler(PutCcrRestoreSessionAction.INTERNAL_INSTANCE, PutCcrRestoreSessionAction.InternalTransportAction.class),
new ActionHandler(PutCcrRestoreSessionAction.INSTANCE, PutCcrRestoreSessionAction.TransportAction.class),
new ActionHandler(ClearCcrRestoreSessionAction.INTERNAL_INSTANCE, ClearCcrRestoreSessionAction.InternalTransportAction.class),
new ActionHandler(ClearCcrRestoreSessionAction.INSTANCE, ClearCcrRestoreSessionAction.TransportAction.class),
new ActionHandler(GetCcrRestoreFileChunkAction.INTERNAL_INSTANCE, GetCcrRestoreFileChunkAction.InternalTransportAction.class),
new ActionHandler(GetCcrRestoreFileChunkAction.INSTANCE, GetCcrRestoreFileChunkAction.TransportAction.class),
// stats action
new ActionHandler<>(FollowStatsAction.INSTANCE, TransportFollowStatsAction.class),
new ActionHandler<>(CcrStatsAction.INSTANCE, TransportCcrStatsAction.class),
new ActionHandler<>(FollowInfoAction.INSTANCE, TransportFollowInfoAction.class),
new ActionHandler(FollowStatsAction.INSTANCE, TransportFollowStatsAction.class),
new ActionHandler(CcrStatsAction.INSTANCE, TransportCcrStatsAction.class),
new ActionHandler(FollowInfoAction.INSTANCE, TransportFollowInfoAction.class),
// follow actions
new ActionHandler<>(PutFollowAction.INSTANCE, TransportPutFollowAction.class),
new ActionHandler<>(ResumeFollowAction.INSTANCE, TransportResumeFollowAction.class),
new ActionHandler<>(PauseFollowAction.INSTANCE, TransportPauseFollowAction.class),
new ActionHandler<>(UnfollowAction.INSTANCE, TransportUnfollowAction.class),
new ActionHandler(PutFollowAction.INSTANCE, TransportPutFollowAction.class),
new ActionHandler(ResumeFollowAction.INSTANCE, TransportResumeFollowAction.class),
new ActionHandler(PauseFollowAction.INSTANCE, TransportPauseFollowAction.class),
new ActionHandler(UnfollowAction.INSTANCE, TransportUnfollowAction.class),
// auto-follow actions
new ActionHandler<>(DeleteAutoFollowPatternAction.INSTANCE, TransportDeleteAutoFollowPatternAction.class),
new ActionHandler<>(PutAutoFollowPatternAction.INSTANCE, TransportPutAutoFollowPatternAction.class),
new ActionHandler<>(GetAutoFollowPatternAction.INSTANCE, TransportGetAutoFollowPatternAction.class),
new ActionHandler<>(ActivateAutoFollowPatternAction.INSTANCE, TransportActivateAutoFollowPatternAction.class),
new ActionHandler(DeleteAutoFollowPatternAction.INSTANCE, TransportDeleteAutoFollowPatternAction.class),
new ActionHandler(PutAutoFollowPatternAction.INSTANCE, TransportPutAutoFollowPatternAction.class),
new ActionHandler(GetAutoFollowPatternAction.INSTANCE, TransportGetAutoFollowPatternAction.class),
new ActionHandler(ActivateAutoFollowPatternAction.INSTANCE, TransportActivateAutoFollowPatternAction.class),
// forget follower action
new ActionHandler<>(ForgetFollowerAction.INSTANCE, TransportForgetFollowerAction.class),
new ActionHandler(ForgetFollowerAction.INSTANCE, TransportForgetFollowerAction.class),
usageAction,
infoAction
);

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.core.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.support.PlainActionFuture;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ClusterStateUpdateTask;
@ -289,9 +287,9 @@ public class DataStreamLifecycleUsageTransportActionIT extends ESIntegTestCase {
*/
public static final class TestDateLifecycleUsagePlugin extends XPackClientPlugin {
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>();
actions.add(new ActionPlugin.ActionHandler<>(DATA_STREAM_LIFECYCLE, DataStreamLifecycleUsageTransportAction.class));
public List<ActionHandler> getActions() {
List<ActionHandler> actions = new ArrayList<>();
actions.add(new ActionPlugin.ActionHandler(DATA_STREAM_LIFECYCLE, DataStreamLifecycleUsageTransportAction.class));
return actions;
}
}

View file

@ -10,8 +10,6 @@ package org.elasticsearch.xpack.core.rest.action;
import org.apache.http.client.methods.HttpGet;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.PlainActionFuture;
@ -112,10 +110,10 @@ public class XPackUsageRestCancellationIT extends ESIntegTestCase {
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
final ArrayList<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>(super.getActions());
actions.add(new ActionHandler<>(BLOCKING_XPACK_USAGE, BlockingXPackUsageAction.class));
actions.add(new ActionHandler<>(NON_BLOCKING_XPACK_USAGE, NonBlockingXPackUsageAction.class));
public List<ActionHandler> getActions() {
final ArrayList<ActionHandler> actions = new ArrayList<>(super.getActions());
actions.add(new ActionHandler(BLOCKING_XPACK_USAGE, BlockingXPackUsageAction.class));
actions.add(new ActionHandler(NON_BLOCKING_XPACK_USAGE, NonBlockingXPackUsageAction.class));
return actions;
}
}

View file

@ -10,8 +10,6 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.SpecialPermission;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.support.TransportAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
@ -353,28 +351,28 @@ public class XPackPlugin extends XPackClientPlugin
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>();
actions.add(new ActionHandler<>(XPackInfoAction.INSTANCE, getInfoAction()));
actions.add(new ActionHandler<>(XPackUsageAction.INSTANCE, getUsageAction()));
actions.add(new ActionHandler<>(PutLicenseAction.INSTANCE, TransportPutLicenseAction.class));
actions.add(new ActionHandler<>(GetLicenseAction.INSTANCE, TransportGetLicenseAction.class));
actions.add(new ActionHandler<>(TransportDeleteLicenseAction.TYPE, TransportDeleteLicenseAction.class));
actions.add(new ActionHandler<>(PostStartTrialAction.INSTANCE, TransportPostStartTrialAction.class));
actions.add(new ActionHandler<>(GetTrialStatusAction.INSTANCE, TransportGetTrialStatusAction.class));
actions.add(new ActionHandler<>(PostStartBasicAction.INSTANCE, TransportPostStartBasicAction.class));
actions.add(new ActionHandler<>(GetBasicStatusAction.INSTANCE, TransportGetBasicStatusAction.class));
actions.add(new ActionHandler<>(TransportGetFeatureUsageAction.TYPE, TransportGetFeatureUsageAction.class));
actions.add(new ActionHandler<>(TermsEnumAction.INSTANCE, TransportTermsEnumAction.class));
actions.add(new ActionHandler<>(TransportDeleteAsyncResultAction.TYPE, TransportDeleteAsyncResultAction.class));
actions.add(new ActionHandler<>(XPackInfoFeatureAction.DATA_TIERS, DataTiersInfoTransportAction.class));
actions.add(new ActionHandler<>(XPackUsageFeatureAction.DATA_TIERS, DataTiersUsageTransportAction.class));
actions.add(new ActionHandler<>(XPackUsageFeatureAction.DATA_STREAMS, DataStreamUsageTransportAction.class));
actions.add(new ActionHandler<>(XPackInfoFeatureAction.DATA_STREAMS, DataStreamInfoTransportAction.class));
actions.add(new ActionHandler<>(XPackUsageFeatureAction.DATA_STREAM_LIFECYCLE, DataStreamLifecycleUsageTransportAction.class));
actions.add(new ActionHandler<>(XPackUsageFeatureAction.HEALTH, HealthApiUsageTransportAction.class));
actions.add(new ActionHandler<>(XPackUsageFeatureAction.REMOTE_CLUSTERS, RemoteClusterUsageTransportAction.class));
actions.add(new ActionHandler<>(NodesDataTiersUsageTransportAction.TYPE, NodesDataTiersUsageTransportAction.class));
public List<ActionHandler> getActions() {
List<ActionHandler> actions = new ArrayList<>();
actions.add(new ActionHandler(XPackInfoAction.INSTANCE, getInfoAction()));
actions.add(new ActionHandler(XPackUsageAction.INSTANCE, getUsageAction()));
actions.add(new ActionHandler(PutLicenseAction.INSTANCE, TransportPutLicenseAction.class));
actions.add(new ActionHandler(GetLicenseAction.INSTANCE, TransportGetLicenseAction.class));
actions.add(new ActionHandler(TransportDeleteLicenseAction.TYPE, TransportDeleteLicenseAction.class));
actions.add(new ActionHandler(PostStartTrialAction.INSTANCE, TransportPostStartTrialAction.class));
actions.add(new ActionHandler(GetTrialStatusAction.INSTANCE, TransportGetTrialStatusAction.class));
actions.add(new ActionHandler(PostStartBasicAction.INSTANCE, TransportPostStartBasicAction.class));
actions.add(new ActionHandler(GetBasicStatusAction.INSTANCE, TransportGetBasicStatusAction.class));
actions.add(new ActionHandler(TransportGetFeatureUsageAction.TYPE, TransportGetFeatureUsageAction.class));
actions.add(new ActionHandler(TermsEnumAction.INSTANCE, TransportTermsEnumAction.class));
actions.add(new ActionHandler(TransportDeleteAsyncResultAction.TYPE, TransportDeleteAsyncResultAction.class));
actions.add(new ActionHandler(XPackInfoFeatureAction.DATA_TIERS, DataTiersInfoTransportAction.class));
actions.add(new ActionHandler(XPackUsageFeatureAction.DATA_TIERS, DataTiersUsageTransportAction.class));
actions.add(new ActionHandler(XPackUsageFeatureAction.DATA_STREAMS, DataStreamUsageTransportAction.class));
actions.add(new ActionHandler(XPackInfoFeatureAction.DATA_STREAMS, DataStreamInfoTransportAction.class));
actions.add(new ActionHandler(XPackUsageFeatureAction.DATA_STREAM_LIFECYCLE, DataStreamLifecycleUsageTransportAction.class));
actions.add(new ActionHandler(XPackUsageFeatureAction.HEALTH, HealthApiUsageTransportAction.class));
actions.add(new ActionHandler(XPackUsageFeatureAction.REMOTE_CLUSTERS, RemoteClusterUsageTransportAction.class));
actions.add(new ActionHandler(NodesDataTiersUsageTransportAction.TYPE, NodesDataTiersUsageTransportAction.class));
return actions;
}

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.core;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.RequestValidators;
import org.elasticsearch.action.admin.cluster.snapshots.features.ResetFeatureStateResponse;
import org.elasticsearch.action.admin.cluster.snapshots.features.ResetFeatureStateResponse.ResetFeatureStateStatus;
@ -220,8 +218,8 @@ public class LocalStateCompositeXPackPlugin extends XPackPlugin
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>(super.getActions());
public List<ActionHandler> getActions() {
List<ActionHandler> actions = new ArrayList<>(super.getActions());
filterPlugins(ActionPlugin.class).forEach(p -> actions.addAll(p.getActions()));
return actions;
}

View file

@ -79,8 +79,7 @@ public class RestTermsEnumActionTests extends ESTestCase {
protected void doExecute(Task task, ActionRequest request, ActionListener<ActionResponse> listener) {}
};
final Map<ActionType<? extends ActionResponse>, TransportAction<? extends ActionRequest, ? extends ActionResponse>> actions =
new HashMap<>();
final Map<ActionType<?>, TransportAction<?, ?>> actions = new HashMap<>();
actions.put(TermsEnumAction.INSTANCE, transportAction);
client.initialize(actions, taskManager, () -> "local", mock(Transport.Connection.class), null);

View file

@ -6,8 +6,6 @@
*/
package org.elasticsearch.xpack.deprecation;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@ -56,11 +54,11 @@ public class Deprecation extends Plugin implements ActionPlugin {
);
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(DeprecationInfoAction.INSTANCE, TransportDeprecationInfoAction.class),
new ActionHandler<>(NodesDeprecationCheckAction.INSTANCE, TransportNodeDeprecationCheckAction.class),
new ActionHandler<>(DeprecationCacheResetAction.INSTANCE, TransportDeprecationCacheResetAction.class)
new ActionHandler(DeprecationInfoAction.INSTANCE, TransportDeprecationInfoAction.class),
new ActionHandler(NodesDeprecationCheckAction.INSTANCE, TransportNodeDeprecationCheckAction.class),
new ActionHandler(DeprecationCacheResetAction.INSTANCE, TransportDeprecationCacheResetAction.class)
);
}

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.downsample;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.downsample.DownsampleAction;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
@ -63,10 +61,10 @@ public class Downsample extends Plugin implements ActionPlugin, PersistentTaskPl
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(DownsampleAction.INSTANCE, TransportDownsampleAction.class),
new ActionHandler<>(
new ActionHandler(DownsampleAction.INSTANCE, TransportDownsampleAction.class),
new ActionHandler(
DownsampleShardPersistentTaskExecutor.DelegatingAction.INSTANCE,
DownsampleShardPersistentTaskExecutor.DelegatingAction.TA.class
)

View file

@ -6,8 +6,6 @@
*/
package org.elasticsearch.xpack.enrich;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.NamedDiff;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.metadata.Metadata;
@ -211,20 +209,20 @@ public class EnrichPlugin extends Plugin implements SystemIndexPlugin, IngestPlu
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(XPackInfoFeatureAction.ENRICH, EnrichInfoTransportAction.class),
new ActionHandler<>(XPackUsageFeatureAction.ENRICH, EnrichUsageTransportAction.class),
new ActionHandler<>(GetEnrichPolicyAction.INSTANCE, TransportGetEnrichPolicyAction.class),
new ActionHandler<>(DeleteEnrichPolicyAction.INSTANCE, TransportDeleteEnrichPolicyAction.class),
new ActionHandler<>(PutEnrichPolicyAction.INSTANCE, TransportPutEnrichPolicyAction.class),
new ActionHandler<>(ExecuteEnrichPolicyAction.INSTANCE, TransportExecuteEnrichPolicyAction.class),
new ActionHandler<>(EnrichStatsAction.INSTANCE, TransportEnrichStatsAction.class),
new ActionHandler<>(EnrichCoordinatorProxyAction.INSTANCE, EnrichCoordinatorProxyAction.TransportAction.class),
new ActionHandler<>(EnrichShardMultiSearchAction.INSTANCE, EnrichShardMultiSearchAction.TransportAction.class),
new ActionHandler<>(EnrichCoordinatorStatsAction.INSTANCE, EnrichCoordinatorStatsAction.TransportAction.class),
new ActionHandler<>(EnrichReindexAction.INSTANCE, TransportEnrichReindexAction.class),
new ActionHandler<>(InternalExecutePolicyAction.INSTANCE, InternalExecutePolicyAction.Transport.class)
new ActionHandler(XPackInfoFeatureAction.ENRICH, EnrichInfoTransportAction.class),
new ActionHandler(XPackUsageFeatureAction.ENRICH, EnrichUsageTransportAction.class),
new ActionHandler(GetEnrichPolicyAction.INSTANCE, TransportGetEnrichPolicyAction.class),
new ActionHandler(DeleteEnrichPolicyAction.INSTANCE, TransportDeleteEnrichPolicyAction.class),
new ActionHandler(PutEnrichPolicyAction.INSTANCE, TransportPutEnrichPolicyAction.class),
new ActionHandler(ExecuteEnrichPolicyAction.INSTANCE, TransportExecuteEnrichPolicyAction.class),
new ActionHandler(EnrichStatsAction.INSTANCE, TransportEnrichStatsAction.class),
new ActionHandler(EnrichCoordinatorProxyAction.INSTANCE, EnrichCoordinatorProxyAction.TransportAction.class),
new ActionHandler(EnrichShardMultiSearchAction.INSTANCE, EnrichShardMultiSearchAction.TransportAction.class),
new ActionHandler(EnrichCoordinatorStatsAction.INSTANCE, EnrichCoordinatorStatsAction.TransportAction.class),
new ActionHandler(EnrichReindexAction.INSTANCE, TransportEnrichReindexAction.class),
new ActionHandler(InternalExecutePolicyAction.INSTANCE, InternalExecutePolicyAction.Transport.class)
);
}

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.application;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@ -261,38 +259,38 @@ public class EnterpriseSearch extends Plugin implements ActionPlugin, SystemInde
public static final TimeValue HARD_CODED_ENTERPRISE_SEARCH_MASTER_NODE_TIMEOUT = TimeValue.THIRTY_SECONDS;
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
var usageAction = new ActionHandler<>(XPackUsageFeatureAction.ENTERPRISE_SEARCH, EnterpriseSearchUsageTransportAction.class);
var infoAction = new ActionHandler<>(XPackInfoFeatureAction.ENTERPRISE_SEARCH, EnterpriseSearchInfoTransportAction.class);
public List<ActionHandler> getActions() {
var usageAction = new ActionHandler(XPackUsageFeatureAction.ENTERPRISE_SEARCH, EnterpriseSearchUsageTransportAction.class);
var infoAction = new ActionHandler(XPackInfoFeatureAction.ENTERPRISE_SEARCH, EnterpriseSearchInfoTransportAction.class);
if (enabled == false) {
return List.of(usageAction, infoAction);
}
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actionHandlers = new ArrayList<>(
List<ActionHandler> actionHandlers = new ArrayList<>(
List.of(
// Behavioral Analytics
new ActionHandler<>(PutAnalyticsCollectionAction.INSTANCE, TransportPutAnalyticsCollectionAction.class),
new ActionHandler<>(GetAnalyticsCollectionAction.INSTANCE, TransportGetAnalyticsCollectionAction.class),
new ActionHandler<>(DeleteAnalyticsCollectionAction.INSTANCE, TransportDeleteAnalyticsCollectionAction.class),
new ActionHandler<>(PostAnalyticsEventAction.INSTANCE, TransportPostAnalyticsEventAction.class),
new ActionHandler(PutAnalyticsCollectionAction.INSTANCE, TransportPutAnalyticsCollectionAction.class),
new ActionHandler(GetAnalyticsCollectionAction.INSTANCE, TransportGetAnalyticsCollectionAction.class),
new ActionHandler(DeleteAnalyticsCollectionAction.INSTANCE, TransportDeleteAnalyticsCollectionAction.class),
new ActionHandler(PostAnalyticsEventAction.INSTANCE, TransportPostAnalyticsEventAction.class),
// Search Applications
new ActionHandler<>(DeleteSearchApplicationAction.INSTANCE, TransportDeleteSearchApplicationAction.class),
new ActionHandler<>(GetSearchApplicationAction.INSTANCE, TransportGetSearchApplicationAction.class),
new ActionHandler<>(ListSearchApplicationAction.INSTANCE, TransportListSearchApplicationAction.class),
new ActionHandler<>(PutSearchApplicationAction.INSTANCE, TransportPutSearchApplicationAction.class),
new ActionHandler<>(QuerySearchApplicationAction.INSTANCE, TransportQuerySearchApplicationAction.class),
new ActionHandler<>(RenderSearchApplicationQueryAction.INSTANCE, TransportRenderSearchApplicationQueryAction.class),
new ActionHandler(DeleteSearchApplicationAction.INSTANCE, TransportDeleteSearchApplicationAction.class),
new ActionHandler(GetSearchApplicationAction.INSTANCE, TransportGetSearchApplicationAction.class),
new ActionHandler(ListSearchApplicationAction.INSTANCE, TransportListSearchApplicationAction.class),
new ActionHandler(PutSearchApplicationAction.INSTANCE, TransportPutSearchApplicationAction.class),
new ActionHandler(QuerySearchApplicationAction.INSTANCE, TransportQuerySearchApplicationAction.class),
new ActionHandler(RenderSearchApplicationQueryAction.INSTANCE, TransportRenderSearchApplicationQueryAction.class),
// Query rules
new ActionHandler<>(DeleteQueryRulesetAction.INSTANCE, TransportDeleteQueryRulesetAction.class),
new ActionHandler<>(GetQueryRulesetAction.INSTANCE, TransportGetQueryRulesetAction.class),
new ActionHandler<>(ListQueryRulesetsAction.INSTANCE, TransportListQueryRulesetsAction.class),
new ActionHandler<>(PutQueryRulesetAction.INSTANCE, TransportPutQueryRulesetAction.class),
new ActionHandler<>(DeleteQueryRuleAction.INSTANCE, TransportDeleteQueryRuleAction.class),
new ActionHandler<>(GetQueryRuleAction.INSTANCE, TransportGetQueryRuleAction.class),
new ActionHandler<>(PutQueryRuleAction.INSTANCE, TransportPutQueryRuleAction.class),
new ActionHandler<>(TestQueryRulesetAction.INSTANCE, TransportTestQueryRulesetAction.class),
new ActionHandler(DeleteQueryRulesetAction.INSTANCE, TransportDeleteQueryRulesetAction.class),
new ActionHandler(GetQueryRulesetAction.INSTANCE, TransportGetQueryRulesetAction.class),
new ActionHandler(ListQueryRulesetsAction.INSTANCE, TransportListQueryRulesetsAction.class),
new ActionHandler(PutQueryRulesetAction.INSTANCE, TransportPutQueryRulesetAction.class),
new ActionHandler(DeleteQueryRuleAction.INSTANCE, TransportDeleteQueryRuleAction.class),
new ActionHandler(GetQueryRuleAction.INSTANCE, TransportGetQueryRuleAction.class),
new ActionHandler(PutQueryRuleAction.INSTANCE, TransportPutQueryRuleAction.class),
new ActionHandler(TestQueryRulesetAction.INSTANCE, TransportTestQueryRulesetAction.class),
usageAction,
infoAction
@ -304,44 +302,44 @@ public class EnterpriseSearch extends Plugin implements ActionPlugin, SystemInde
actionHandlers.addAll(
List.of(
// Connectors API
new ActionHandler<>(DeleteConnectorAction.INSTANCE, TransportDeleteConnectorAction.class),
new ActionHandler<>(GetConnectorAction.INSTANCE, TransportGetConnectorAction.class),
new ActionHandler<>(ListConnectorAction.INSTANCE, TransportListConnectorAction.class),
new ActionHandler<>(PostConnectorAction.INSTANCE, TransportPostConnectorAction.class),
new ActionHandler<>(PutConnectorAction.INSTANCE, TransportPutConnectorAction.class),
new ActionHandler<>(UpdateConnectorApiKeyIdAction.INSTANCE, TransportUpdateConnectorApiKeyIdAction.class),
new ActionHandler<>(UpdateConnectorConfigurationAction.INSTANCE, TransportUpdateConnectorConfigurationAction.class),
new ActionHandler<>(UpdateConnectorErrorAction.INSTANCE, TransportUpdateConnectorErrorAction.class),
new ActionHandler<>(UpdateConnectorFeaturesAction.INSTANCE, TransportUpdateConnectorFeaturesAction.class),
new ActionHandler<>(UpdateConnectorFilteringAction.INSTANCE, TransportUpdateConnectorFilteringAction.class),
new ActionHandler<>(UpdateConnectorActiveFilteringAction.INSTANCE, TransportUpdateConnectorActiveFilteringAction.class),
new ActionHandler<>(
new ActionHandler(DeleteConnectorAction.INSTANCE, TransportDeleteConnectorAction.class),
new ActionHandler(GetConnectorAction.INSTANCE, TransportGetConnectorAction.class),
new ActionHandler(ListConnectorAction.INSTANCE, TransportListConnectorAction.class),
new ActionHandler(PostConnectorAction.INSTANCE, TransportPostConnectorAction.class),
new ActionHandler(PutConnectorAction.INSTANCE, TransportPutConnectorAction.class),
new ActionHandler(UpdateConnectorApiKeyIdAction.INSTANCE, TransportUpdateConnectorApiKeyIdAction.class),
new ActionHandler(UpdateConnectorConfigurationAction.INSTANCE, TransportUpdateConnectorConfigurationAction.class),
new ActionHandler(UpdateConnectorErrorAction.INSTANCE, TransportUpdateConnectorErrorAction.class),
new ActionHandler(UpdateConnectorFeaturesAction.INSTANCE, TransportUpdateConnectorFeaturesAction.class),
new ActionHandler(UpdateConnectorFilteringAction.INSTANCE, TransportUpdateConnectorFilteringAction.class),
new ActionHandler(UpdateConnectorActiveFilteringAction.INSTANCE, TransportUpdateConnectorActiveFilteringAction.class),
new ActionHandler(
UpdateConnectorFilteringValidationAction.INSTANCE,
TransportUpdateConnectorFilteringValidationAction.class
),
new ActionHandler<>(UpdateConnectorIndexNameAction.INSTANCE, TransportUpdateConnectorIndexNameAction.class),
new ActionHandler<>(UpdateConnectorLastSeenAction.INSTANCE, TransportUpdateConnectorLastSeenAction.class),
new ActionHandler<>(UpdateConnectorLastSyncStatsAction.INSTANCE, TransportUpdateConnectorLastSyncStatsAction.class),
new ActionHandler<>(UpdateConnectorNameAction.INSTANCE, TransportUpdateConnectorNameAction.class),
new ActionHandler<>(UpdateConnectorNativeAction.INSTANCE, TransportUpdateConnectorNativeAction.class),
new ActionHandler<>(UpdateConnectorPipelineAction.INSTANCE, TransportUpdateConnectorPipelineAction.class),
new ActionHandler<>(UpdateConnectorSchedulingAction.INSTANCE, TransportUpdateConnectorSchedulingAction.class),
new ActionHandler<>(UpdateConnectorServiceTypeAction.INSTANCE, TransportUpdateConnectorServiceTypeAction.class),
new ActionHandler<>(UpdateConnectorStatusAction.INSTANCE, TransportUpdateConnectorStatusAction.class),
new ActionHandler(UpdateConnectorIndexNameAction.INSTANCE, TransportUpdateConnectorIndexNameAction.class),
new ActionHandler(UpdateConnectorLastSeenAction.INSTANCE, TransportUpdateConnectorLastSeenAction.class),
new ActionHandler(UpdateConnectorLastSyncStatsAction.INSTANCE, TransportUpdateConnectorLastSyncStatsAction.class),
new ActionHandler(UpdateConnectorNameAction.INSTANCE, TransportUpdateConnectorNameAction.class),
new ActionHandler(UpdateConnectorNativeAction.INSTANCE, TransportUpdateConnectorNativeAction.class),
new ActionHandler(UpdateConnectorPipelineAction.INSTANCE, TransportUpdateConnectorPipelineAction.class),
new ActionHandler(UpdateConnectorSchedulingAction.INSTANCE, TransportUpdateConnectorSchedulingAction.class),
new ActionHandler(UpdateConnectorServiceTypeAction.INSTANCE, TransportUpdateConnectorServiceTypeAction.class),
new ActionHandler(UpdateConnectorStatusAction.INSTANCE, TransportUpdateConnectorStatusAction.class),
// SyncJob API
new ActionHandler<>(GetConnectorSyncJobAction.INSTANCE, TransportGetConnectorSyncJobAction.class),
new ActionHandler<>(PostConnectorSyncJobAction.INSTANCE, TransportPostConnectorSyncJobAction.class),
new ActionHandler<>(DeleteConnectorSyncJobAction.INSTANCE, TransportDeleteConnectorSyncJobAction.class),
new ActionHandler<>(CheckInConnectorSyncJobAction.INSTANCE, TransportCheckInConnectorSyncJobAction.class),
new ActionHandler<>(CancelConnectorSyncJobAction.INSTANCE, TransportCancelConnectorSyncJobAction.class),
new ActionHandler<>(ListConnectorSyncJobsAction.INSTANCE, TransportListConnectorSyncJobsAction.class),
new ActionHandler<>(UpdateConnectorSyncJobErrorAction.INSTANCE, TransportUpdateConnectorSyncJobErrorAction.class),
new ActionHandler<>(
new ActionHandler(GetConnectorSyncJobAction.INSTANCE, TransportGetConnectorSyncJobAction.class),
new ActionHandler(PostConnectorSyncJobAction.INSTANCE, TransportPostConnectorSyncJobAction.class),
new ActionHandler(DeleteConnectorSyncJobAction.INSTANCE, TransportDeleteConnectorSyncJobAction.class),
new ActionHandler(CheckInConnectorSyncJobAction.INSTANCE, TransportCheckInConnectorSyncJobAction.class),
new ActionHandler(CancelConnectorSyncJobAction.INSTANCE, TransportCancelConnectorSyncJobAction.class),
new ActionHandler(ListConnectorSyncJobsAction.INSTANCE, TransportListConnectorSyncJobsAction.class),
new ActionHandler(UpdateConnectorSyncJobErrorAction.INSTANCE, TransportUpdateConnectorSyncJobErrorAction.class),
new ActionHandler(
UpdateConnectorSyncJobIngestionStatsAction.INSTANCE,
TransportUpdateConnectorSyncJobIngestionStatsAction.class
),
new ActionHandler<>(ClaimConnectorSyncJobAction.INSTANCE, TransportClaimConnectorSyncJobAction.class)
new ActionHandler(ClaimConnectorSyncJobAction.INSTANCE, TransportClaimConnectorSyncJobAction.class)
)
);
}
@ -349,10 +347,10 @@ public class EnterpriseSearch extends Plugin implements ActionPlugin, SystemInde
if (ConnectorSecretsFeature.isEnabled()) {
actionHandlers.addAll(
List.of(
new ActionHandler<>(DeleteConnectorSecretAction.INSTANCE, TransportDeleteConnectorSecretAction.class),
new ActionHandler<>(GetConnectorSecretAction.INSTANCE, TransportGetConnectorSecretAction.class),
new ActionHandler<>(PostConnectorSecretAction.INSTANCE, TransportPostConnectorSecretAction.class),
new ActionHandler<>(PutConnectorSecretAction.INSTANCE, TransportPutConnectorSecretAction.class)
new ActionHandler(DeleteConnectorSecretAction.INSTANCE, TransportDeleteConnectorSecretAction.class),
new ActionHandler(GetConnectorSecretAction.INSTANCE, TransportGetConnectorSecretAction.class),
new ActionHandler(PostConnectorSecretAction.INSTANCE, TransportPostConnectorSecretAction.class),
new ActionHandler(PutConnectorSecretAction.INSTANCE, TransportPutConnectorSecretAction.class)
)
);
}

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.application;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@ -66,7 +64,7 @@ public class LocalStateEnterpriseSearch extends LocalStateCompositeXPackPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return entSearchPlugin.getActions();
}

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.eql.plugin;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
@ -104,14 +102,14 @@ public class EqlPlugin extends Plugin implements ActionPlugin, CircuitBreakerPlu
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(EqlSearchAction.INSTANCE, TransportEqlSearchAction.class),
new ActionHandler<>(EqlStatsAction.INSTANCE, TransportEqlStatsAction.class),
new ActionHandler<>(EqlAsyncGetResultAction.INSTANCE, TransportEqlAsyncGetResultsAction.class),
new ActionHandler<>(EqlAsyncGetStatusAction.INSTANCE, TransportEqlAsyncGetStatusAction.class),
new ActionHandler<>(XPackUsageFeatureAction.EQL, EqlUsageTransportAction.class),
new ActionHandler<>(XPackInfoFeatureAction.EQL, EqlInfoTransportAction.class)
new ActionHandler(EqlSearchAction.INSTANCE, TransportEqlSearchAction.class),
new ActionHandler(EqlStatsAction.INSTANCE, TransportEqlStatsAction.class),
new ActionHandler(EqlAsyncGetResultAction.INSTANCE, TransportEqlAsyncGetResultsAction.class),
new ActionHandler(EqlAsyncGetStatusAction.INSTANCE, TransportEqlAsyncGetStatusAction.class),
new ActionHandler(XPackUsageFeatureAction.EQL, EqlUsageTransportAction.class),
new ActionHandler(XPackInfoFeatureAction.EQL, EqlInfoTransportAction.class)
);
}

View file

@ -6,8 +6,6 @@
*/
package org.elasticsearch.xpack.esql.plugin;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.breaker.CircuitBreaker;
@ -220,16 +218,16 @@ public class EsqlPlugin extends Plugin implements ActionPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(EsqlQueryAction.INSTANCE, TransportEsqlQueryAction.class),
new ActionHandler<>(EsqlAsyncGetResultAction.INSTANCE, TransportEsqlAsyncGetResultsAction.class),
new ActionHandler<>(EsqlStatsAction.INSTANCE, TransportEsqlStatsAction.class),
new ActionHandler<>(XPackUsageFeatureAction.ESQL, EsqlUsageTransportAction.class),
new ActionHandler<>(XPackInfoFeatureAction.ESQL, EsqlInfoTransportAction.class),
new ActionHandler<>(EsqlResolveFieldsAction.TYPE, EsqlResolveFieldsAction.class),
new ActionHandler<>(EsqlSearchShardsAction.TYPE, EsqlSearchShardsAction.class),
new ActionHandler<>(EsqlAsyncStopAction.INSTANCE, TransportEsqlAsyncStopAction.class)
new ActionHandler(EsqlQueryAction.INSTANCE, TransportEsqlQueryAction.class),
new ActionHandler(EsqlAsyncGetResultAction.INSTANCE, TransportEsqlAsyncGetResultsAction.class),
new ActionHandler(EsqlStatsAction.INSTANCE, TransportEsqlStatsAction.class),
new ActionHandler(XPackUsageFeatureAction.ESQL, EsqlUsageTransportAction.class),
new ActionHandler(XPackInfoFeatureAction.ESQL, EsqlInfoTransportAction.class),
new ActionHandler(EsqlResolveFieldsAction.TYPE, EsqlResolveFieldsAction.class),
new ActionHandler(EsqlSearchShardsAction.TYPE, EsqlSearchShardsAction.class),
new ActionHandler(EsqlAsyncStopAction.INSTANCE, TransportEsqlAsyncStopAction.class)
);
}

View file

@ -11,8 +11,6 @@ import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.ResourceNotFoundException;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.admin.cluster.snapshots.features.ResetFeatureStateResponse.ResetFeatureStateStatus;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
import org.elasticsearch.action.datastreams.DeleteDataStreamAction;
@ -345,13 +343,13 @@ public class Fleet extends Plugin implements SystemIndexPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(GetGlobalCheckpointsAction.INSTANCE, GetGlobalCheckpointsAction.LocalAction.class),
new ActionHandler<>(GetGlobalCheckpointsShardAction.INSTANCE, GetGlobalCheckpointsShardAction.TransportAction.class),
new ActionHandler<>(GetSecretAction.INSTANCE, TransportGetSecretAction.class),
new ActionHandler<>(PostSecretAction.INSTANCE, TransportPostSecretAction.class),
new ActionHandler<>(DeleteSecretAction.INSTANCE, TransportDeleteSecretAction.class)
new ActionHandler(GetGlobalCheckpointsAction.INSTANCE, GetGlobalCheckpointsAction.LocalAction.class),
new ActionHandler(GetGlobalCheckpointsShardAction.INSTANCE, GetGlobalCheckpointsShardAction.TransportAction.class),
new ActionHandler(GetSecretAction.INSTANCE, TransportGetSecretAction.class),
new ActionHandler(PostSecretAction.INSTANCE, TransportPostSecretAction.class),
new ActionHandler(DeleteSecretAction.INSTANCE, TransportDeleteSecretAction.class)
);
}

View file

@ -6,8 +6,6 @@
*/
package org.elasticsearch.xpack.frozen;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction;
@ -18,9 +16,9 @@ import java.util.List;
public class FrozenIndices extends Plugin implements ActionPlugin {
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>();
actions.add(new ActionHandler<>(XPackUsageFeatureAction.FROZEN_INDICES, FrozenIndicesUsageTransportAction.class));
public List<ActionHandler> getActions() {
List<ActionHandler> actions = new ArrayList<>();
actions.add(new ActionHandler(XPackUsageFeatureAction.FROZEN_INDICES, FrozenIndicesUsageTransportAction.class));
return actions;
}
}

View file

@ -6,8 +6,6 @@
*/
package org.elasticsearch.xpack.graph;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@ -48,13 +46,13 @@ public class Graph extends Plugin implements ActionPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
var usageAction = new ActionHandler<>(XPackUsageFeatureAction.GRAPH, GraphUsageTransportAction.class);
var infoAction = new ActionHandler<>(XPackInfoFeatureAction.GRAPH, GraphInfoTransportAction.class);
public List<ActionHandler> getActions() {
var usageAction = new ActionHandler(XPackUsageFeatureAction.GRAPH, GraphUsageTransportAction.class);
var infoAction = new ActionHandler(XPackInfoFeatureAction.GRAPH, GraphInfoTransportAction.class);
if (false == enabled) {
return Arrays.asList(usageAction, infoAction);
}
return Arrays.asList(new ActionHandler<>(GraphExploreAction.INSTANCE, TransportGraphExploreAction.class), usageAction, infoAction);
return Arrays.asList(new ActionHandler(GraphExploreAction.INSTANCE, TransportGraphExploreAction.class), usageAction, infoAction);
}
@Override

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.idp;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@ -125,16 +123,16 @@ public class IdentityProviderPlugin extends Plugin implements ActionPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
if (enabled == false) {
return List.of();
}
return List.of(
new ActionHandler<>(SamlInitiateSingleSignOnAction.INSTANCE, TransportSamlInitiateSingleSignOnAction.class),
new ActionHandler<>(SamlValidateAuthnRequestAction.INSTANCE, TransportSamlValidateAuthnRequestAction.class),
new ActionHandler<>(SamlMetadataAction.INSTANCE, TransportSamlMetadataAction.class),
new ActionHandler<>(PutSamlServiceProviderAction.INSTANCE, TransportPutSamlServiceProviderAction.class),
new ActionHandler<>(DeleteSamlServiceProviderAction.INSTANCE, TransportDeleteSamlServiceProviderAction.class)
new ActionHandler(SamlInitiateSingleSignOnAction.INSTANCE, TransportSamlInitiateSingleSignOnAction.class),
new ActionHandler(SamlValidateAuthnRequestAction.INSTANCE, TransportSamlValidateAuthnRequestAction.class),
new ActionHandler(SamlMetadataAction.INSTANCE, TransportSamlMetadataAction.class),
new ActionHandler(PutSamlServiceProviderAction.INSTANCE, TransportPutSamlServiceProviderAction.class),
new ActionHandler(DeleteSamlServiceProviderAction.INSTANCE, TransportDeleteSamlServiceProviderAction.class)
);
}

View file

@ -8,8 +8,6 @@ package org.elasticsearch.xpack.ilm;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.client.internal.OriginSettingClient;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
@ -275,21 +273,21 @@ public class IndexLifecycle extends Plugin implements ActionPlugin, HealthPlugin
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(XPackUsageFeatureAction.INDEX_LIFECYCLE, IndexLifecycleUsageTransportAction.class),
new ActionHandler<>(XPackInfoFeatureAction.INDEX_LIFECYCLE, IndexLifecycleInfoTransportAction.class),
new ActionHandler<>(MigrateToDataTiersAction.INSTANCE, TransportMigrateToDataTiersAction.class),
new ActionHandler<>(ILMActions.PUT, TransportPutLifecycleAction.class),
new ActionHandler<>(GetLifecycleAction.INSTANCE, TransportGetLifecycleAction.class),
new ActionHandler<>(DeleteLifecycleAction.INSTANCE, TransportDeleteLifecycleAction.class),
new ActionHandler<>(ExplainLifecycleAction.INSTANCE, TransportExplainLifecycleAction.class),
new ActionHandler<>(RemoveIndexLifecyclePolicyAction.INSTANCE, TransportRemoveIndexLifecyclePolicyAction.class),
new ActionHandler<>(ILMActions.MOVE_TO_STEP, TransportMoveToStepAction.class),
new ActionHandler<>(ILMActions.RETRY, TransportRetryAction.class),
new ActionHandler<>(ILMActions.START, TransportStartILMAction.class),
new ActionHandler<>(ILMActions.STOP, TransportStopILMAction.class),
new ActionHandler<>(GetStatusAction.INSTANCE, TransportGetStatusAction.class)
new ActionHandler(XPackUsageFeatureAction.INDEX_LIFECYCLE, IndexLifecycleUsageTransportAction.class),
new ActionHandler(XPackInfoFeatureAction.INDEX_LIFECYCLE, IndexLifecycleInfoTransportAction.class),
new ActionHandler(MigrateToDataTiersAction.INSTANCE, TransportMigrateToDataTiersAction.class),
new ActionHandler(ILMActions.PUT, TransportPutLifecycleAction.class),
new ActionHandler(GetLifecycleAction.INSTANCE, TransportGetLifecycleAction.class),
new ActionHandler(DeleteLifecycleAction.INSTANCE, TransportDeleteLifecycleAction.class),
new ActionHandler(ExplainLifecycleAction.INSTANCE, TransportExplainLifecycleAction.class),
new ActionHandler(RemoveIndexLifecyclePolicyAction.INSTANCE, TransportRemoveIndexLifecyclePolicyAction.class),
new ActionHandler(ILMActions.MOVE_TO_STEP, TransportMoveToStepAction.class),
new ActionHandler(ILMActions.RETRY, TransportRetryAction.class),
new ActionHandler(ILMActions.START, TransportStartILMAction.class),
new ActionHandler(ILMActions.STOP, TransportStopILMAction.class),
new ActionHandler(GetStatusAction.INSTANCE, TransportGetStatusAction.class)
);
}

View file

@ -10,8 +10,6 @@ package org.elasticsearch.xpack.inference;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.support.MappedActionFilter;
import org.elasticsearch.cluster.NamedDiff;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
@ -206,18 +204,18 @@ public class InferencePlugin extends Plugin
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(InferenceAction.INSTANCE, TransportInferenceAction.class),
new ActionHandler<>(InferenceActionProxy.INSTANCE, TransportInferenceActionProxy.class),
new ActionHandler<>(GetInferenceModelAction.INSTANCE, TransportGetInferenceModelAction.class),
new ActionHandler<>(PutInferenceModelAction.INSTANCE, TransportPutInferenceModelAction.class),
new ActionHandler<>(UpdateInferenceModelAction.INSTANCE, TransportUpdateInferenceModelAction.class),
new ActionHandler<>(DeleteInferenceEndpointAction.INSTANCE, TransportDeleteInferenceEndpointAction.class),
new ActionHandler<>(XPackUsageFeatureAction.INFERENCE, TransportInferenceUsageAction.class),
new ActionHandler<>(GetInferenceDiagnosticsAction.INSTANCE, TransportGetInferenceDiagnosticsAction.class),
new ActionHandler<>(GetInferenceServicesAction.INSTANCE, TransportGetInferenceServicesAction.class),
new ActionHandler<>(UnifiedCompletionAction.INSTANCE, TransportUnifiedCompletionInferenceAction.class)
new ActionHandler(InferenceAction.INSTANCE, TransportInferenceAction.class),
new ActionHandler(InferenceActionProxy.INSTANCE, TransportInferenceActionProxy.class),
new ActionHandler(GetInferenceModelAction.INSTANCE, TransportGetInferenceModelAction.class),
new ActionHandler(PutInferenceModelAction.INSTANCE, TransportPutInferenceModelAction.class),
new ActionHandler(UpdateInferenceModelAction.INSTANCE, TransportUpdateInferenceModelAction.class),
new ActionHandler(DeleteInferenceEndpointAction.INSTANCE, TransportDeleteInferenceEndpointAction.class),
new ActionHandler(XPackUsageFeatureAction.INFERENCE, TransportInferenceUsageAction.class),
new ActionHandler(GetInferenceDiagnosticsAction.INSTANCE, TransportGetInferenceDiagnosticsAction.class),
new ActionHandler(GetInferenceServicesAction.INSTANCE, TransportGetInferenceServicesAction.class),
new ActionHandler(UnifiedCompletionAction.INSTANCE, TransportUnifiedCompletionInferenceAction.class)
);
}

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.logsdb;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings;
@ -93,10 +91,10 @@ public class LogsDBPlugin extends Plugin implements ActionPlugin {
}
@Override
public List<ActionPlugin.ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
List<ActionPlugin.ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>();
actions.add(new ActionPlugin.ActionHandler<>(XPackUsageFeatureAction.LOGSDB, LogsDBUsageTransportAction.class));
actions.add(new ActionPlugin.ActionHandler<>(XPackInfoFeatureAction.LOGSDB, LogsDBInfoTransportAction.class));
public List<ActionPlugin.ActionHandler> getActions() {
List<ActionPlugin.ActionHandler> actions = new ArrayList<>();
actions.add(new ActionPlugin.ActionHandler(XPackUsageFeatureAction.LOGSDB, LogsDBUsageTransportAction.class));
actions.add(new ActionPlugin.ActionHandler(XPackInfoFeatureAction.LOGSDB, LogsDBInfoTransportAction.class));
return actions;
}

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.logstash;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.metadata.IndexTemplateMetadata;
@ -68,13 +66,13 @@ public class Logstash extends Plugin implements SystemIndexPlugin {
public Logstash() {}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(XPackUsageFeatureAction.LOGSTASH, LogstashUsageTransportAction.class),
new ActionHandler<>(XPackInfoFeatureAction.LOGSTASH, LogstashInfoTransportAction.class),
new ActionHandler<>(PutPipelineAction.INSTANCE, TransportPutPipelineAction.class),
new ActionHandler<>(GetPipelineAction.INSTANCE, TransportGetPipelineAction.class),
new ActionHandler<>(DeletePipelineAction.INSTANCE, TransportDeletePipelineAction.class)
new ActionHandler(XPackUsageFeatureAction.LOGSTASH, LogstashUsageTransportAction.class),
new ActionHandler(XPackInfoFeatureAction.LOGSTASH, LogstashInfoTransportAction.class),
new ActionHandler(PutPipelineAction.INSTANCE, TransportPutPipelineAction.class),
new ActionHandler(GetPipelineAction.INSTANCE, TransportGetPipelineAction.class),
new ActionHandler(DeletePipelineAction.INSTANCE, TransportDeletePipelineAction.class)
);
}

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.aggregatemetric;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.index.mapper.Mapper;
import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.ExtensiblePlugin;
@ -36,10 +34,10 @@ public class AggregateMetricMapperPlugin extends Plugin implements MapperPlugin,
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return Arrays.asList(
new ActionHandler<>(XPackUsageFeatureAction.AGGREGATE_METRIC, AggregateMetricUsageTransportAction.class),
new ActionHandler<>(XPackInfoFeatureAction.AGGREGATE_METRIC, AggregateMetricInfoTransportAction.class)
new ActionHandler(XPackUsageFeatureAction.AGGREGATE_METRIC, AggregateMetricUsageTransportAction.class),
new ActionHandler(XPackInfoFeatureAction.AGGREGATE_METRIC, AggregateMetricInfoTransportAction.class)
);
}

View file

@ -8,8 +8,6 @@
package org.elasticsearch.xpack.migrate;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.client.internal.OriginSettingClient;
import org.elasticsearch.cluster.NamedDiff;
@ -121,17 +119,17 @@ public class MigratePlugin extends Plugin implements ActionPlugin, PersistentTas
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>();
actions.add(new ActionHandler<>(ReindexDataStreamAction.INSTANCE, ReindexDataStreamTransportAction.class));
actions.add(new ActionHandler<>(GetMigrationReindexStatusAction.INSTANCE, GetMigrationReindexStatusTransportAction.class));
actions.add(new ActionHandler<>(CancelReindexDataStreamAction.INSTANCE, CancelReindexDataStreamTransportAction.class));
actions.add(new ActionHandler<>(ReindexDataStreamIndexAction.INSTANCE, ReindexDataStreamIndexTransportAction.class));
actions.add(new ActionHandler<>(CreateIndexFromSourceAction.INSTANCE, CreateIndexFromSourceTransportAction.class));
actions.add(new ActionHandler<>(CopyLifecycleIndexMetadataAction.INSTANCE, CopyLifecycleIndexMetadataTransportAction.class));
public List<ActionHandler> getActions() {
List<ActionHandler> actions = new ArrayList<>();
actions.add(new ActionHandler(ReindexDataStreamAction.INSTANCE, ReindexDataStreamTransportAction.class));
actions.add(new ActionHandler(GetMigrationReindexStatusAction.INSTANCE, GetMigrationReindexStatusTransportAction.class));
actions.add(new ActionHandler(CancelReindexDataStreamAction.INSTANCE, CancelReindexDataStreamTransportAction.class));
actions.add(new ActionHandler(ReindexDataStreamIndexAction.INSTANCE, ReindexDataStreamIndexTransportAction.class));
actions.add(new ActionHandler(CreateIndexFromSourceAction.INSTANCE, CreateIndexFromSourceTransportAction.class));
actions.add(new ActionHandler(CopyLifecycleIndexMetadataAction.INSTANCE, CopyLifecycleIndexMetadataTransportAction.class));
actions.add(new ActionHandler<>(GetFeatureUpgradeStatusAction.INSTANCE, TransportGetFeatureUpgradeStatusAction.class));
actions.add(new ActionHandler<>(PostFeatureUpgradeAction.INSTANCE, TransportPostFeatureUpgradeAction.class));
actions.add(new ActionHandler(GetFeatureUpgradeStatusAction.INSTANCE, TransportGetFeatureUpgradeStatusAction.class));
actions.add(new ActionHandler(PostFeatureUpgradeAction.INSTANCE, TransportPostFeatureUpgradeAction.class));
return actions;
}

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.ml.packageloader;
import org.elasticsearch.Build;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.bootstrap.BootstrapCheck;
import org.elasticsearch.bootstrap.BootstrapContext;
import org.elasticsearch.common.ReferenceDocs;
@ -66,11 +64,11 @@ public class MachineLearningPackageLoader extends Plugin implements ActionPlugin
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
// all internal, no rest endpoint
return Arrays.asList(
new ActionHandler<>(GetTrainedModelPackageConfigAction.INSTANCE, TransportGetTrainedModelPackageConfigAction.class),
new ActionHandler<>(LoadTrainedModelPackageAction.INSTANCE, TransportLoadTrainedModelPackage.class)
new ActionHandler(GetTrainedModelPackageConfigAction.INSTANCE, TransportGetTrainedModelPackageConfigAction.class),
new ActionHandler(LoadTrainedModelPackageAction.INSTANCE, TransportLoadTrainedModelPackage.class)
);
}

View file

@ -11,8 +11,6 @@ import org.apache.logging.log4j.Logger;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
import org.elasticsearch.action.admin.cluster.snapshots.features.ResetFeatureStateResponse;
import org.elasticsearch.action.support.ActionFilter;
@ -1511,148 +1509,146 @@ public class MachineLearning extends Plugin
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actionHandlers = new ArrayList<>();
actionHandlers.add(new ActionHandler<>(XPackUsageFeatureAction.MACHINE_LEARNING, MachineLearningUsageTransportAction.class));
actionHandlers.add(new ActionHandler<>(XPackInfoFeatureAction.MACHINE_LEARNING, MachineLearningInfoTransportAction.class));
public List<ActionHandler> getActions() {
List<ActionHandler> actionHandlers = new ArrayList<>();
actionHandlers.add(new ActionHandler(XPackUsageFeatureAction.MACHINE_LEARNING, MachineLearningUsageTransportAction.class));
actionHandlers.add(new ActionHandler(XPackInfoFeatureAction.MACHINE_LEARNING, MachineLearningInfoTransportAction.class));
if (false == enabled) {
return actionHandlers;
}
actionHandlers.add(new ActionHandler<>(AuditMlNotificationAction.INSTANCE, TransportAuditMlNotificationAction.class));
actionHandlers.add(new ActionHandler<>(MlInfoAction.INSTANCE, TransportMlInfoAction.class));
actionHandlers.add(new ActionHandler<>(MlMemoryAction.INSTANCE, TransportMlMemoryAction.class));
actionHandlers.add(new ActionHandler<>(SetUpgradeModeAction.INSTANCE, TransportSetUpgradeModeAction.class));
actionHandlers.add(new ActionHandler<>(SetResetModeAction.INSTANCE, TransportSetResetModeAction.class));
actionHandlers.add(new ActionHandler(AuditMlNotificationAction.INSTANCE, TransportAuditMlNotificationAction.class));
actionHandlers.add(new ActionHandler(MlInfoAction.INSTANCE, TransportMlInfoAction.class));
actionHandlers.add(new ActionHandler(MlMemoryAction.INSTANCE, TransportMlMemoryAction.class));
actionHandlers.add(new ActionHandler(SetUpgradeModeAction.INSTANCE, TransportSetUpgradeModeAction.class));
actionHandlers.add(new ActionHandler(SetResetModeAction.INSTANCE, TransportSetResetModeAction.class));
// Included in this section as it's used by MlMemoryAction
actionHandlers.add(new ActionHandler<>(TrainedModelCacheInfoAction.INSTANCE, TransportTrainedModelCacheInfoAction.class));
actionHandlers.add(new ActionHandler<>(GetMlAutoscalingStats.INSTANCE, TransportGetMlAutoscalingStats.class));
actionHandlers.add(new ActionHandler(TrainedModelCacheInfoAction.INSTANCE, TransportTrainedModelCacheInfoAction.class));
actionHandlers.add(new ActionHandler(GetMlAutoscalingStats.INSTANCE, TransportGetMlAutoscalingStats.class));
if (machineLearningExtension.get().isAnomalyDetectionEnabled()) {
actionHandlers.add(new ActionHandler<>(GetJobsAction.INSTANCE, TransportGetJobsAction.class));
actionHandlers.add(new ActionHandler<>(GetJobsStatsAction.INSTANCE, TransportGetJobsStatsAction.class));
actionHandlers.add(new ActionHandler<>(PutJobAction.INSTANCE, TransportPutJobAction.class));
actionHandlers.add(new ActionHandler<>(UpdateJobAction.INSTANCE, TransportUpdateJobAction.class));
actionHandlers.add(new ActionHandler<>(DeleteJobAction.INSTANCE, TransportDeleteJobAction.class));
actionHandlers.add(new ActionHandler<>(OpenJobAction.INSTANCE, TransportOpenJobAction.class));
actionHandlers.add(new ActionHandler<>(GetFiltersAction.INSTANCE, TransportGetFiltersAction.class));
actionHandlers.add(new ActionHandler<>(PutFilterAction.INSTANCE, TransportPutFilterAction.class));
actionHandlers.add(new ActionHandler<>(UpdateFilterAction.INSTANCE, TransportUpdateFilterAction.class));
actionHandlers.add(new ActionHandler<>(DeleteFilterAction.INSTANCE, TransportDeleteFilterAction.class));
actionHandlers.add(new ActionHandler<>(KillProcessAction.INSTANCE, TransportKillProcessAction.class));
actionHandlers.add(new ActionHandler<>(GetBucketsAction.INSTANCE, TransportGetBucketsAction.class));
actionHandlers.add(new ActionHandler<>(GetInfluencersAction.INSTANCE, TransportGetInfluencersAction.class));
actionHandlers.add(new ActionHandler<>(GetOverallBucketsAction.INSTANCE, TransportGetOverallBucketsAction.class));
actionHandlers.add(new ActionHandler<>(GetRecordsAction.INSTANCE, TransportGetRecordsAction.class));
actionHandlers.add(new ActionHandler<>(PostDataAction.INSTANCE, TransportPostDataAction.class));
actionHandlers.add(new ActionHandler<>(CloseJobAction.INSTANCE, TransportCloseJobAction.class));
actionHandlers.add(new ActionHandler<>(FinalizeJobExecutionAction.INSTANCE, TransportFinalizeJobExecutionAction.class));
actionHandlers.add(new ActionHandler<>(FlushJobAction.INSTANCE, TransportFlushJobAction.class));
actionHandlers.add(new ActionHandler<>(ResetJobAction.INSTANCE, TransportResetJobAction.class));
actionHandlers.add(new ActionHandler<>(ValidateDetectorAction.INSTANCE, TransportValidateDetectorAction.class));
actionHandlers.add(new ActionHandler<>(ValidateJobConfigAction.INSTANCE, TransportValidateJobConfigAction.class));
actionHandlers.add(new ActionHandler<>(EstimateModelMemoryAction.INSTANCE, TransportEstimateModelMemoryAction.class));
actionHandlers.add(new ActionHandler<>(GetCategoriesAction.INSTANCE, TransportGetCategoriesAction.class));
actionHandlers.add(new ActionHandler<>(GetModelSnapshotsAction.INSTANCE, TransportGetModelSnapshotsAction.class));
actionHandlers.add(new ActionHandler<>(RevertModelSnapshotAction.INSTANCE, TransportRevertModelSnapshotAction.class));
actionHandlers.add(new ActionHandler<>(UpdateModelSnapshotAction.INSTANCE, TransportUpdateModelSnapshotAction.class));
actionHandlers.add(new ActionHandler<>(GetDatafeedsAction.INSTANCE, TransportGetDatafeedsAction.class));
actionHandlers.add(new ActionHandler<>(GetDatafeedsStatsAction.INSTANCE, TransportGetDatafeedsStatsAction.class));
actionHandlers.add(new ActionHandler<>(PutDatafeedAction.INSTANCE, TransportPutDatafeedAction.class));
actionHandlers.add(new ActionHandler<>(UpdateDatafeedAction.INSTANCE, TransportUpdateDatafeedAction.class));
actionHandlers.add(new ActionHandler<>(DeleteDatafeedAction.INSTANCE, TransportDeleteDatafeedAction.class));
actionHandlers.add(new ActionHandler<>(PreviewDatafeedAction.INSTANCE, TransportPreviewDatafeedAction.class));
actionHandlers.add(new ActionHandler<>(StartDatafeedAction.INSTANCE, TransportStartDatafeedAction.class));
actionHandlers.add(new ActionHandler<>(StopDatafeedAction.INSTANCE, TransportStopDatafeedAction.class));
actionHandlers.add(new ActionHandler<>(IsolateDatafeedAction.INSTANCE, TransportIsolateDatafeedAction.class));
actionHandlers.add(new ActionHandler<>(DeleteModelSnapshotAction.INSTANCE, TransportDeleteModelSnapshotAction.class));
actionHandlers.add(new ActionHandler<>(UpdateProcessAction.INSTANCE, TransportUpdateProcessAction.class));
actionHandlers.add(new ActionHandler<>(ForecastJobAction.INSTANCE, TransportForecastJobAction.class));
actionHandlers.add(new ActionHandler<>(DeleteForecastAction.INSTANCE, TransportDeleteForecastAction.class));
actionHandlers.add(new ActionHandler<>(GetCalendarsAction.INSTANCE, TransportGetCalendarsAction.class));
actionHandlers.add(new ActionHandler<>(PutCalendarAction.INSTANCE, TransportPutCalendarAction.class));
actionHandlers.add(new ActionHandler<>(DeleteCalendarAction.INSTANCE, TransportDeleteCalendarAction.class));
actionHandlers.add(new ActionHandler<>(DeleteCalendarEventAction.INSTANCE, TransportDeleteCalendarEventAction.class));
actionHandlers.add(new ActionHandler<>(UpdateCalendarJobAction.INSTANCE, TransportUpdateCalendarJobAction.class));
actionHandlers.add(new ActionHandler<>(GetCalendarEventsAction.INSTANCE, TransportGetCalendarEventsAction.class));
actionHandlers.add(new ActionHandler<>(PostCalendarEventsAction.INSTANCE, TransportPostCalendarEventsAction.class));
actionHandlers.add(new ActionHandler<>(PersistJobAction.INSTANCE, TransportPersistJobAction.class));
actionHandlers.add(new ActionHandler<>(UpgradeJobModelSnapshotAction.INSTANCE, TransportUpgradeJobModelSnapshotAction.class));
actionHandlers.add(new ActionHandler(GetJobsAction.INSTANCE, TransportGetJobsAction.class));
actionHandlers.add(new ActionHandler(GetJobsStatsAction.INSTANCE, TransportGetJobsStatsAction.class));
actionHandlers.add(new ActionHandler(PutJobAction.INSTANCE, TransportPutJobAction.class));
actionHandlers.add(new ActionHandler(UpdateJobAction.INSTANCE, TransportUpdateJobAction.class));
actionHandlers.add(new ActionHandler(DeleteJobAction.INSTANCE, TransportDeleteJobAction.class));
actionHandlers.add(new ActionHandler(OpenJobAction.INSTANCE, TransportOpenJobAction.class));
actionHandlers.add(new ActionHandler(GetFiltersAction.INSTANCE, TransportGetFiltersAction.class));
actionHandlers.add(new ActionHandler(PutFilterAction.INSTANCE, TransportPutFilterAction.class));
actionHandlers.add(new ActionHandler(UpdateFilterAction.INSTANCE, TransportUpdateFilterAction.class));
actionHandlers.add(new ActionHandler(DeleteFilterAction.INSTANCE, TransportDeleteFilterAction.class));
actionHandlers.add(new ActionHandler(KillProcessAction.INSTANCE, TransportKillProcessAction.class));
actionHandlers.add(new ActionHandler(GetBucketsAction.INSTANCE, TransportGetBucketsAction.class));
actionHandlers.add(new ActionHandler(GetInfluencersAction.INSTANCE, TransportGetInfluencersAction.class));
actionHandlers.add(new ActionHandler(GetOverallBucketsAction.INSTANCE, TransportGetOverallBucketsAction.class));
actionHandlers.add(new ActionHandler(GetRecordsAction.INSTANCE, TransportGetRecordsAction.class));
actionHandlers.add(new ActionHandler(PostDataAction.INSTANCE, TransportPostDataAction.class));
actionHandlers.add(new ActionHandler(CloseJobAction.INSTANCE, TransportCloseJobAction.class));
actionHandlers.add(new ActionHandler(FinalizeJobExecutionAction.INSTANCE, TransportFinalizeJobExecutionAction.class));
actionHandlers.add(new ActionHandler(FlushJobAction.INSTANCE, TransportFlushJobAction.class));
actionHandlers.add(new ActionHandler(ResetJobAction.INSTANCE, TransportResetJobAction.class));
actionHandlers.add(new ActionHandler(ValidateDetectorAction.INSTANCE, TransportValidateDetectorAction.class));
actionHandlers.add(new ActionHandler(ValidateJobConfigAction.INSTANCE, TransportValidateJobConfigAction.class));
actionHandlers.add(new ActionHandler(EstimateModelMemoryAction.INSTANCE, TransportEstimateModelMemoryAction.class));
actionHandlers.add(new ActionHandler(GetCategoriesAction.INSTANCE, TransportGetCategoriesAction.class));
actionHandlers.add(new ActionHandler(GetModelSnapshotsAction.INSTANCE, TransportGetModelSnapshotsAction.class));
actionHandlers.add(new ActionHandler(RevertModelSnapshotAction.INSTANCE, TransportRevertModelSnapshotAction.class));
actionHandlers.add(new ActionHandler(UpdateModelSnapshotAction.INSTANCE, TransportUpdateModelSnapshotAction.class));
actionHandlers.add(new ActionHandler(GetDatafeedsAction.INSTANCE, TransportGetDatafeedsAction.class));
actionHandlers.add(new ActionHandler(GetDatafeedsStatsAction.INSTANCE, TransportGetDatafeedsStatsAction.class));
actionHandlers.add(new ActionHandler(PutDatafeedAction.INSTANCE, TransportPutDatafeedAction.class));
actionHandlers.add(new ActionHandler(UpdateDatafeedAction.INSTANCE, TransportUpdateDatafeedAction.class));
actionHandlers.add(new ActionHandler(DeleteDatafeedAction.INSTANCE, TransportDeleteDatafeedAction.class));
actionHandlers.add(new ActionHandler(PreviewDatafeedAction.INSTANCE, TransportPreviewDatafeedAction.class));
actionHandlers.add(new ActionHandler(StartDatafeedAction.INSTANCE, TransportStartDatafeedAction.class));
actionHandlers.add(new ActionHandler(StopDatafeedAction.INSTANCE, TransportStopDatafeedAction.class));
actionHandlers.add(new ActionHandler(IsolateDatafeedAction.INSTANCE, TransportIsolateDatafeedAction.class));
actionHandlers.add(new ActionHandler(DeleteModelSnapshotAction.INSTANCE, TransportDeleteModelSnapshotAction.class));
actionHandlers.add(new ActionHandler(UpdateProcessAction.INSTANCE, TransportUpdateProcessAction.class));
actionHandlers.add(new ActionHandler(ForecastJobAction.INSTANCE, TransportForecastJobAction.class));
actionHandlers.add(new ActionHandler(DeleteForecastAction.INSTANCE, TransportDeleteForecastAction.class));
actionHandlers.add(new ActionHandler(GetCalendarsAction.INSTANCE, TransportGetCalendarsAction.class));
actionHandlers.add(new ActionHandler(PutCalendarAction.INSTANCE, TransportPutCalendarAction.class));
actionHandlers.add(new ActionHandler(DeleteCalendarAction.INSTANCE, TransportDeleteCalendarAction.class));
actionHandlers.add(new ActionHandler(DeleteCalendarEventAction.INSTANCE, TransportDeleteCalendarEventAction.class));
actionHandlers.add(new ActionHandler(UpdateCalendarJobAction.INSTANCE, TransportUpdateCalendarJobAction.class));
actionHandlers.add(new ActionHandler(GetCalendarEventsAction.INSTANCE, TransportGetCalendarEventsAction.class));
actionHandlers.add(new ActionHandler(PostCalendarEventsAction.INSTANCE, TransportPostCalendarEventsAction.class));
actionHandlers.add(new ActionHandler(PersistJobAction.INSTANCE, TransportPersistJobAction.class));
actionHandlers.add(new ActionHandler(UpgradeJobModelSnapshotAction.INSTANCE, TransportUpgradeJobModelSnapshotAction.class));
actionHandlers.add(
new ActionHandler<>(CancelJobModelSnapshotUpgradeAction.INSTANCE, TransportCancelJobModelSnapshotUpgradeAction.class)
new ActionHandler(CancelJobModelSnapshotUpgradeAction.INSTANCE, TransportCancelJobModelSnapshotUpgradeAction.class)
);
actionHandlers.add(
new ActionHandler<>(GetJobModelSnapshotsUpgradeStatsAction.INSTANCE, TransportGetJobModelSnapshotsUpgradeStatsAction.class)
new ActionHandler(GetJobModelSnapshotsUpgradeStatsAction.INSTANCE, TransportGetJobModelSnapshotsUpgradeStatsAction.class)
);
actionHandlers.add(new ActionHandler<>(GetDatafeedRunningStateAction.INSTANCE, TransportGetDatafeedRunningStateAction.class));
actionHandlers.add(new ActionHandler<>(DeleteExpiredDataAction.INSTANCE, TransportDeleteExpiredDataAction.class));
actionHandlers.add(new ActionHandler(GetDatafeedRunningStateAction.INSTANCE, TransportGetDatafeedRunningStateAction.class));
actionHandlers.add(new ActionHandler(DeleteExpiredDataAction.INSTANCE, TransportDeleteExpiredDataAction.class));
}
if (machineLearningExtension.get().isDataFrameAnalyticsEnabled() || machineLearningExtension.get().isNlpEnabled()) {
actionHandlers.add(new ActionHandler<>(GetTrainedModelsAction.INSTANCE, TransportGetTrainedModelsAction.class));
actionHandlers.add(new ActionHandler<>(DeleteTrainedModelAction.INSTANCE, TransportDeleteTrainedModelAction.class));
actionHandlers.add(new ActionHandler<>(GetTrainedModelsStatsAction.INSTANCE, TransportGetTrainedModelsStatsAction.class));
actionHandlers.add(new ActionHandler<>(PutTrainedModelAction.INSTANCE, TransportPutTrainedModelAction.class));
actionHandlers.add(new ActionHandler<>(PutTrainedModelAliasAction.INSTANCE, TransportPutTrainedModelAliasAction.class));
actionHandlers.add(new ActionHandler<>(DeleteTrainedModelAliasAction.INSTANCE, TransportDeleteTrainedModelAliasAction.class));
actionHandlers.add(new ActionHandler(GetTrainedModelsAction.INSTANCE, TransportGetTrainedModelsAction.class));
actionHandlers.add(new ActionHandler(DeleteTrainedModelAction.INSTANCE, TransportDeleteTrainedModelAction.class));
actionHandlers.add(new ActionHandler(GetTrainedModelsStatsAction.INSTANCE, TransportGetTrainedModelsStatsAction.class));
actionHandlers.add(new ActionHandler(PutTrainedModelAction.INSTANCE, TransportPutTrainedModelAction.class));
actionHandlers.add(new ActionHandler(PutTrainedModelAliasAction.INSTANCE, TransportPutTrainedModelAliasAction.class));
actionHandlers.add(new ActionHandler(DeleteTrainedModelAliasAction.INSTANCE, TransportDeleteTrainedModelAliasAction.class));
actionHandlers.add(
new ActionHandler<>(PutTrainedModelDefinitionPartAction.INSTANCE, TransportPutTrainedModelDefinitionPartAction.class)
new ActionHandler(PutTrainedModelDefinitionPartAction.INSTANCE, TransportPutTrainedModelDefinitionPartAction.class)
);
actionHandlers.add(new ActionHandler<>(FlushTrainedModelCacheAction.INSTANCE, TransportFlushTrainedModelCacheAction.class));
actionHandlers.add(new ActionHandler<>(InferModelAction.INSTANCE, TransportInternalInferModelAction.class));
actionHandlers.add(new ActionHandler<>(InferModelAction.EXTERNAL_INSTANCE, TransportExternalInferModelAction.class));
actionHandlers.add(new ActionHandler<>(GetDeploymentStatsAction.INSTANCE, TransportGetDeploymentStatsAction.class));
actionHandlers.add(new ActionHandler(FlushTrainedModelCacheAction.INSTANCE, TransportFlushTrainedModelCacheAction.class));
actionHandlers.add(new ActionHandler(InferModelAction.INSTANCE, TransportInternalInferModelAction.class));
actionHandlers.add(new ActionHandler(InferModelAction.EXTERNAL_INSTANCE, TransportExternalInferModelAction.class));
actionHandlers.add(new ActionHandler(GetDeploymentStatsAction.INSTANCE, TransportGetDeploymentStatsAction.class));
if (machineLearningExtension.get().isDataFrameAnalyticsEnabled()) {
actionHandlers.add(new ActionHandler<>(GetDataFrameAnalyticsAction.INSTANCE, TransportGetDataFrameAnalyticsAction.class));
actionHandlers.add(new ActionHandler(GetDataFrameAnalyticsAction.INSTANCE, TransportGetDataFrameAnalyticsAction.class));
actionHandlers.add(
new ActionHandler<>(GetDataFrameAnalyticsStatsAction.INSTANCE, TransportGetDataFrameAnalyticsStatsAction.class)
new ActionHandler(GetDataFrameAnalyticsStatsAction.INSTANCE, TransportGetDataFrameAnalyticsStatsAction.class)
);
actionHandlers.add(new ActionHandler<>(PutDataFrameAnalyticsAction.INSTANCE, TransportPutDataFrameAnalyticsAction.class));
actionHandlers.add(new ActionHandler(PutDataFrameAnalyticsAction.INSTANCE, TransportPutDataFrameAnalyticsAction.class));
actionHandlers.add(
new ActionHandler<>(UpdateDataFrameAnalyticsAction.INSTANCE, TransportUpdateDataFrameAnalyticsAction.class)
new ActionHandler(UpdateDataFrameAnalyticsAction.INSTANCE, TransportUpdateDataFrameAnalyticsAction.class)
);
actionHandlers.add(
new ActionHandler<>(DeleteDataFrameAnalyticsAction.INSTANCE, TransportDeleteDataFrameAnalyticsAction.class)
new ActionHandler(DeleteDataFrameAnalyticsAction.INSTANCE, TransportDeleteDataFrameAnalyticsAction.class)
);
actionHandlers.add(new ActionHandler(StartDataFrameAnalyticsAction.INSTANCE, TransportStartDataFrameAnalyticsAction.class));
actionHandlers.add(new ActionHandler(StopDataFrameAnalyticsAction.INSTANCE, TransportStopDataFrameAnalyticsAction.class));
actionHandlers.add(new ActionHandler(EvaluateDataFrameAction.INSTANCE, TransportEvaluateDataFrameAction.class));
actionHandlers.add(
new ActionHandler(ExplainDataFrameAnalyticsAction.INSTANCE, TransportExplainDataFrameAnalyticsAction.class)
);
actionHandlers.add(
new ActionHandler<>(StartDataFrameAnalyticsAction.INSTANCE, TransportStartDataFrameAnalyticsAction.class)
);
actionHandlers.add(new ActionHandler<>(StopDataFrameAnalyticsAction.INSTANCE, TransportStopDataFrameAnalyticsAction.class));
actionHandlers.add(new ActionHandler<>(EvaluateDataFrameAction.INSTANCE, TransportEvaluateDataFrameAction.class));
actionHandlers.add(
new ActionHandler<>(ExplainDataFrameAnalyticsAction.INSTANCE, TransportExplainDataFrameAnalyticsAction.class)
);
actionHandlers.add(
new ActionHandler<>(PreviewDataFrameAnalyticsAction.INSTANCE, TransportPreviewDataFrameAnalyticsAction.class)
new ActionHandler(PreviewDataFrameAnalyticsAction.INSTANCE, TransportPreviewDataFrameAnalyticsAction.class)
);
}
if (machineLearningExtension.get().isNlpEnabled()) {
actionHandlers.add(
new ActionHandler<>(StartTrainedModelDeploymentAction.INSTANCE, TransportStartTrainedModelDeploymentAction.class)
new ActionHandler(StartTrainedModelDeploymentAction.INSTANCE, TransportStartTrainedModelDeploymentAction.class)
);
actionHandlers.add(
new ActionHandler<>(StopTrainedModelDeploymentAction.INSTANCE, TransportStopTrainedModelDeploymentAction.class)
new ActionHandler(StopTrainedModelDeploymentAction.INSTANCE, TransportStopTrainedModelDeploymentAction.class)
);
actionHandlers.add(
new ActionHandler<>(InferTrainedModelDeploymentAction.INSTANCE, TransportInferTrainedModelDeploymentAction.class)
new ActionHandler(InferTrainedModelDeploymentAction.INSTANCE, TransportInferTrainedModelDeploymentAction.class)
);
actionHandlers.add(
new ActionHandler<>(UpdateTrainedModelDeploymentAction.INSTANCE, TransportUpdateTrainedModelDeploymentAction.class)
new ActionHandler(UpdateTrainedModelDeploymentAction.INSTANCE, TransportUpdateTrainedModelDeploymentAction.class)
);
actionHandlers.add(
new ActionHandler<>(PutTrainedModelVocabularyAction.INSTANCE, TransportPutTrainedModelVocabularyAction.class)
new ActionHandler(PutTrainedModelVocabularyAction.INSTANCE, TransportPutTrainedModelVocabularyAction.class)
);
actionHandlers.add(new ActionHandler<>(ClearDeploymentCacheAction.INSTANCE, TransportClearDeploymentCacheAction.class));
actionHandlers.add(new ActionHandler(ClearDeploymentCacheAction.INSTANCE, TransportClearDeploymentCacheAction.class));
actionHandlers.add(
new ActionHandler<>(CreateTrainedModelAssignmentAction.INSTANCE, TransportCreateTrainedModelAssignmentAction.class)
new ActionHandler(CreateTrainedModelAssignmentAction.INSTANCE, TransportCreateTrainedModelAssignmentAction.class)
);
actionHandlers.add(
new ActionHandler<>(DeleteTrainedModelAssignmentAction.INSTANCE, TransportDeleteTrainedModelAssignmentAction.class)
new ActionHandler(DeleteTrainedModelAssignmentAction.INSTANCE, TransportDeleteTrainedModelAssignmentAction.class)
);
actionHandlers.add(
new ActionHandler<>(
new ActionHandler(
UpdateTrainedModelAssignmentRoutingInfoAction.INSTANCE,
TransportUpdateTrainedModelAssignmentStateAction.class
)
);
actionHandlers.add(new ActionHandler<>(CoordinatedInferenceAction.INSTANCE, TransportCoordinatedInferenceAction.class));
actionHandlers.add(new ActionHandler(CoordinatedInferenceAction.INSTANCE, TransportCoordinatedInferenceAction.class));
}
}
return actionHandlers;

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.ml;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.TransportAction;
import org.elasticsearch.common.breaker.NoopCircuitBreaker;
@ -129,8 +127,8 @@ public class LocalStateMachineLearning extends LocalStateCompositeXPackPlugin {
public static class MockedRollupPlugin extends Plugin implements ActionPlugin {
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return Collections.singletonList(new ActionHandler<>(GetRollupIndexCapsAction.INSTANCE, MockedRollupIndexCapsTransport.class));
public List<ActionHandler> getActions() {
return Collections.singletonList(new ActionHandler(GetRollupIndexCapsAction.INSTANCE, MockedRollupIndexCapsTransport.class));
}
public static class MockedRollupIndexCapsTransport extends TransportAction<

View file

@ -6,8 +6,6 @@
*/
package org.elasticsearch.xpack.monitoring;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.metadata.IndexTemplateMetadata;
@ -172,12 +170,12 @@ public class Monitoring extends Plugin implements ActionPlugin, ReloadablePlugin
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
var usageAction = new ActionHandler<>(XPackUsageFeatureAction.MONITORING, MonitoringUsageTransportAction.class);
var infoAction = new ActionHandler<>(XPackInfoFeatureAction.MONITORING, MonitoringInfoTransportAction.class);
public List<ActionHandler> getActions() {
var usageAction = new ActionHandler(XPackUsageFeatureAction.MONITORING, MonitoringUsageTransportAction.class);
var infoAction = new ActionHandler(XPackInfoFeatureAction.MONITORING, MonitoringInfoTransportAction.class);
return Arrays.asList(
new ActionHandler<>(MonitoringBulkAction.INSTANCE, TransportMonitoringBulkAction.class),
new ActionHandler<>(MonitoringMigrateAlertsAction.INSTANCE, TransportMonitoringMigrateAlertsAction.class),
new ActionHandler(MonitoringBulkAction.INSTANCE, TransportMonitoringBulkAction.class),
new ActionHandler(MonitoringMigrateAlertsAction.INSTANCE, TransportMonitoringMigrateAlertsAction.class),
usageAction,
infoAction
);

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.monitoring;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction;
@ -110,12 +108,12 @@ public class LocalStateMonitoring extends LocalStateCompositeXPackPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
var actions = super.getActions();
// ccr StatsCollector
actions.add(new ActionHandler<>(CcrStatsAction.INSTANCE, TransportCcrStatsStubAction.class));
actions.add(new ActionHandler(CcrStatsAction.INSTANCE, TransportCcrStatsStubAction.class));
// For EnrichStatsCollector:
actions.add(new ActionHandler<>(EnrichStatsAction.INSTANCE, TransportEnrichStatsStubAction.class));
actions.add(new ActionHandler(EnrichStatsAction.INSTANCE, TransportEnrichStatsStubAction.class));
return actions;
}

View file

@ -12,8 +12,6 @@ import org.apache.lucene.index.SegmentInfo;
import org.apache.lucene.index.SegmentInfos;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.Build;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider;
@ -93,10 +91,10 @@ public class OldLuceneVersions extends Plugin implements IndexStorePlugin, Clust
}
@Override
public List<ActionPlugin.ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionPlugin.ActionHandler> getActions() {
return List.of(
new ActionPlugin.ActionHandler<>(XPackUsageFeatureAction.ARCHIVE, ArchiveUsageTransportAction.class),
new ActionPlugin.ActionHandler<>(XPackInfoFeatureAction.ARCHIVE, ArchiveInfoTransportAction.class)
new ActionPlugin.ActionHandler(XPackUsageFeatureAction.ARCHIVE, ArchiveUsageTransportAction.class),
new ActionPlugin.ActionHandler(XPackInfoFeatureAction.ARCHIVE, ArchiveInfoTransportAction.class)
);
}

View file

@ -10,8 +10,6 @@ package org.elasticsearch.xpack.profiling;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
@ -184,14 +182,14 @@ public class ProfilingPlugin extends Plugin implements ActionPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(GetStackTracesAction.INSTANCE, TransportGetStackTracesAction.class),
new ActionHandler<>(GetFlamegraphAction.INSTANCE, TransportGetFlamegraphAction.class),
new ActionHandler<>(GetTopNFunctionsAction.INSTANCE, TransportGetTopNFunctionsAction.class),
new ActionHandler<>(GetStatusAction.INSTANCE, TransportGetStatusAction.class),
new ActionHandler<>(XPackUsageFeatureAction.UNIVERSAL_PROFILING, ProfilingUsageTransportAction.class),
new ActionHandler<>(XPackInfoFeatureAction.UNIVERSAL_PROFILING, ProfilingInfoTransportAction.class)
new ActionHandler(GetStackTracesAction.INSTANCE, TransportGetStackTracesAction.class),
new ActionHandler(GetFlamegraphAction.INSTANCE, TransportGetFlamegraphAction.class),
new ActionHandler(GetTopNFunctionsAction.INSTANCE, TransportGetTopNFunctionsAction.class),
new ActionHandler(GetStatusAction.INSTANCE, TransportGetStatusAction.class),
new ActionHandler(XPackUsageFeatureAction.UNIVERSAL_PROFILING, ProfilingUsageTransportAction.class),
new ActionHandler(XPackInfoFeatureAction.UNIVERSAL_PROFILING, ProfilingInfoTransportAction.class)
);
}

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.repositories.metering;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@ -35,10 +33,10 @@ import java.util.function.Supplier;
public final class RepositoriesMeteringPlugin extends Plugin implements ActionPlugin {
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(RepositoriesMeteringAction.INSTANCE, TransportRepositoriesStatsAction.class),
new ActionHandler<>(ClearRepositoriesMeteringArchiveAction.INSTANCE, TransportClearRepositoriesStatsArchiveAction.class)
new ActionHandler(RepositoriesMeteringAction.INSTANCE, TransportRepositoriesStatsAction.class),
new ActionHandler(ClearRepositoriesMeteringArchiveAction.INSTANCE, TransportClearRepositoriesStatsArchiveAction.class)
);
}

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.rollup;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
@ -115,18 +113,18 @@ public class Rollup extends Plugin implements ActionPlugin, PersistentTaskPlugin
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return Arrays.asList(
new ActionHandler<>(RollupSearchAction.INSTANCE, TransportRollupSearchAction.class),
new ActionHandler<>(PutRollupJobAction.INSTANCE, TransportPutRollupJobAction.class),
new ActionHandler<>(StartRollupJobAction.INSTANCE, TransportStartRollupAction.class),
new ActionHandler<>(StopRollupJobAction.INSTANCE, TransportStopRollupAction.class),
new ActionHandler<>(DeleteRollupJobAction.INSTANCE, TransportDeleteRollupJobAction.class),
new ActionHandler<>(GetRollupJobsAction.INSTANCE, TransportGetRollupJobAction.class),
new ActionHandler<>(GetRollupCapsAction.INSTANCE, TransportGetRollupCapsAction.class),
new ActionHandler<>(GetRollupIndexCapsAction.INSTANCE, TransportGetRollupIndexCapsAction.class),
new ActionHandler<>(XPackUsageFeatureAction.ROLLUP, RollupUsageTransportAction.class),
new ActionHandler<>(XPackInfoFeatureAction.ROLLUP, RollupInfoTransportAction.class)
new ActionHandler(RollupSearchAction.INSTANCE, TransportRollupSearchAction.class),
new ActionHandler(PutRollupJobAction.INSTANCE, TransportPutRollupJobAction.class),
new ActionHandler(StartRollupJobAction.INSTANCE, TransportStartRollupAction.class),
new ActionHandler(StopRollupJobAction.INSTANCE, TransportStopRollupAction.class),
new ActionHandler(DeleteRollupJobAction.INSTANCE, TransportDeleteRollupJobAction.class),
new ActionHandler(GetRollupJobsAction.INSTANCE, TransportGetRollupJobAction.class),
new ActionHandler(GetRollupCapsAction.INSTANCE, TransportGetRollupCapsAction.class),
new ActionHandler(GetRollupIndexCapsAction.INSTANCE, TransportGetRollupIndexCapsAction.class),
new ActionHandler(XPackUsageFeatureAction.ROLLUP, RollupUsageTransportAction.class),
new ActionHandler(XPackInfoFeatureAction.ROLLUP, RollupInfoTransportAction.class)
);
}

View file

@ -10,8 +10,6 @@ import org.apache.lucene.store.BufferedIndexInput;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.blobcache.BlobCacheMetrics;
import org.elasticsearch.blobcache.shared.SharedBlobCacheService;
import org.elasticsearch.client.internal.Client;
@ -482,17 +480,17 @@ public class SearchableSnapshots extends Plugin implements IndexStorePlugin, Eng
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(SearchableSnapshotsStatsAction.INSTANCE, TransportSearchableSnapshotsStatsAction.class),
new ActionHandler<>(ClearSearchableSnapshotsCacheAction.INSTANCE, TransportClearSearchableSnapshotsCacheAction.class),
new ActionHandler<>(MountSearchableSnapshotAction.INSTANCE, TransportMountSearchableSnapshotAction.class),
new ActionHandler<>(XPackUsageFeatureAction.SEARCHABLE_SNAPSHOTS, SearchableSnapshotsUsageTransportAction.class),
new ActionHandler<>(XPackInfoFeatureAction.SEARCHABLE_SNAPSHOTS, SearchableSnapshotsInfoTransportAction.class),
new ActionHandler<>(TransportSearchableSnapshotCacheStoresAction.TYPE, TransportSearchableSnapshotCacheStoresAction.class),
new ActionHandler<>(FrozenCacheInfoAction.INSTANCE, FrozenCacheInfoAction.TransportAction.class),
new ActionHandler<>(FrozenCacheInfoNodeAction.INSTANCE, FrozenCacheInfoNodeAction.TransportAction.class),
new ActionHandler<>(
new ActionHandler(SearchableSnapshotsStatsAction.INSTANCE, TransportSearchableSnapshotsStatsAction.class),
new ActionHandler(ClearSearchableSnapshotsCacheAction.INSTANCE, TransportClearSearchableSnapshotsCacheAction.class),
new ActionHandler(MountSearchableSnapshotAction.INSTANCE, TransportMountSearchableSnapshotAction.class),
new ActionHandler(XPackUsageFeatureAction.SEARCHABLE_SNAPSHOTS, SearchableSnapshotsUsageTransportAction.class),
new ActionHandler(XPackInfoFeatureAction.SEARCHABLE_SNAPSHOTS, SearchableSnapshotsInfoTransportAction.class),
new ActionHandler(TransportSearchableSnapshotCacheStoresAction.TYPE, TransportSearchableSnapshotCacheStoresAction.class),
new ActionHandler(FrozenCacheInfoAction.INSTANCE, FrozenCacheInfoAction.TransportAction.class),
new ActionHandler(FrozenCacheInfoNodeAction.INSTANCE, FrozenCacheInfoNodeAction.TransportAction.class),
new ActionHandler(
TransportSearchableSnapshotsNodeCachesStatsAction.TYPE,
TransportSearchableSnapshotsNodeCachesStatsAction.class
)

View file

@ -20,7 +20,6 @@ import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.ResourceAlreadyExistsException;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.support.ActionFilter;
import org.elasticsearch.action.support.DestructiveOperations;
@ -1582,80 +1581,80 @@ public class Security extends Plugin
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
var usageAction = new ActionHandler<>(XPackUsageFeatureAction.SECURITY, SecurityUsageTransportAction.class);
var infoAction = new ActionHandler<>(XPackInfoFeatureAction.SECURITY, SecurityInfoTransportAction.class);
public List<ActionHandler> getActions() {
var usageAction = new ActionHandler(XPackUsageFeatureAction.SECURITY, SecurityUsageTransportAction.class);
var infoAction = new ActionHandler(XPackInfoFeatureAction.SECURITY, SecurityInfoTransportAction.class);
if (enabled == false) {
return Arrays.asList(usageAction, infoAction);
}
return Stream.of(
new ActionHandler<>(ClearRealmCacheAction.INSTANCE, TransportClearRealmCacheAction.class),
new ActionHandler<>(ClearRolesCacheAction.INSTANCE, TransportClearRolesCacheAction.class),
new ActionHandler<>(ClearPrivilegesCacheAction.INSTANCE, TransportClearPrivilegesCacheAction.class),
new ActionHandler<>(ClearSecurityCacheAction.INSTANCE, TransportClearSecurityCacheAction.class),
new ActionHandler<>(GetUsersAction.INSTANCE, TransportGetUsersAction.class),
new ActionHandler<>(ActionTypes.QUERY_USER_ACTION, TransportQueryUserAction.class),
new ActionHandler<>(PutUserAction.INSTANCE, TransportPutUserAction.class),
new ActionHandler<>(DeleteUserAction.INSTANCE, TransportDeleteUserAction.class),
new ActionHandler<>(GetRolesAction.INSTANCE, TransportGetRolesAction.class),
new ActionHandler<>(ActionTypes.QUERY_ROLE_ACTION, TransportQueryRoleAction.class),
new ActionHandler<>(PutRoleAction.INSTANCE, TransportPutRoleAction.class),
new ActionHandler<>(ActionTypes.BULK_PUT_ROLES, TransportBulkPutRolesAction.class),
new ActionHandler<>(ActionTypes.BULK_DELETE_ROLES, TransportBulkDeleteRolesAction.class),
new ActionHandler<>(DeleteRoleAction.INSTANCE, TransportDeleteRoleAction.class),
new ActionHandler<>(TransportChangePasswordAction.TYPE, TransportChangePasswordAction.class),
new ActionHandler<>(AuthenticateAction.INSTANCE, TransportAuthenticateAction.class),
new ActionHandler<>(TransportSetEnabledAction.TYPE, TransportSetEnabledAction.class),
new ActionHandler<>(HasPrivilegesAction.INSTANCE, TransportHasPrivilegesAction.class),
new ActionHandler<>(GetUserPrivilegesAction.INSTANCE, TransportGetUserPrivilegesAction.class),
new ActionHandler<>(GetRoleMappingsAction.INSTANCE, TransportGetRoleMappingsAction.class),
new ActionHandler<>(PutRoleMappingAction.INSTANCE, TransportPutRoleMappingAction.class),
new ActionHandler<>(DeleteRoleMappingAction.INSTANCE, TransportDeleteRoleMappingAction.class),
new ActionHandler<>(CreateTokenAction.INSTANCE, TransportCreateTokenAction.class),
new ActionHandler<>(InvalidateTokenAction.INSTANCE, TransportInvalidateTokenAction.class),
new ActionHandler<>(GetCertificateInfoAction.INSTANCE, TransportGetCertificateInfoAction.class),
new ActionHandler<>(RefreshTokenAction.INSTANCE, TransportRefreshTokenAction.class),
new ActionHandler<>(SamlPrepareAuthenticationAction.INSTANCE, TransportSamlPrepareAuthenticationAction.class),
new ActionHandler<>(SamlAuthenticateAction.INSTANCE, TransportSamlAuthenticateAction.class),
new ActionHandler<>(SamlLogoutAction.INSTANCE, TransportSamlLogoutAction.class),
new ActionHandler<>(SamlInvalidateSessionAction.INSTANCE, TransportSamlInvalidateSessionAction.class),
new ActionHandler<>(TransportSamlCompleteLogoutAction.TYPE, TransportSamlCompleteLogoutAction.class),
new ActionHandler<>(SamlSpMetadataAction.INSTANCE, TransportSamlSpMetadataAction.class),
new ActionHandler<>(OpenIdConnectPrepareAuthenticationAction.INSTANCE, TransportOpenIdConnectPrepareAuthenticationAction.class),
new ActionHandler<>(OpenIdConnectAuthenticateAction.INSTANCE, TransportOpenIdConnectAuthenticateAction.class),
new ActionHandler<>(OpenIdConnectLogoutAction.INSTANCE, TransportOpenIdConnectLogoutAction.class),
new ActionHandler<>(GetBuiltinPrivilegesAction.INSTANCE, TransportGetBuiltinPrivilegesAction.class),
new ActionHandler<>(GetPrivilegesAction.INSTANCE, TransportGetPrivilegesAction.class),
new ActionHandler<>(PutPrivilegesAction.INSTANCE, TransportPutPrivilegesAction.class),
new ActionHandler<>(DeletePrivilegesAction.INSTANCE, TransportDeletePrivilegesAction.class),
new ActionHandler<>(CreateApiKeyAction.INSTANCE, TransportCreateApiKeyAction.class),
new ActionHandler<>(CreateCrossClusterApiKeyAction.INSTANCE, TransportCreateCrossClusterApiKeyAction.class),
new ActionHandler<>(GrantApiKeyAction.INSTANCE, TransportGrantApiKeyAction.class),
new ActionHandler<>(InvalidateApiKeyAction.INSTANCE, TransportInvalidateApiKeyAction.class),
new ActionHandler<>(GetApiKeyAction.INSTANCE, TransportGetApiKeyAction.class),
new ActionHandler<>(QueryApiKeyAction.INSTANCE, TransportQueryApiKeyAction.class),
new ActionHandler<>(UpdateApiKeyAction.INSTANCE, TransportUpdateApiKeyAction.class),
new ActionHandler<>(BulkUpdateApiKeyAction.INSTANCE, TransportBulkUpdateApiKeyAction.class),
new ActionHandler<>(UpdateCrossClusterApiKeyAction.INSTANCE, TransportUpdateCrossClusterApiKeyAction.class),
new ActionHandler<>(DelegatePkiAuthenticationAction.INSTANCE, TransportDelegatePkiAuthenticationAction.class),
new ActionHandler<>(CreateServiceAccountTokenAction.INSTANCE, TransportCreateServiceAccountTokenAction.class),
new ActionHandler<>(DeleteServiceAccountTokenAction.INSTANCE, TransportDeleteServiceAccountTokenAction.class),
new ActionHandler<>(GetServiceAccountCredentialsAction.INSTANCE, TransportGetServiceAccountCredentialsAction.class),
new ActionHandler<>(GetServiceAccountNodesCredentialsAction.INSTANCE, TransportGetServiceAccountNodesCredentialsAction.class),
new ActionHandler<>(GetServiceAccountAction.INSTANCE, TransportGetServiceAccountAction.class),
new ActionHandler<>(KibanaEnrollmentAction.INSTANCE, TransportKibanaEnrollmentAction.class),
new ActionHandler<>(NodeEnrollmentAction.INSTANCE, TransportNodeEnrollmentAction.class),
new ActionHandler<>(ProfileHasPrivilegesAction.INSTANCE, TransportProfileHasPrivilegesAction.class),
new ActionHandler<>(GetProfilesAction.INSTANCE, TransportGetProfilesAction.class),
new ActionHandler<>(ActivateProfileAction.INSTANCE, TransportActivateProfileAction.class),
new ActionHandler<>(UpdateProfileDataAction.INSTANCE, TransportUpdateProfileDataAction.class),
new ActionHandler<>(SuggestProfilesAction.INSTANCE, TransportSuggestProfilesAction.class),
new ActionHandler<>(SetProfileEnabledAction.INSTANCE, TransportSetProfileEnabledAction.class),
new ActionHandler<>(GetSecuritySettingsAction.INSTANCE, TransportGetSecuritySettingsAction.class),
new ActionHandler<>(UpdateSecuritySettingsAction.INSTANCE, TransportUpdateSecuritySettingsAction.class),
new ActionHandler<>(ActionTypes.RELOAD_REMOTE_CLUSTER_CREDENTIALS_ACTION, TransportReloadRemoteClusterCredentialsAction.class),
new ActionHandler<>(UpdateIndexMigrationVersionAction.INSTANCE, UpdateIndexMigrationVersionAction.TransportAction.class),
new ActionHandler(ClearRealmCacheAction.INSTANCE, TransportClearRealmCacheAction.class),
new ActionHandler(ClearRolesCacheAction.INSTANCE, TransportClearRolesCacheAction.class),
new ActionHandler(ClearPrivilegesCacheAction.INSTANCE, TransportClearPrivilegesCacheAction.class),
new ActionHandler(ClearSecurityCacheAction.INSTANCE, TransportClearSecurityCacheAction.class),
new ActionHandler(GetUsersAction.INSTANCE, TransportGetUsersAction.class),
new ActionHandler(ActionTypes.QUERY_USER_ACTION, TransportQueryUserAction.class),
new ActionHandler(PutUserAction.INSTANCE, TransportPutUserAction.class),
new ActionHandler(DeleteUserAction.INSTANCE, TransportDeleteUserAction.class),
new ActionHandler(GetRolesAction.INSTANCE, TransportGetRolesAction.class),
new ActionHandler(ActionTypes.QUERY_ROLE_ACTION, TransportQueryRoleAction.class),
new ActionHandler(PutRoleAction.INSTANCE, TransportPutRoleAction.class),
new ActionHandler(ActionTypes.BULK_PUT_ROLES, TransportBulkPutRolesAction.class),
new ActionHandler(ActionTypes.BULK_DELETE_ROLES, TransportBulkDeleteRolesAction.class),
new ActionHandler(DeleteRoleAction.INSTANCE, TransportDeleteRoleAction.class),
new ActionHandler(TransportChangePasswordAction.TYPE, TransportChangePasswordAction.class),
new ActionHandler(AuthenticateAction.INSTANCE, TransportAuthenticateAction.class),
new ActionHandler(TransportSetEnabledAction.TYPE, TransportSetEnabledAction.class),
new ActionHandler(HasPrivilegesAction.INSTANCE, TransportHasPrivilegesAction.class),
new ActionHandler(GetUserPrivilegesAction.INSTANCE, TransportGetUserPrivilegesAction.class),
new ActionHandler(GetRoleMappingsAction.INSTANCE, TransportGetRoleMappingsAction.class),
new ActionHandler(PutRoleMappingAction.INSTANCE, TransportPutRoleMappingAction.class),
new ActionHandler(DeleteRoleMappingAction.INSTANCE, TransportDeleteRoleMappingAction.class),
new ActionHandler(CreateTokenAction.INSTANCE, TransportCreateTokenAction.class),
new ActionHandler(InvalidateTokenAction.INSTANCE, TransportInvalidateTokenAction.class),
new ActionHandler(GetCertificateInfoAction.INSTANCE, TransportGetCertificateInfoAction.class),
new ActionHandler(RefreshTokenAction.INSTANCE, TransportRefreshTokenAction.class),
new ActionHandler(SamlPrepareAuthenticationAction.INSTANCE, TransportSamlPrepareAuthenticationAction.class),
new ActionHandler(SamlAuthenticateAction.INSTANCE, TransportSamlAuthenticateAction.class),
new ActionHandler(SamlLogoutAction.INSTANCE, TransportSamlLogoutAction.class),
new ActionHandler(SamlInvalidateSessionAction.INSTANCE, TransportSamlInvalidateSessionAction.class),
new ActionHandler(TransportSamlCompleteLogoutAction.TYPE, TransportSamlCompleteLogoutAction.class),
new ActionHandler(SamlSpMetadataAction.INSTANCE, TransportSamlSpMetadataAction.class),
new ActionHandler(OpenIdConnectPrepareAuthenticationAction.INSTANCE, TransportOpenIdConnectPrepareAuthenticationAction.class),
new ActionHandler(OpenIdConnectAuthenticateAction.INSTANCE, TransportOpenIdConnectAuthenticateAction.class),
new ActionHandler(OpenIdConnectLogoutAction.INSTANCE, TransportOpenIdConnectLogoutAction.class),
new ActionHandler(GetBuiltinPrivilegesAction.INSTANCE, TransportGetBuiltinPrivilegesAction.class),
new ActionHandler(GetPrivilegesAction.INSTANCE, TransportGetPrivilegesAction.class),
new ActionHandler(PutPrivilegesAction.INSTANCE, TransportPutPrivilegesAction.class),
new ActionHandler(DeletePrivilegesAction.INSTANCE, TransportDeletePrivilegesAction.class),
new ActionHandler(CreateApiKeyAction.INSTANCE, TransportCreateApiKeyAction.class),
new ActionHandler(CreateCrossClusterApiKeyAction.INSTANCE, TransportCreateCrossClusterApiKeyAction.class),
new ActionHandler(GrantApiKeyAction.INSTANCE, TransportGrantApiKeyAction.class),
new ActionHandler(InvalidateApiKeyAction.INSTANCE, TransportInvalidateApiKeyAction.class),
new ActionHandler(GetApiKeyAction.INSTANCE, TransportGetApiKeyAction.class),
new ActionHandler(QueryApiKeyAction.INSTANCE, TransportQueryApiKeyAction.class),
new ActionHandler(UpdateApiKeyAction.INSTANCE, TransportUpdateApiKeyAction.class),
new ActionHandler(BulkUpdateApiKeyAction.INSTANCE, TransportBulkUpdateApiKeyAction.class),
new ActionHandler(UpdateCrossClusterApiKeyAction.INSTANCE, TransportUpdateCrossClusterApiKeyAction.class),
new ActionHandler(DelegatePkiAuthenticationAction.INSTANCE, TransportDelegatePkiAuthenticationAction.class),
new ActionHandler(CreateServiceAccountTokenAction.INSTANCE, TransportCreateServiceAccountTokenAction.class),
new ActionHandler(DeleteServiceAccountTokenAction.INSTANCE, TransportDeleteServiceAccountTokenAction.class),
new ActionHandler(GetServiceAccountCredentialsAction.INSTANCE, TransportGetServiceAccountCredentialsAction.class),
new ActionHandler(GetServiceAccountNodesCredentialsAction.INSTANCE, TransportGetServiceAccountNodesCredentialsAction.class),
new ActionHandler(GetServiceAccountAction.INSTANCE, TransportGetServiceAccountAction.class),
new ActionHandler(KibanaEnrollmentAction.INSTANCE, TransportKibanaEnrollmentAction.class),
new ActionHandler(NodeEnrollmentAction.INSTANCE, TransportNodeEnrollmentAction.class),
new ActionHandler(ProfileHasPrivilegesAction.INSTANCE, TransportProfileHasPrivilegesAction.class),
new ActionHandler(GetProfilesAction.INSTANCE, TransportGetProfilesAction.class),
new ActionHandler(ActivateProfileAction.INSTANCE, TransportActivateProfileAction.class),
new ActionHandler(UpdateProfileDataAction.INSTANCE, TransportUpdateProfileDataAction.class),
new ActionHandler(SuggestProfilesAction.INSTANCE, TransportSuggestProfilesAction.class),
new ActionHandler(SetProfileEnabledAction.INSTANCE, TransportSetProfileEnabledAction.class),
new ActionHandler(GetSecuritySettingsAction.INSTANCE, TransportGetSecuritySettingsAction.class),
new ActionHandler(UpdateSecuritySettingsAction.INSTANCE, TransportUpdateSecuritySettingsAction.class),
new ActionHandler(ActionTypes.RELOAD_REMOTE_CLUSTER_CREDENTIALS_ACTION, TransportReloadRemoteClusterCredentialsAction.class),
new ActionHandler(UpdateIndexMigrationVersionAction.INSTANCE, UpdateIndexMigrationVersionAction.TransportAction.class),
usageAction,
infoAction
).filter(Objects::nonNull).toList();

View file

@ -6,9 +6,6 @@
*/
package org.elasticsearch.xpack.shutdown;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@ -39,19 +36,10 @@ public class ShutdownPlugin extends Plugin implements ActionPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
ActionHandler<PutShutdownNodeAction.Request, AcknowledgedResponse> putShutdown = new ActionHandler<>(
PutShutdownNodeAction.INSTANCE,
TransportPutShutdownNodeAction.class
);
ActionHandler<DeleteShutdownNodeAction.Request, AcknowledgedResponse> deleteShutdown = new ActionHandler<>(
DeleteShutdownNodeAction.INSTANCE,
TransportDeleteShutdownNodeAction.class
);
ActionHandler<GetShutdownStatusAction.Request, GetShutdownStatusAction.Response> getStatus = new ActionHandler<>(
GetShutdownStatusAction.INSTANCE,
TransportGetShutdownStatusAction.class
);
public List<ActionHandler> getActions() {
ActionHandler putShutdown = new ActionHandler(PutShutdownNodeAction.INSTANCE, TransportPutShutdownNodeAction.class);
ActionHandler deleteShutdown = new ActionHandler(DeleteShutdownNodeAction.INSTANCE, TransportDeleteShutdownNodeAction.class);
ActionHandler getStatus = new ActionHandler(GetShutdownStatusAction.INSTANCE, TransportGetShutdownStatusAction.class);
return Arrays.asList(putShutdown, deleteShutdown, getStatus);
}

View file

@ -8,8 +8,6 @@ package org.elasticsearch.xpack.slm;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.client.internal.OriginSettingClient;
import org.elasticsearch.cluster.ClusterState;
@ -210,25 +208,25 @@ public class SnapshotLifecycle extends Plugin implements ActionPlugin, HealthPlu
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
var slmUsageAction = new ActionHandler<>(XPackUsageFeatureAction.SNAPSHOT_LIFECYCLE, SLMUsageTransportAction.class);
var slmInfoAction = new ActionHandler<>(XPackInfoFeatureAction.SNAPSHOT_LIFECYCLE, SLMInfoTransportAction.class);
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>();
public List<ActionHandler> getActions() {
var slmUsageAction = new ActionHandler(XPackUsageFeatureAction.SNAPSHOT_LIFECYCLE, SLMUsageTransportAction.class);
var slmInfoAction = new ActionHandler(XPackInfoFeatureAction.SNAPSHOT_LIFECYCLE, SLMInfoTransportAction.class);
List<ActionHandler> actions = new ArrayList<>();
actions.add(slmUsageAction);
actions.add(slmInfoAction);
actions.addAll(
Arrays.asList(
// add SLM actions
new ActionHandler<>(PutSnapshotLifecycleAction.INSTANCE, TransportPutSnapshotLifecycleAction.class),
new ActionHandler<>(DeleteSnapshotLifecycleAction.INSTANCE, TransportDeleteSnapshotLifecycleAction.class),
new ActionHandler<>(GetSnapshotLifecycleAction.INSTANCE, TransportGetSnapshotLifecycleAction.class),
new ActionHandler<>(ExecuteSnapshotLifecycleAction.INSTANCE, TransportExecuteSnapshotLifecycleAction.class),
new ActionHandler<>(GetSnapshotLifecycleStatsAction.INSTANCE, TransportGetSnapshotLifecycleStatsAction.class),
new ActionHandler<>(ExecuteSnapshotRetentionAction.INSTANCE, TransportExecuteSnapshotRetentionAction.class),
new ActionHandler<>(TransportSLMGetExpiredSnapshotsAction.INSTANCE, TransportSLMGetExpiredSnapshotsAction.class),
new ActionHandler<>(StartSLMAction.INSTANCE, TransportStartSLMAction.class),
new ActionHandler<>(StopSLMAction.INSTANCE, TransportStopSLMAction.class),
new ActionHandler<>(GetSLMStatusAction.INSTANCE, TransportGetSLMStatusAction.class)
new ActionHandler(PutSnapshotLifecycleAction.INSTANCE, TransportPutSnapshotLifecycleAction.class),
new ActionHandler(DeleteSnapshotLifecycleAction.INSTANCE, TransportDeleteSnapshotLifecycleAction.class),
new ActionHandler(GetSnapshotLifecycleAction.INSTANCE, TransportGetSnapshotLifecycleAction.class),
new ActionHandler(ExecuteSnapshotLifecycleAction.INSTANCE, TransportExecuteSnapshotLifecycleAction.class),
new ActionHandler(GetSnapshotLifecycleStatsAction.INSTANCE, TransportGetSnapshotLifecycleStatsAction.class),
new ActionHandler(ExecuteSnapshotRetentionAction.INSTANCE, TransportExecuteSnapshotRetentionAction.class),
new ActionHandler(TransportSLMGetExpiredSnapshotsAction.INSTANCE, TransportSLMGetExpiredSnapshotsAction.class),
new ActionHandler(StartSLMAction.INSTANCE, TransportStartSLMAction.class),
new ActionHandler(StopSLMAction.INSTANCE, TransportStopSLMAction.class),
new ActionHandler(GetSLMStatusAction.INSTANCE, TransportGetSLMStatusAction.class)
)
);
return actions;

View file

@ -7,8 +7,6 @@
package org.elasticsearch.repositories.blobstore.testkit;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@ -38,10 +36,10 @@ import java.util.function.Supplier;
public class SnapshotRepositoryTestKit extends Plugin implements ActionPlugin {
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return List.of(
new ActionHandler<>(RepositoryAnalyzeAction.INSTANCE, RepositoryAnalyzeAction.class),
new ActionHandler<>(
new ActionHandler(RepositoryAnalyzeAction.INSTANCE, RepositoryAnalyzeAction.class),
new ActionHandler(
TransportRepositoryVerifyIntegrityCoordinationAction.INSTANCE,
TransportRepositoryVerifyIntegrityCoordinationAction.class
)

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.spatial;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.common.geo.GeoFormatterFactory;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.index.mapper.Mapper;
@ -126,11 +124,11 @@ public class SpatialPlugin extends Plugin implements ActionPlugin, MapperPlugin,
private final SetOnce<GeoFormatterFactory<Geometry>> geoFormatterFactory = new SetOnce<>();
@Override
public List<ActionPlugin.ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionPlugin.ActionHandler> getActions() {
return List.of(
new ActionPlugin.ActionHandler<>(XPackUsageFeatureAction.SPATIAL, SpatialUsageTransportAction.class),
new ActionPlugin.ActionHandler<>(XPackInfoFeatureAction.SPATIAL, SpatialInfoTransportAction.class),
new ActionPlugin.ActionHandler<>(SpatialStatsAction.INSTANCE, SpatialStatsTransportAction.class)
new ActionPlugin.ActionHandler(XPackUsageFeatureAction.SPATIAL, SpatialUsageTransportAction.class),
new ActionPlugin.ActionHandler(XPackInfoFeatureAction.SPATIAL, SpatialInfoTransportAction.class),
new ActionPlugin.ActionHandler(SpatialStatsAction.INSTANCE, SpatialStatsTransportAction.class)
);
}

View file

@ -6,8 +6,6 @@
*/
package org.elasticsearch.xpack.sql.plugin;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
@ -133,17 +131,17 @@ public class SqlPlugin extends Plugin implements ActionPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
var usageAction = new ActionHandler<>(XPackUsageFeatureAction.SQL, SqlUsageTransportAction.class);
var infoAction = new ActionHandler<>(XPackInfoFeatureAction.SQL, SqlInfoTransportAction.class);
public List<ActionHandler> getActions() {
var usageAction = new ActionHandler(XPackUsageFeatureAction.SQL, SqlUsageTransportAction.class);
var infoAction = new ActionHandler(XPackInfoFeatureAction.SQL, SqlInfoTransportAction.class);
return Arrays.asList(
new ActionHandler<>(SqlQueryAction.INSTANCE, TransportSqlQueryAction.class),
new ActionHandler<>(SqlTranslateAction.INSTANCE, TransportSqlTranslateAction.class),
new ActionHandler<>(SqlClearCursorAction.INSTANCE, TransportSqlClearCursorAction.class),
new ActionHandler<>(SqlStatsAction.INSTANCE, TransportSqlStatsAction.class),
new ActionHandler<>(SqlAsyncGetResultsAction.INSTANCE, TransportSqlAsyncGetResultsAction.class),
new ActionHandler<>(SqlAsyncGetStatusAction.INSTANCE, TransportSqlAsyncGetStatusAction.class),
new ActionHandler(SqlQueryAction.INSTANCE, TransportSqlQueryAction.class),
new ActionHandler(SqlTranslateAction.INSTANCE, TransportSqlTranslateAction.class),
new ActionHandler(SqlClearCursorAction.INSTANCE, TransportSqlClearCursorAction.class),
new ActionHandler(SqlStatsAction.INSTANCE, TransportSqlStatsAction.class),
new ActionHandler(SqlAsyncGetResultsAction.INSTANCE, TransportSqlAsyncGetResultsAction.class),
new ActionHandler(SqlAsyncGetStatusAction.INSTANCE, TransportSqlAsyncGetStatusAction.class),
usageAction,
infoAction
);

View file

@ -7,8 +7,6 @@
package org.elasticsearch.xpack.textstructure;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@ -68,12 +66,12 @@ public class TextStructurePlugin extends Plugin implements ActionPlugin {
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return Arrays.asList(
new ActionHandler<>(FindFieldStructureAction.INSTANCE, TransportFindFieldStructureAction.class),
new ActionHandler<>(FindMessageStructureAction.INSTANCE, TransportFindMessageStructureAction.class),
new ActionHandler<>(FindStructureAction.INSTANCE, TransportFindStructureAction.class),
new ActionHandler<>(TestGrokPatternAction.INSTANCE, TransportTestGrokPatternAction.class)
new ActionHandler(FindFieldStructureAction.INSTANCE, TransportFindFieldStructureAction.class),
new ActionHandler(FindMessageStructureAction.INSTANCE, TransportFindMessageStructureAction.class),
new ActionHandler(FindStructureAction.INSTANCE, TransportFindStructureAction.class),
new ActionHandler(TestGrokPatternAction.INSTANCE, TransportTestGrokPatternAction.class)
);
}
}

View file

@ -13,8 +13,6 @@ import org.apache.lucene.util.SetOnce;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ElasticsearchStatusException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
import org.elasticsearch.action.admin.cluster.snapshots.features.ResetFeatureStateResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
@ -257,32 +255,32 @@ public class Transform extends Plugin implements SystemIndexPlugin, PersistentTa
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return Arrays.asList(
new ActionHandler<>(PutTransformAction.INSTANCE, TransportPutTransformAction.class),
new ActionHandler<>(StartTransformAction.INSTANCE, TransportStartTransformAction.class),
new ActionHandler<>(StopTransformAction.INSTANCE, TransportStopTransformAction.class),
new ActionHandler<>(DeleteTransformAction.INSTANCE, TransportDeleteTransformAction.class),
new ActionHandler<>(GetTransformAction.INSTANCE, TransportGetTransformAction.class),
new ActionHandler<>(GetTransformStatsAction.INSTANCE, TransportGetTransformStatsAction.class),
new ActionHandler<>(PreviewTransformAction.INSTANCE, TransportPreviewTransformAction.class),
new ActionHandler<>(UpdateTransformAction.INSTANCE, TransportUpdateTransformAction.class),
new ActionHandler<>(SetResetModeAction.INSTANCE, TransportSetTransformResetModeAction.class),
new ActionHandler<>(UpgradeTransformsAction.INSTANCE, TransportUpgradeTransformsAction.class),
new ActionHandler<>(ResetTransformAction.INSTANCE, TransportResetTransformAction.class),
new ActionHandler<>(ScheduleNowTransformAction.INSTANCE, TransportScheduleNowTransformAction.class),
new ActionHandler<>(GetTransformNodeStatsAction.INSTANCE, TransportGetTransformNodeStatsAction.class),
new ActionHandler<>(SetTransformUpgradeModeAction.INSTANCE, TransportSetTransformUpgradeModeAction.class),
new ActionHandler(PutTransformAction.INSTANCE, TransportPutTransformAction.class),
new ActionHandler(StartTransformAction.INSTANCE, TransportStartTransformAction.class),
new ActionHandler(StopTransformAction.INSTANCE, TransportStopTransformAction.class),
new ActionHandler(DeleteTransformAction.INSTANCE, TransportDeleteTransformAction.class),
new ActionHandler(GetTransformAction.INSTANCE, TransportGetTransformAction.class),
new ActionHandler(GetTransformStatsAction.INSTANCE, TransportGetTransformStatsAction.class),
new ActionHandler(PreviewTransformAction.INSTANCE, TransportPreviewTransformAction.class),
new ActionHandler(UpdateTransformAction.INSTANCE, TransportUpdateTransformAction.class),
new ActionHandler(SetResetModeAction.INSTANCE, TransportSetTransformResetModeAction.class),
new ActionHandler(UpgradeTransformsAction.INSTANCE, TransportUpgradeTransformsAction.class),
new ActionHandler(ResetTransformAction.INSTANCE, TransportResetTransformAction.class),
new ActionHandler(ScheduleNowTransformAction.INSTANCE, TransportScheduleNowTransformAction.class),
new ActionHandler(GetTransformNodeStatsAction.INSTANCE, TransportGetTransformNodeStatsAction.class),
new ActionHandler(SetTransformUpgradeModeAction.INSTANCE, TransportSetTransformUpgradeModeAction.class),
// internal, no rest endpoint
new ActionHandler<>(ValidateTransformAction.INSTANCE, TransportValidateTransformAction.class),
new ActionHandler<>(GetCheckpointAction.INSTANCE, TransportGetCheckpointAction.class),
new ActionHandler<>(GetCheckpointNodeAction.INSTANCE, TransportGetCheckpointNodeAction.class),
new ActionHandler(ValidateTransformAction.INSTANCE, TransportValidateTransformAction.class),
new ActionHandler(GetCheckpointAction.INSTANCE, TransportGetCheckpointAction.class),
new ActionHandler(GetCheckpointNodeAction.INSTANCE, TransportGetCheckpointNodeAction.class),
// usage and info
new ActionHandler<>(XPackUsageFeatureAction.TRANSFORM, TransformUsageTransportAction.class),
new ActionHandler<>(XPackInfoFeatureAction.TRANSFORM, TransformInfoTransportAction.class)
new ActionHandler(XPackUsageFeatureAction.TRANSFORM, TransformUsageTransportAction.class),
new ActionHandler(XPackInfoFeatureAction.TRANSFORM, TransformInfoTransportAction.class)
);
}

View file

@ -9,8 +9,6 @@ package org.elasticsearch.cluster.coordination.votingonly;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.coordination.CoordinationMetadata.VotingConfiguration;
import org.elasticsearch.cluster.coordination.CoordinationState.VoteCollection;
import org.elasticsearch.cluster.coordination.ElectionStrategy;
@ -82,10 +80,10 @@ public class VotingOnlyNodePlugin extends Plugin implements ClusterCoordinationP
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
public List<ActionHandler> getActions() {
return Arrays.asList(
new ActionHandler<>(XPackUsageFeatureAction.VOTING_ONLY, VotingOnlyUsageTransportAction.class),
new ActionHandler<>(XPackInfoFeatureAction.VOTING_ONLY, VotingOnlyInfoTransportAction.class)
new ActionHandler(XPackUsageFeatureAction.VOTING_ONLY, VotingOnlyUsageTransportAction.class),
new ActionHandler(XPackInfoFeatureAction.VOTING_ONLY, VotingOnlyInfoTransportAction.class)
);
}

View file

@ -9,8 +9,6 @@ package org.elasticsearch.xpack.watcher;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.bulk.BulkItemResponse;
import org.elasticsearch.action.bulk.BulkProcessor2;
import org.elasticsearch.action.bulk.BulkRequest;
@ -681,24 +679,24 @@ public class Watcher extends Plugin implements SystemIndexPlugin, ScriptPlugin,
}
@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
var usageAction = new ActionHandler<>(XPackUsageFeatureAction.WATCHER, WatcherUsageTransportAction.class);
var infoAction = new ActionHandler<>(XPackInfoFeatureAction.WATCHER, WatcherInfoTransportAction.class);
public List<ActionHandler> getActions() {
var usageAction = new ActionHandler(XPackUsageFeatureAction.WATCHER, WatcherUsageTransportAction.class);
var infoAction = new ActionHandler(XPackInfoFeatureAction.WATCHER, WatcherInfoTransportAction.class);
if (false == enabled) {
return Arrays.asList(usageAction, infoAction);
}
return Arrays.asList(
new ActionHandler<>(PutWatchAction.INSTANCE, TransportPutWatchAction.class),
new ActionHandler<>(DeleteWatchAction.INSTANCE, TransportDeleteWatchAction.class),
new ActionHandler<>(GetWatchAction.INSTANCE, TransportGetWatchAction.class),
new ActionHandler<>(WatcherStatsAction.INSTANCE, TransportWatcherStatsAction.class),
new ActionHandler<>(AckWatchAction.INSTANCE, TransportAckWatchAction.class),
new ActionHandler<>(ActivateWatchAction.INSTANCE, TransportActivateWatchAction.class),
new ActionHandler<>(WatcherServiceAction.INSTANCE, TransportWatcherServiceAction.class),
new ActionHandler<>(ExecuteWatchAction.INSTANCE, TransportExecuteWatchAction.class),
new ActionHandler<>(QueryWatchesAction.INSTANCE, TransportQueryWatchesAction.class),
new ActionHandler<>(UpdateWatcherSettingsAction.INSTANCE, TransportUpdateWatcherSettingsAction.class),
new ActionHandler<>(GetWatcherSettingsAction.INSTANCE, TransportGetWatcherSettingsAction.class),
new ActionHandler(PutWatchAction.INSTANCE, TransportPutWatchAction.class),
new ActionHandler(DeleteWatchAction.INSTANCE, TransportDeleteWatchAction.class),
new ActionHandler(GetWatchAction.INSTANCE, TransportGetWatchAction.class),
new ActionHandler(WatcherStatsAction.INSTANCE, TransportWatcherStatsAction.class),
new ActionHandler(AckWatchAction.INSTANCE, TransportAckWatchAction.class),
new ActionHandler(ActivateWatchAction.INSTANCE, TransportActivateWatchAction.class),
new ActionHandler(WatcherServiceAction.INSTANCE, TransportWatcherServiceAction.class),
new ActionHandler(ExecuteWatchAction.INSTANCE, TransportExecuteWatchAction.class),
new ActionHandler(QueryWatchesAction.INSTANCE, TransportQueryWatchesAction.class),
new ActionHandler(UpdateWatcherSettingsAction.INSTANCE, TransportUpdateWatcherSettingsAction.class),
new ActionHandler(GetWatcherSettingsAction.INSTANCE, TransportGetWatcherSettingsAction.class),
usageAction,
infoAction
);