Class Preparation

java.lang.Object
com.qtsurfer.api.sdk.internal.Preparation

public final class Preparation extends Object
The prepare stage, shared by every workflow that needs a dataset before it can execute anything.

One implementation on purpose. Preparing is idempotent — the same instrument and window always resolve to the same job — so a workflow that prepares on every call duplicates no work, and that argument only holds while there is a single place where it is true.

  • Method Details

    • prepare

      public static String prepare(com.qtsurfer.api.client.api.BacktestingApi api, String exchangeId, com.qtsurfer.api.client.model.DataSourceType type, com.qtsurfer.api.client.model.PrepareRequest body, Duration pollInterval, Duration maxPollInterval, Duration timeout, Consumer<Double> onPercent, Consumer<com.qtsurfer.api.client.model.PrepareJobState> onPrepared)
      Submit a prepare and poll it to a terminal state.
      Parameters:
      api - the generated backtesting api
      exchangeId - exchange identifier
      type - data source type
      body - instrument and window to prepare
      pollInterval - initial interval between status polls
      maxPollInterval - upper bound of the exponential backoff
      timeout - deadline for the stage; null disables
      onPercent - called after each poll that reports size information; may be null
      onPrepared - called once with the terminal state; may be null
      Returns:
      the prepare jobId, which identifies the prepared dataset
      Throws:
      QTSPreparationError - when the submission, a status read, or the preparation itself fails
      QTSCanceledError - when the preparation is aborted server-side