Class UpdateJobCommandImpl
- All Implemented Interfaces:
FinalCommandStep<UpdateJobResponse>,UpdateJobCommandStep1,UpdateJobCommandStep1.UpdateJobCommandStep2
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.client.api.command.UpdateJobCommandStep1
UpdateJobCommandStep1.UpdateJobCommandStep2 -
Constructor Summary
ConstructorsConstructorDescriptionUpdateJobCommandImpl(long jobKey, HttpClient httpClient, JsonMapper jsonMapper) -
Method Summary
Modifier and TypeMethodDescriptionrequestTimeout(Duration requestTimeout) Sets the request timeout for the command.send()Sends the command to the Camunda gateway.update(JobChangeset jobChangeset) Update the retries, timeout, and/or priority of this job.Update the retries, timeout, and/or priority of this job.updatePriority(int priority) Set the priority of this job.updateRetries(int retries) Set the retries of this job.updateTimeout(long timeout) Set the timeout of this job.updateTimeout(Duration timeout) Set the timeout of this job.withLeaseToken(String leaseToken) Sets the lease token identifying the job's activation, fencing this command against a superseded activation of the same job.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.camunda.client.api.command.FinalCommandStep
execute
-
Constructor Details
-
UpdateJobCommandImpl
-
-
Method Details
-
requestTimeout
Description copied from interface:FinalCommandStepSets the request timeout for the command. The default request timeout can be configured usingCamundaClientBuilder.defaultRequestTimeout(Duration).- Specified by:
requestTimeoutin interfaceFinalCommandStep<UpdateJobResponse>- Parameters:
requestTimeout- the request timeout- Returns:
- the configured command
-
send
Description copied from interface:FinalCommandStepSends the command to the Camunda gateway. This operation is asynchronous. In case of success, the future returns the event that was generated by the Camunda gateway in response to the command.Call
CamundaFuture.join()to wait until the response is available.Future<JobEventinvalid input: '>' future = command.send(); JobEvent event = future.join();- Specified by:
sendin interfaceFinalCommandStep<UpdateJobResponse>- Returns:
- a future tracking state of success/failure of the command.
-
update
Description copied from interface:UpdateJobCommandStep1Update the retries, timeout, and/or priority of this job.If the given retries are greater than zero then this job will be picked up again by a job subscription and a related incident will be marked as resolved.
Timeout value passed as a duration is used to calculate a new job deadline. This will happen when the command is processed. The timeout value will be added to the current time then.
- Specified by:
updatein interfaceUpdateJobCommandStep1- Parameters:
jobChangeset- the changeset of this job, if a field is not provided (equals to null) it will be not updated- Returns:
- the builder for this command. Call
to complete the command and send it to the broker.
invalid reference
#send()
-
update
Description copied from interface:UpdateJobCommandStep1Update the retries, timeout, and/or priority of this job.If the given retries are greater than zero then this job will be picked up again by a job subscription and a related incident will be marked as resolved.
Timeout value passed as a duration is used to calculate a new job deadline. This will happen when the command is processed. The timeout value will be added to the current time then.
- Specified by:
updatein interfaceUpdateJobCommandStep1- Parameters:
retries- retries the retries of this job, if null it won't be updatedtimeout- the time the timeout of this job, if null it won't be updated- Returns:
- the builder for this command. Call
to complete the command and send it to the broker.
invalid reference
#send()
-
updateRetries
Description copied from interface:UpdateJobCommandStep1Set the retries of this job.If the given retries are greater than zero then this job will be picked up again by a job subscription and a related incident will be marked as resolved.
- Specified by:
updateRetriesin interfaceUpdateJobCommandStep1- Parameters:
retries- the retries of this job- Returns:
- the builder for this command. Call
to complete the command and send it to the broker.
invalid reference
#send()
-
updateTimeout
Description copied from interface:UpdateJobCommandStep1Set the timeout of this job.Timeout value in millis is used to calculate a new job deadline. This will happen when the command is processed. The timeout value will be added to the current time then.
- Specified by:
updateTimeoutin interfaceUpdateJobCommandStep1- Parameters:
timeout- the timeout of this job- Returns:
- the builder for this command. Call
to complete the command and send it to the broker.
invalid reference
#send()
-
updateTimeout
Description copied from interface:UpdateJobCommandStep1Set the timeout of this job.Timeout value passed as a duration is used to calculate a new job deadline. This will happen when the command is processed. The timeout value will be added to the current time then.
- Specified by:
updateTimeoutin interfaceUpdateJobCommandStep1- Parameters:
timeout- the time as duration (e.g. "Duration.ofMinutes(5)")- Returns:
- the builder for this command. Call
to complete the command and send it to the broker.
invalid reference
#send()
-
updatePriority
Description copied from interface:UpdateJobCommandStep1Set the priority of this job.- Specified by:
updatePriorityin interfaceUpdateJobCommandStep1- Parameters:
priority- the priority of this job- Returns:
- the builder for this command. Call
to complete the command and send it to the broker.
invalid reference
#send()
-
withLeaseToken
Description copied from interface:UpdateJobCommandStep1.UpdateJobCommandStep2Sets the lease token identifying the job's activation, fencing this command against a superseded activation of the same job. Obtain it fromActivatedJob#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.
newUpdateJobCommand(activatedJob)) the job's lease token is carried automatically, so this method is only needed when building the command from a job key.- Specified by:
withLeaseTokenin interfaceUpdateJobCommandStep1.UpdateJobCommandStep2- 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.
-