From b321351dd7512fd6f0f6a5c5bafbec1f3572070e Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Thu, 7 Sep 2023 23:42:27 +0200 Subject: [PATCH] Remove ActionPlugin.getClientActions (#97709) This isn't used any longer with the transport client gone. --- .../elasticsearch/plugins/ActionPlugin.java | 8 - .../xpack/core/XPackClientPlugin.java | 294 ------------------ 2 files changed, 302 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/plugins/ActionPlugin.java b/server/src/main/java/org/elasticsearch/plugins/ActionPlugin.java index 207920cd60ac9..095eec2811edc 100644 --- a/server/src/main/java/org/elasticsearch/plugins/ActionPlugin.java +++ b/server/src/main/java/org/elasticsearch/plugins/ActionPlugin.java @@ -52,14 +52,6 @@ public interface ActionPlugin { return Collections.emptyList(); } - /** - * Client actions added by this plugin. This defaults to all of the {@linkplain ActionType} in - * {@linkplain ActionPlugin#getActions()}. - */ - default List> getClientActions() { - return getActions().stream().>map(a -> a.action).toList(); - } - /** * ActionType filters added by this plugin. */ diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackClientPlugin.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackClientPlugin.java index 7e2c9dd494086..5610b18ac627c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackClientPlugin.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackClientPlugin.java @@ -6,21 +6,12 @@ */ package org.elasticsearch.xpack.core; -import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.action.ActionType; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Setting; -import org.elasticsearch.license.DeleteLicenseAction; -import org.elasticsearch.license.GetBasicStatusAction; -import org.elasticsearch.license.GetLicenseAction; -import org.elasticsearch.license.GetTrialStatusAction; import org.elasticsearch.license.LicensesMetadata; -import org.elasticsearch.license.PostStartBasicAction; -import org.elasticsearch.license.PostStartTrialAction; -import org.elasticsearch.license.PutLicenseAction; import org.elasticsearch.persistent.PersistentTaskParams; import org.elasticsearch.persistent.PersistentTaskState; import org.elasticsearch.plugins.ActionPlugin; @@ -29,27 +20,20 @@ import org.elasticsearch.tasks.Task; import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xcontent.ParseField; -import org.elasticsearch.xpack.cluster.action.MigrateToDataTiersAction; -import org.elasticsearch.xpack.core.action.XPackInfoAction; -import org.elasticsearch.xpack.core.action.XPackUsageAction; import org.elasticsearch.xpack.core.aggregatemetric.AggregateMetricFeatureSetUsage; import org.elasticsearch.xpack.core.analytics.AnalyticsFeatureSetUsage; import org.elasticsearch.xpack.core.application.EnterpriseSearchFeatureSetUsage; import org.elasticsearch.xpack.core.archive.ArchiveFeatureSetUsage; -import org.elasticsearch.xpack.core.async.DeleteAsyncResultAction; import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata; import org.elasticsearch.xpack.core.datastreams.DataStreamFeatureSetUsage; import org.elasticsearch.xpack.core.datastreams.DataStreamLifecycleFeatureSetUsage; -import org.elasticsearch.xpack.core.downsample.DownsampleIndexerAction; import org.elasticsearch.xpack.core.downsample.DownsampleShardStatus; import org.elasticsearch.xpack.core.enrich.EnrichFeatureSetUsage; import org.elasticsearch.xpack.core.enrich.action.ExecuteEnrichPolicyStatus; import org.elasticsearch.xpack.core.eql.EqlFeatureSetUsage; import org.elasticsearch.xpack.core.esql.EsqlFeatureSetUsage; import org.elasticsearch.xpack.core.frozen.FrozenIndicesFeatureSetUsage; -import org.elasticsearch.xpack.core.frozen.action.FreezeIndexAction; import org.elasticsearch.xpack.core.graph.GraphFeatureSetUsage; -import org.elasticsearch.xpack.core.graph.action.GraphExploreAction; import org.elasticsearch.xpack.core.ilm.AllocateAction; import org.elasticsearch.xpack.core.ilm.DeleteAction; import org.elasticsearch.xpack.core.ilm.DownsampleAction; @@ -69,79 +53,13 @@ import org.elasticsearch.xpack.core.ilm.TimeseriesLifecycleType; import org.elasticsearch.xpack.core.ilm.UnfollowAction; import org.elasticsearch.xpack.core.ilm.WaitForSnapshotAction; -import org.elasticsearch.xpack.core.ilm.action.DeleteLifecycleAction; -import org.elasticsearch.xpack.core.ilm.action.ExplainLifecycleAction; -import org.elasticsearch.xpack.core.ilm.action.GetLifecycleAction; -import org.elasticsearch.xpack.core.ilm.action.MoveToStepAction; -import org.elasticsearch.xpack.core.ilm.action.PutLifecycleAction; -import org.elasticsearch.xpack.core.ilm.action.RemoveIndexLifecyclePolicyAction; -import org.elasticsearch.xpack.core.ilm.action.RetryAction; import org.elasticsearch.xpack.core.logstash.LogstashFeatureSetUsage; import org.elasticsearch.xpack.core.ml.MachineLearningFeatureSetUsage; import org.elasticsearch.xpack.core.ml.MlMetadata; import org.elasticsearch.xpack.core.ml.MlTasks; -import org.elasticsearch.xpack.core.ml.action.CloseJobAction; -import org.elasticsearch.xpack.core.ml.action.DeleteCalendarAction; -import org.elasticsearch.xpack.core.ml.action.DeleteCalendarEventAction; -import org.elasticsearch.xpack.core.ml.action.DeleteDataFrameAnalyticsAction; -import org.elasticsearch.xpack.core.ml.action.DeleteDatafeedAction; -import org.elasticsearch.xpack.core.ml.action.DeleteExpiredDataAction; -import org.elasticsearch.xpack.core.ml.action.DeleteFilterAction; -import org.elasticsearch.xpack.core.ml.action.DeleteForecastAction; -import org.elasticsearch.xpack.core.ml.action.DeleteJobAction; -import org.elasticsearch.xpack.core.ml.action.DeleteModelSnapshotAction; -import org.elasticsearch.xpack.core.ml.action.DeleteTrainedModelAction; -import org.elasticsearch.xpack.core.ml.action.EvaluateDataFrameAction; -import org.elasticsearch.xpack.core.ml.action.ExplainDataFrameAnalyticsAction; -import org.elasticsearch.xpack.core.ml.action.FinalizeJobExecutionAction; -import org.elasticsearch.xpack.core.ml.action.FlushJobAction; -import org.elasticsearch.xpack.core.ml.action.ForecastJobAction; -import org.elasticsearch.xpack.core.ml.action.GetBucketsAction; -import org.elasticsearch.xpack.core.ml.action.GetCalendarEventsAction; -import org.elasticsearch.xpack.core.ml.action.GetCalendarsAction; -import org.elasticsearch.xpack.core.ml.action.GetCategoriesAction; -import org.elasticsearch.xpack.core.ml.action.GetDataFrameAnalyticsAction; -import org.elasticsearch.xpack.core.ml.action.GetDataFrameAnalyticsStatsAction; -import org.elasticsearch.xpack.core.ml.action.GetDatafeedsAction; -import org.elasticsearch.xpack.core.ml.action.GetDatafeedsStatsAction; -import org.elasticsearch.xpack.core.ml.action.GetFiltersAction; -import org.elasticsearch.xpack.core.ml.action.GetInfluencersAction; -import org.elasticsearch.xpack.core.ml.action.GetJobsAction; -import org.elasticsearch.xpack.core.ml.action.GetJobsStatsAction; -import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction; -import org.elasticsearch.xpack.core.ml.action.GetOverallBucketsAction; -import org.elasticsearch.xpack.core.ml.action.GetRecordsAction; -import org.elasticsearch.xpack.core.ml.action.GetTrainedModelsAction; -import org.elasticsearch.xpack.core.ml.action.GetTrainedModelsStatsAction; -import org.elasticsearch.xpack.core.ml.action.InferModelAction; -import org.elasticsearch.xpack.core.ml.action.IsolateDatafeedAction; -import org.elasticsearch.xpack.core.ml.action.KillProcessAction; -import org.elasticsearch.xpack.core.ml.action.MlInfoAction; import org.elasticsearch.xpack.core.ml.action.OpenJobAction; -import org.elasticsearch.xpack.core.ml.action.PersistJobAction; -import org.elasticsearch.xpack.core.ml.action.PostCalendarEventsAction; -import org.elasticsearch.xpack.core.ml.action.PostDataAction; -import org.elasticsearch.xpack.core.ml.action.PreviewDatafeedAction; -import org.elasticsearch.xpack.core.ml.action.PutCalendarAction; -import org.elasticsearch.xpack.core.ml.action.PutDataFrameAnalyticsAction; -import org.elasticsearch.xpack.core.ml.action.PutDatafeedAction; -import org.elasticsearch.xpack.core.ml.action.PutFilterAction; -import org.elasticsearch.xpack.core.ml.action.PutJobAction; -import org.elasticsearch.xpack.core.ml.action.PutTrainedModelAction; -import org.elasticsearch.xpack.core.ml.action.RevertModelSnapshotAction; -import org.elasticsearch.xpack.core.ml.action.SetUpgradeModeAction; import org.elasticsearch.xpack.core.ml.action.StartDataFrameAnalyticsAction; import org.elasticsearch.xpack.core.ml.action.StartDatafeedAction; -import org.elasticsearch.xpack.core.ml.action.StopDatafeedAction; -import org.elasticsearch.xpack.core.ml.action.UpdateCalendarJobAction; -import org.elasticsearch.xpack.core.ml.action.UpdateDataFrameAnalyticsAction; -import org.elasticsearch.xpack.core.ml.action.UpdateDatafeedAction; -import org.elasticsearch.xpack.core.ml.action.UpdateFilterAction; -import org.elasticsearch.xpack.core.ml.action.UpdateJobAction; -import org.elasticsearch.xpack.core.ml.action.UpdateModelSnapshotAction; -import org.elasticsearch.xpack.core.ml.action.UpdateProcessAction; -import org.elasticsearch.xpack.core.ml.action.ValidateDetectorAction; -import org.elasticsearch.xpack.core.ml.action.ValidateJobConfigAction; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedState; import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsTaskState; import org.elasticsearch.xpack.core.ml.job.config.JobTaskState; @@ -150,40 +68,10 @@ import org.elasticsearch.xpack.core.monitoring.MonitoringFeatureSetUsage; import org.elasticsearch.xpack.core.rollup.RollupFeatureSetUsage; import org.elasticsearch.xpack.core.rollup.RollupField; -import org.elasticsearch.xpack.core.rollup.action.DeleteRollupJobAction; -import org.elasticsearch.xpack.core.rollup.action.GetRollupCapsAction; -import org.elasticsearch.xpack.core.rollup.action.GetRollupJobsAction; -import org.elasticsearch.xpack.core.rollup.action.PutRollupJobAction; -import org.elasticsearch.xpack.core.rollup.action.RollupSearchAction; -import org.elasticsearch.xpack.core.rollup.action.StartRollupJobAction; -import org.elasticsearch.xpack.core.rollup.action.StopRollupJobAction; import org.elasticsearch.xpack.core.rollup.job.RollupJob; import org.elasticsearch.xpack.core.rollup.job.RollupJobStatus; -import org.elasticsearch.xpack.core.search.action.GetAsyncSearchAction; -import org.elasticsearch.xpack.core.search.action.SubmitAsyncSearchAction; import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotFeatureSetUsage; import org.elasticsearch.xpack.core.security.SecurityFeatureSetUsage; -import org.elasticsearch.xpack.core.security.action.apikey.CreateApiKeyAction; -import org.elasticsearch.xpack.core.security.action.apikey.GetApiKeyAction; -import org.elasticsearch.xpack.core.security.action.apikey.InvalidateApiKeyAction; -import org.elasticsearch.xpack.core.security.action.realm.ClearRealmCacheAction; -import org.elasticsearch.xpack.core.security.action.role.ClearRolesCacheAction; -import org.elasticsearch.xpack.core.security.action.role.DeleteRoleAction; -import org.elasticsearch.xpack.core.security.action.role.GetRolesAction; -import org.elasticsearch.xpack.core.security.action.role.PutRoleAction; -import org.elasticsearch.xpack.core.security.action.rolemapping.DeleteRoleMappingAction; -import org.elasticsearch.xpack.core.security.action.rolemapping.GetRoleMappingsAction; -import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingAction; -import org.elasticsearch.xpack.core.security.action.token.CreateTokenAction; -import org.elasticsearch.xpack.core.security.action.token.InvalidateTokenAction; -import org.elasticsearch.xpack.core.security.action.token.RefreshTokenAction; -import org.elasticsearch.xpack.core.security.action.user.AuthenticateAction; -import org.elasticsearch.xpack.core.security.action.user.ChangePasswordAction; -import org.elasticsearch.xpack.core.security.action.user.DeleteUserAction; -import org.elasticsearch.xpack.core.security.action.user.GetUsersAction; -import org.elasticsearch.xpack.core.security.action.user.HasPrivilegesAction; -import org.elasticsearch.xpack.core.security.action.user.PutUserAction; -import org.elasticsearch.xpack.core.security.action.user.SetEnabledAction; import org.elasticsearch.xpack.core.security.authc.TokenMetadata; import org.elasticsearch.xpack.core.security.authc.support.mapper.expressiondsl.AllExpression; import org.elasticsearch.xpack.core.security.authc.support.mapper.expressiondsl.AnyExpression; @@ -194,26 +82,11 @@ import org.elasticsearch.xpack.core.security.authz.privilege.ConfigurableClusterPrivileges; import org.elasticsearch.xpack.core.slm.SLMFeatureSetUsage; import org.elasticsearch.xpack.core.slm.SnapshotLifecycleMetadata; -import org.elasticsearch.xpack.core.slm.action.DeleteSnapshotLifecycleAction; -import org.elasticsearch.xpack.core.slm.action.ExecuteSnapshotLifecycleAction; -import org.elasticsearch.xpack.core.slm.action.GetSnapshotLifecycleAction; -import org.elasticsearch.xpack.core.slm.action.GetSnapshotLifecycleStatsAction; -import org.elasticsearch.xpack.core.slm.action.PutSnapshotLifecycleAction; import org.elasticsearch.xpack.core.spatial.SpatialFeatureSetUsage; import org.elasticsearch.xpack.core.sql.SqlFeatureSetUsage; -import org.elasticsearch.xpack.core.ssl.action.GetCertificateInfoAction; -import org.elasticsearch.xpack.core.termsenum.action.TermsEnumAction; -import org.elasticsearch.xpack.core.textstructure.action.FindStructureAction; import org.elasticsearch.xpack.core.transform.TransformFeatureSetUsage; import org.elasticsearch.xpack.core.transform.TransformField; import org.elasticsearch.xpack.core.transform.TransformMetadata; -import org.elasticsearch.xpack.core.transform.action.DeleteTransformAction; -import org.elasticsearch.xpack.core.transform.action.GetTransformAction; -import org.elasticsearch.xpack.core.transform.action.GetTransformStatsAction; -import org.elasticsearch.xpack.core.transform.action.PreviewTransformAction; -import org.elasticsearch.xpack.core.transform.action.PutTransformAction; -import org.elasticsearch.xpack.core.transform.action.StartTransformAction; -import org.elasticsearch.xpack.core.transform.action.StopTransformAction; import org.elasticsearch.xpack.core.transform.transforms.NullRetentionPolicyConfig; import org.elasticsearch.xpack.core.transform.transforms.RetentionPolicyConfig; import org.elasticsearch.xpack.core.transform.transforms.SyncConfig; @@ -224,14 +97,6 @@ import org.elasticsearch.xpack.core.votingonly.VotingOnlyNodeFeatureSetUsage; import org.elasticsearch.xpack.core.watcher.WatcherFeatureSetUsage; import org.elasticsearch.xpack.core.watcher.WatcherMetadata; -import org.elasticsearch.xpack.core.watcher.transport.actions.ack.AckWatchAction; -import org.elasticsearch.xpack.core.watcher.transport.actions.activate.ActivateWatchAction; -import org.elasticsearch.xpack.core.watcher.transport.actions.delete.DeleteWatchAction; -import org.elasticsearch.xpack.core.watcher.transport.actions.execute.ExecuteWatchAction; -import org.elasticsearch.xpack.core.watcher.transport.actions.get.GetWatchAction; -import org.elasticsearch.xpack.core.watcher.transport.actions.put.PutWatchAction; -import org.elasticsearch.xpack.core.watcher.transport.actions.service.WatcherServiceAction; -import org.elasticsearch.xpack.core.watcher.transport.actions.stats.WatcherStatsAction; import java.util.ArrayList; import java.util.Arrays; @@ -257,165 +122,6 @@ public List> getSettings() { return settings; } - @Override - public List> getClientActions() { - return Arrays.asList( - // graph - GraphExploreAction.INSTANCE, - // ML - GetJobsAction.INSTANCE, - GetJobsStatsAction.INSTANCE, - MlInfoAction.INSTANCE, - PutJobAction.INSTANCE, - UpdateJobAction.INSTANCE, - DeleteJobAction.INSTANCE, - OpenJobAction.INSTANCE, - GetFiltersAction.INSTANCE, - PutFilterAction.INSTANCE, - UpdateFilterAction.INSTANCE, - DeleteFilterAction.INSTANCE, - KillProcessAction.INSTANCE, - GetBucketsAction.INSTANCE, - GetInfluencersAction.INSTANCE, - GetOverallBucketsAction.INSTANCE, - GetRecordsAction.INSTANCE, - PostDataAction.INSTANCE, - CloseJobAction.INSTANCE, - FinalizeJobExecutionAction.INSTANCE, - FlushJobAction.INSTANCE, - ValidateDetectorAction.INSTANCE, - ValidateJobConfigAction.INSTANCE, - GetCategoriesAction.INSTANCE, - GetModelSnapshotsAction.INSTANCE, - RevertModelSnapshotAction.INSTANCE, - UpdateModelSnapshotAction.INSTANCE, - GetDatafeedsAction.INSTANCE, - GetDatafeedsStatsAction.INSTANCE, - PutDatafeedAction.INSTANCE, - UpdateDatafeedAction.INSTANCE, - DeleteDatafeedAction.INSTANCE, - PreviewDatafeedAction.INSTANCE, - StartDatafeedAction.INSTANCE, - StopDatafeedAction.INSTANCE, - IsolateDatafeedAction.INSTANCE, - DeleteModelSnapshotAction.INSTANCE, - UpdateProcessAction.INSTANCE, - DeleteExpiredDataAction.INSTANCE, - ForecastJobAction.INSTANCE, - DeleteForecastAction.INSTANCE, - GetCalendarsAction.INSTANCE, - PutCalendarAction.INSTANCE, - DeleteCalendarAction.INSTANCE, - DeleteCalendarEventAction.INSTANCE, - UpdateCalendarJobAction.INSTANCE, - GetCalendarEventsAction.INSTANCE, - PostCalendarEventsAction.INSTANCE, - PersistJobAction.INSTANCE, - SetUpgradeModeAction.INSTANCE, - PutDataFrameAnalyticsAction.INSTANCE, - GetDataFrameAnalyticsAction.INSTANCE, - GetDataFrameAnalyticsStatsAction.INSTANCE, - UpdateDataFrameAnalyticsAction.INSTANCE, - DeleteDataFrameAnalyticsAction.INSTANCE, - StartDataFrameAnalyticsAction.INSTANCE, - EvaluateDataFrameAction.INSTANCE, - ExplainDataFrameAnalyticsAction.INSTANCE, - InferModelAction.INSTANCE, - InferModelAction.EXTERNAL_INSTANCE, - GetTrainedModelsAction.INSTANCE, - DeleteTrainedModelAction.INSTANCE, - GetTrainedModelsStatsAction.INSTANCE, - PutTrainedModelAction.INSTANCE, - // security - ClearRealmCacheAction.INSTANCE, - ClearRolesCacheAction.INSTANCE, - GetUsersAction.INSTANCE, - PutUserAction.INSTANCE, - DeleteUserAction.INSTANCE, - GetRolesAction.INSTANCE, - PutRoleAction.INSTANCE, - DeleteRoleAction.INSTANCE, - ChangePasswordAction.INSTANCE, - AuthenticateAction.INSTANCE, - SetEnabledAction.INSTANCE, - HasPrivilegesAction.INSTANCE, - GetRoleMappingsAction.INSTANCE, - PutRoleMappingAction.INSTANCE, - DeleteRoleMappingAction.INSTANCE, - CreateTokenAction.INSTANCE, - InvalidateTokenAction.INSTANCE, - GetCertificateInfoAction.INSTANCE, - RefreshTokenAction.INSTANCE, - CreateApiKeyAction.INSTANCE, - InvalidateApiKeyAction.INSTANCE, - GetApiKeyAction.INSTANCE, - // watcher - PutWatchAction.INSTANCE, - DeleteWatchAction.INSTANCE, - GetWatchAction.INSTANCE, - WatcherStatsAction.INSTANCE, - AckWatchAction.INSTANCE, - ActivateWatchAction.INSTANCE, - WatcherServiceAction.INSTANCE, - ExecuteWatchAction.INSTANCE, - // license - PutLicenseAction.INSTANCE, - GetLicenseAction.INSTANCE, - DeleteLicenseAction.INSTANCE, - PostStartTrialAction.INSTANCE, - GetTrialStatusAction.INSTANCE, - PostStartBasicAction.INSTANCE, - GetBasicStatusAction.INSTANCE, - // x-pack - XPackInfoAction.INSTANCE, - XPackUsageAction.INSTANCE, - // rollup - RollupSearchAction.INSTANCE, - PutRollupJobAction.INSTANCE, - StartRollupJobAction.INSTANCE, - StopRollupJobAction.INSTANCE, - DeleteRollupJobAction.INSTANCE, - GetRollupJobsAction.INSTANCE, - GetRollupCapsAction.INSTANCE, - // ILM - DeleteLifecycleAction.INSTANCE, - GetLifecycleAction.INSTANCE, - PutLifecycleAction.INSTANCE, - ExplainLifecycleAction.INSTANCE, - RemoveIndexLifecyclePolicyAction.INSTANCE, - MoveToStepAction.INSTANCE, - RetryAction.INSTANCE, - PutSnapshotLifecycleAction.INSTANCE, - GetSnapshotLifecycleAction.INSTANCE, - DeleteSnapshotLifecycleAction.INSTANCE, - ExecuteSnapshotLifecycleAction.INSTANCE, - GetSnapshotLifecycleStatsAction.INSTANCE, - MigrateToDataTiersAction.INSTANCE, - - // Freeze - FreezeIndexAction.INSTANCE, - // Data Frame - PutTransformAction.INSTANCE, - StartTransformAction.INSTANCE, - StopTransformAction.INSTANCE, - DeleteTransformAction.INSTANCE, - GetTransformAction.INSTANCE, - GetTransformStatsAction.INSTANCE, - PreviewTransformAction.INSTANCE, - // Async Search - SubmitAsyncSearchAction.INSTANCE, - GetAsyncSearchAction.INSTANCE, - DeleteAsyncResultAction.INSTANCE, - // Text Structure - FindStructureAction.INSTANCE, - // Terms enum API - TermsEnumAction.INSTANCE, - // TSDB Downsampling - DownsampleIndexerAction.INSTANCE, - org.elasticsearch.action.downsample.DownsampleAction.INSTANCE - ); - } - @Override public List getNamedWriteables() { return Stream.of(