Interface UpdateRetriesJobCommandStep1.UpdateRetriesJobCommandStep2

All Superinterfaces:
CommandWithOperationReferenceStep<UpdateRetriesJobCommandStep1.UpdateRetriesJobCommandStep2>, FinalCommandStep<UpdateRetriesJobResponse>
All Known Implementing Classes:
JobUpdateRetriesCommandImpl
Enclosing interface:
UpdateRetriesJobCommandStep1

public static interface UpdateRetriesJobCommandStep1.UpdateRetriesJobCommandStep2 extends CommandWithOperationReferenceStep<UpdateRetriesJobCommandStep1.UpdateRetriesJobCommandStep2>, FinalCommandStep<UpdateRetriesJobResponse>
  • Method Details

    • withLeaseToken

      Sets the lease token identifying the job's activation, fencing this command against a superseded activation of the same job. Obtain it from ActivatedJob#getLeaseToken().

      For a leased job, a supplied token is validated to prove the command comes from the worker that holds the current lease; a command carrying a stale token is rejected, fencing the job against a superseded activation (e.g. after the job timed out or failed and was re-activated by another worker). An update without a token always applies, to support operator and bulk updates of leased jobs; this differs from lifecycle commands like complete, fail, and throw-error, which always require a token for leased jobs. A job that was activated without a lease requires no token.

      When this command is created from an activated job (e.g. newUpdateRetriesCommand(activatedJob)) the job's lease token is carried automatically, so this method is only needed when building the command from a job key.

      Parameters:
      leaseToken - the opaque lease token the worker received when the job was activated
      Returns:
      the builder for this command. Call FinalCommandStep.send() to complete the command and send it to the broker.