Class ClientTask<S,T>

java.lang.Object
io.evitadb.driver.ClientTask<S,T>
All Implemented Interfaces:
Task<S,T>

public class ClientTask<S,T> extends Object implements Task<S,T>
Client task mimics the server task counterpart and provides the same interface for the client side. It is used to track the status of the task and to cancel it if needed.
Author:
Jan Novotný (novotny@fg.cz), FG Forrest a.s. (c) 2024
  • Constructor Details

  • Method Details

    • getStatus

      @Nonnull public TaskStatus<S,T> getStatus()
      Specified by:
      getStatus in interface Task<S,T>
    • getFutureResult

      @Nonnull public CompletableFuture<T> getFutureResult()
      Specified by:
      getFutureResult in interface Task<S,T>
    • cancel

      public boolean cancel()
      Specified by:
      cancel in interface Task<S,T>
    • discard

      public void discard()
      Discards task locally (the server task is not cancelled).
    • isCompleted

      public boolean isCompleted()
      Returns true if the task is finished or cancelled.
      Returns:
      True if the task is finished or cancelled.
    • updateStatus

      public void updateStatus(@Nonnull TaskStatus<?,?> status)
      Updates internal status of the task according to new external state.
      Parameters:
      status - The new status of the task.