Package org.elasticsearch.action.support
Class TransportAction<Request extends ActionRequest,Response extends ActionResponse>
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.action.support.TransportAction<Request,Response>
-
- Direct Known Subclasses:
HandledTransportAction,TransportReplicationAction,TransportSingleShardAction
public abstract class TransportAction<Request extends ActionRequest,Response extends ActionResponse> extends AbstractComponent
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringactionNameprotected IndexNameExpressionResolverindexNameExpressionResolverprotected TaskManagertaskManagerprotected ThreadPoolthreadPool-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
deprecationLogger, logger, settings
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTransportAction(Settings settings, java.lang.String actionName, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, TaskManager taskManager)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(Task task, Request request, ActionListener<Response> listener)protected abstract voiddoExecute(Request request, ActionListener<Response> listener)voidexecute(Task task, Request request, ActionListener<Response> listener)Use this method when the transport action should continue to run in the context of the current taskActionFuture<Response>execute(Request request)Taskexecute(Request request, ActionListener<Response> listener)Use this method when the transport action call should result in creation of a new task associated with the call.Taskexecute(Request request, TaskListener<Response> listener)Execute the transport action on the local node, returning theTaskused to track its execution and accepting aTaskListenerwhich listens for the completion of the action.-
Methods inherited from class org.elasticsearch.common.component.AbstractComponent
logDeprecatedSetting, logRemovedSetting, nodeName
-
-
-
-
Field Detail
-
threadPool
protected final ThreadPool threadPool
-
actionName
protected final java.lang.String actionName
-
indexNameExpressionResolver
protected final IndexNameExpressionResolver indexNameExpressionResolver
-
taskManager
protected final TaskManager taskManager
-
-
Constructor Detail
-
TransportAction
protected TransportAction(Settings settings, java.lang.String actionName, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, TaskManager taskManager)
-
-
Method Detail
-
execute
public final ActionFuture<Response> execute(Request request)
-
execute
public final Task execute(Request request, ActionListener<Response> listener)
Use this method when the transport action call should result in creation of a new task associated with the call. This is a typical behavior.
-
execute
public final Task execute(Request request, TaskListener<Response> listener)
Execute the transport action on the local node, returning theTaskused to track its execution and accepting aTaskListenerwhich listens for the completion of the action.
-
execute
public final void execute(Task task, Request request, ActionListener<Response> listener)
Use this method when the transport action should continue to run in the context of the current task
-
doExecute
protected void doExecute(Task task, Request request, ActionListener<Response> listener)
-
doExecute
protected abstract void doExecute(Request request, ActionListener<Response> listener)
-
-