Interface ValidationOutcome
- All Known Implementing Classes:
ValidationOutcome.NotQueued,ValidationOutcome.Queued
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:
ValidationOutcome.Queued— this call started a check.ValidationOutcome.NotQueued— this call started nothing, and carries theStrategyStatethe platform holds right now.
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 ClassesModifier and TypeInterfaceDescriptionstatic final recordThis call queued nothing, because the platform already accounts for the current compilation.static final recordThis call queued a check, which has not answered yet. -
Method Summary
Modifier and TypeMethodDescriptionbooleanqueued()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.falsesays only that nothing was started — not that a verdict exists.- Returns:
trueforValidationOutcome.Queued,falseforValidationOutcome.NotQueued
-
strategyId
String strategyId()Id of the strategy this outcome is about.- Returns:
- the strategy id
-