Class ActionType<Response extends ActionResponse>

java.lang.Object
org.elasticsearch.action.ActionType<Response>
Direct Known Subclasses:
AbstractSynonymsPagedResultAction, AddIndexBlockAction, AnalyzeAction, AnalyzeIndexDiskUsageAction, AutoCreateAction, BulkAction, CancelTasksAction, CleanupRepositoryAction, ClearIndicesCacheAction, ClusterFormationInfoAction, ClusterGetSettingsAction, ClusterRerouteAction, ClusterSearchShardsAction, ClusterStateAction, ClusterStatsAction, ClusterUpdateSettingsAction, CompletionPersistentTaskAction, CoordinationDiagnosticsAction, CreateDataStreamAction, CreateIndexAction, CreateSnapshotAction, DataStreamsStatsAction, DeleteByQueryAction, DeleteDataStreamAction, DeleteSynonymRuleAction, DeleteSynonymsAction, DownsampleAction, FetchHealthInfoCacheAction, FieldUsageStatsAction, FlushAction, ForceMergeAction, GetAliasesAction, GetComponentTemplateAction, GetComposableIndexTemplateAction, GetDataStreamAction, GetDesiredNodesAction, GetFeatureUpgradeStatusAction, GetFieldMappingsAction, GetHealthAction, GetIndexAction, GetIndexTemplatesAction, GetMappingsAction, GetPipelineAction, GetRepositoriesAction, GetScriptContextAction, GetScriptLanguageAction, GetSettingsAction, GetShardSnapshotAction, GetSnapshotsAction, GetStoredScriptAction, GetSynonymRuleAction, GetTaskAction, HealthApiStatsAction, IndicesSegmentsAction, IndicesStatsAction, LazyRolloverAction, MasterHistoryAction, MigrateToDataStreamAction, ModifyDataStreamsAction, MultiTermVectorsAction, OpenIndexAction, PostFeatureUpgradeAction, PrevalidateNodeRemovalAction, PromoteDataStreamAction, PutComponentTemplateAction, PutSynonymRuleAction, PutSynonymsAction, RecoveryAction, RefreshAction, ReindexAction, RemovePersistentTaskAction, ResetFeatureStateAction, ResizeAction, ResolveIndexAction, RestoreSnapshotAction, RolloverAction, ShrinkAction, SimulateBulkAction, SimulateIndexTemplateAction, SimulatePipelineAction, SimulateTemplateAction, SnapshotsStatusAction, SnapshottableFeaturesAction, StartPersistentTaskAction, TermVectorsAction, UpdateByQueryAction, UpdateDesiredNodesAction, UpdateHealthInfoCacheAction, UpdatePersistentTaskStatusAction, ValidateQueryAction, VerifyRepositoryAction

public class ActionType<Response extends ActionResponse> extends Object
An action which can be invoked by ElasticsearchClient.execute(org.elasticsearch.action.ActionType<Response>, Request). The implementation must be registered with the node using ActionModule.setupActions(java.util.List<org.elasticsearch.plugins.ActionPlugin>) (for actions in the :server package) or ActionPlugin.getActions() (for actions in plugins).

Typically, every ActionType instance is a global constant (i.e. a public static final field) called INSTANCE or TYPE. Some legacy implementations create custom subclasses of ActionType but this is unnecessary and somewhat wasteful. Prefer to create instances of this class directly whenever possible.

  • Constructor Details

    • ActionType

      public ActionType(String name)
      Construct an ActionType with the given name.

      There is no facility for directly executing an action on a different node in the local cluster. To achieve this, implement an action which runs on the local node and knows how to use the TransportService to forward the request to a different node. There are several utilities that help implement such an action, including TransportNodesAction or TransportMasterNodeAction.

      Parameters:
      name - The name of the action, which must be unique across actions.
  • Method Details

    • localOnly

      @Deprecated(forRemoval=true) public static <T extends ActionResponse> ActionType<T> localOnly(String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Just create the ActionType directly.
      Construct an ActionType with the given name.

      There is no facility for directly executing an action on a different node in the local cluster. To achieve this, implement an action which runs on the local node and knows how to use the TransportService to forward the request to a different node. There are several utilities that help implement such an action, including TransportNodesAction or TransportMasterNodeAction.

      Parameters:
      name - The name of the action, which must be unique across actions.
      Returns:
      an ActionType which callers can execute on the local node.
    • name

      public String name()
      The name of the action. Must be unique across actions.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object