Interface ValidationOutcome

All Known Implementing Classes:
ValidationOutcome.NotQueued, ValidationOutcome.Queued

public sealed interface ValidationOutcome permits ValidationOutcome.Queued, ValidationOutcome.NotQueued
What a call to validate a strategy did — which is a different question from what the platform currently thinks of the strategy.

Validation is idempotent, and the platform answers a request in one of two ways: it queues a check, or it queues nothing because one is already accounted for. Those two answers are what this type separates:

NotQueued does not mean a verdict exists. The state it carries can itself be pending: a check queued by an earlier call — possibly from another process — that has not answered yet. The two questions are independent, and a caller usually needs both:

  • queued() answers did this call start work?
  • StrategyState.getValidation() answers is there a verdict right now?

Either way, a caller that wants a verdict has to read one: poll QTSurfer.strategyState(String) until validation leaves pending, bounded by a deadline of the caller's own — see QTSurfer.validateStrategy(String) for why that deadline is not optional and for what a verdict is worth once it arrives.

The links above point at QTSurfer for concreteness; AuthenticatedClient carries the same pair of methods with the same semantics, and this type is what both return.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    This call queued nothing, because the platform already accounts for the current compilation.
    static final record 
    This call queued a check, which has not answered yet.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether this call started a new check.
    Id of the strategy this outcome is about.
  • Method Details

    • queued

      boolean queued()
      Whether this call started a new check. false says only that nothing was started — not that a verdict exists.
      Returns:
      true for ValidationOutcome.Queued, false for ValidationOutcome.NotQueued
    • strategyId

      String strategyId()
      Id of the strategy this outcome is about.
      Returns:
      the strategy id