Class JobUpdatePriorityCommandImpl
- All Implemented Interfaces:
CommandWithCommunicationApiStep<UpdateJobPriorityCommandStep1>,CommandWithOperationReferenceStep<UpdateJobPriorityCommandStep1.UpdateJobPriorityCommandStep2>,FinalCommandStep<UpdateJobPriorityResponse>,UpdateJobPriorityCommandStep1,UpdateJobPriorityCommandStep1.UpdateJobPriorityCommandStep2
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.client.api.command.UpdateJobPriorityCommandStep1
UpdateJobPriorityCommandStep1.UpdateJobPriorityCommandStep2 -
Constructor Summary
ConstructorsConstructorDescriptionJobUpdatePriorityCommandImpl(io.camunda.zeebe.gateway.protocol.GatewayGrpc.GatewayStub asyncStub, long jobKey, Duration requestTimeout, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, boolean preferRestOverGrpc, JsonMapper jsonMapper) -
Method Summary
Modifier and TypeMethodDescriptionoperationReference(long operationReference) Set the Operation Reference.priority(int priority) Set the priority of this job.requestTimeout(Duration requestTimeout) Sets the request timeout for the command.send()Sends the command to the Camunda gateway.useGrpc()Sets gRPC as the communication API for this command.useRest()Sets REST as the communication API for this command.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
-
JobUpdatePriorityCommandImpl
public JobUpdatePriorityCommandImpl(io.camunda.zeebe.gateway.protocol.GatewayGrpc.GatewayStub asyncStub, long jobKey, Duration requestTimeout, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, boolean preferRestOverGrpc, JsonMapper jsonMapper)
-
-
Method Details
-
priority
Description copied from interface:UpdateJobPriorityCommandStep1Set the priority of this job.- Specified by:
priorityin interfaceUpdateJobPriorityCommandStep1- 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()
-
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<UpdateJobPriorityResponse>- 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<UpdateJobPriorityResponse>- Returns:
- a future tracking state of success/failure of the command.
-
operationReference
public UpdateJobPriorityCommandStep1.UpdateJobPriorityCommandStep2 operationReference(long operationReference) Description copied from interface:CommandWithOperationReferenceStepSet the Operation Reference.This is a key chosen by the user and will be part of all records resulted from this operation
- Specified by:
operationReferencein interfaceCommandWithOperationReferenceStep<UpdateJobPriorityCommandStep1.UpdateJobPriorityCommandStep2>- Parameters:
operationReference- a reference key chosen by the user and will be part of all records resulted from this operation- Returns:
- the builder for this command with the operation reference specified
-
withLeaseToken
public UpdateJobPriorityCommandStep1.UpdateJobPriorityCommandStep2 withLeaseToken(String leaseToken) Description copied from interface:UpdateJobPriorityCommandStep1.UpdateJobPriorityCommandStep2Sets 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.
newUpdateJobPriorityCommand(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 interfaceUpdateJobPriorityCommandStep1.UpdateJobPriorityCommandStep2- 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.
-
useRest
Description copied from interface:CommandWithCommunicationApiStepSets REST as the communication API for this command. If this command doesn't support communication over REST, it simply returns the command builder instance unchanged. The default communication API can be configured usingCamundaClientBuilder.preferRestOverGrpc(boolean).- Specified by:
useRestin interfaceCommandWithCommunicationApiStep<UpdateJobPriorityCommandStep1>- Returns:
- the configured command
-
useGrpc
Description copied from interface:CommandWithCommunicationApiStepSets gRPC as the communication API for this command. If this command doesn't support communication over gRPC, it simply returns the command builder instance unchanged. The default communication API can be configured usingCamundaClientBuilder.preferRestOverGrpc(boolean).- Specified by:
useGrpcin interfaceCommandWithCommunicationApiStep<UpdateJobPriorityCommandStep1>- Returns:
- the configured command
-