Class StoredAsyncTask<Response extends ActionResponse>

java.lang.Object
org.elasticsearch.tasks.Task
org.elasticsearch.tasks.CancellableTask
org.elasticsearch.xpack.core.async.StoredAsyncTask<Response>
All Implemented Interfaces:
Traceable, AsyncTask

public abstract class StoredAsyncTask<Response extends ActionResponse> extends CancellableTask implements AsyncTask
  • Field Details

  • Constructor Details

  • Method Details

    • getOriginHeaders

      public Map<String,String> getOriginHeaders()
      Description copied from interface: AsyncTask
      Returns all of the request contexts headers
      Specified by:
      getOriginHeaders in interface AsyncTask
    • getExecutionId

      public AsyncExecutionId getExecutionId()
      Description copied from interface: AsyncTask
      Returns the AsyncExecutionId of the task
      Specified by:
      getExecutionId in interface AsyncTask
    • setExpirationTime

      public void setExpirationTime(long expirationTime)
      Update the expiration time of the (partial) response.
      Specified by:
      setExpirationTime in interface AsyncTask
    • getExpirationTimeMillis

      public long getExpirationTimeMillis()
    • addCompletionListener

      public boolean addCompletionListener(Supplier<ActionListener<Response>> listenerSupplier)
    • removeCompletionListener

      public void removeCompletionListener(ActionListener<Response> listener)
    • onResponse

      public void onResponse(Response response)
      This method is called when the task is finished successfully before unregistering the task and storing the results
    • onFailure

      public void onFailure(Exception e)
      This method is called when the task failed before unregistering the task and storing the results
    • getCurrentResult

      public abstract Response getCurrentResult()
      Return currently available partial or the final results
    • cancelTask

      public void cancelTask(TaskManager taskManager, Runnable runnable, String reason)
      Description copied from interface: AsyncTask
      Performs necessary checks, cancels the task and calls the runnable upon completion
      Specified by:
      cancelTask in interface AsyncTask