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.String
actionName
protected IndexNameExpressionResolver
indexNameExpressionResolver
protected TaskManager
taskManager
protected ThreadPool
threadPool
-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
logger
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TransportAction(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 void
doExecute(Task task, Request request, ActionListener<Response> listener)
protected abstract void
doExecute(Request request, ActionListener<Response> listener)
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 taskActionFuture<Response>
execute(Request request)
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.Task
execute(Request request, TaskListener<Response> listener)
Execute the transport action on the local node, returning theTask
used to track its execution and accepting aTaskListener
which listens for the completion of the action.
-
-
-
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 theTask
used to track its execution and accepting aTaskListener
which 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)
-
-