Class TaskStatusPollRequest

java.lang.Object
ai.docling.serve.api.task.request.TaskStatusPollRequest

public class TaskStatusPollRequest extends Object
Represents a request for polling the status of a task. This class encapsulates the information required to poll the status of a specific task. It includes the unique task identifier and an optional wait time between consecutive polling attempts. Instances of this class are immutable and can be built using the provided builder methods. Attributes: - `DEFAULT_STATUS_POLL_WAIT_TIME`: Specifies the default value for the wait time between polling attempts. By default, this is set to Duration.ZERO, indicating no delay between consecutive polling attempts. - `taskId`: The unique identifier of the task whose status is being polled. This field is mandatory and must not be null. - `waitTime`: The duration to wait between consecutive polling attempts. If not explicitly set, it defaults to DEFAULT_STATUS_POLL_WAIT_TIME.
  • Field Details

    • DEFAULT_STATUS_POLL_WAIT_TIME

      public static final Duration DEFAULT_STATUS_POLL_WAIT_TIME
      The default wait time between status polling attempts for a task.

      This value is used when no explicit wait time is specified in a TaskStatusPollRequest instance. It is set to Duration.ZERO, meaning there is no delay by default between consecutive polling attempts.

  • Method Details

    • builder

      public static @NonNull TaskStatusPollRequest.Builder builder()
    • toBuilder

      public @NonNull TaskStatusPollRequest.Builder toBuilder()
    • getTaskId

      @NonNull public @NonNull String getTaskId()
      The unique identifier of the task whose status is being polled.
      Returns:
      the task ID
    • getWaitTime

      @NonNull public @NonNull Duration getWaitTime()
      The duration to wait between consecutive polling attempts.
      Returns:
      the wait duration
    • toString

      public @NonNull String toString()
      Overrides:
      toString in class Object