Class ActivateJobsCommandImpl
- All Implemented Interfaces:
ActivateJobsCommandStep1,ActivateJobsCommandStep1.ActivateJobsCommandStep2,ActivateJobsCommandStep1.ActivateJobsCommandStep3,CommandWithCommunicationApiStep<ActivateJobsCommandStep1>,CommandWithOneOrMoreTenantsStep<ActivateJobsCommandStep1.ActivateJobsCommandStep3>,CommandWithTenantStep<ActivateJobsCommandStep1.ActivateJobsCommandStep3>,FinalCommandStep<ActivateJobsResponse>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.client.api.command.ActivateJobsCommandStep1
ActivateJobsCommandStep1.ActivateJobsCommandStep2, ActivateJobsCommandStep1.ActivateJobsCommandStep3 -
Field Summary
Fields inherited from interface io.camunda.client.api.command.CommandWithTenantStep
DEFAULT_TENANT_IDENTIFIER -
Constructor Summary
ConstructorsConstructorDescriptionActivateJobsCommandImpl(GatewayGrpc.GatewayStub asyncStub, HttpClient httpClient, CamundaClientConfiguration config, JsonMapper jsonMapper, Predicate<CredentialsProvider.StatusCode> retryPredicate) -
Method Summary
Modifier and TypeMethodDescriptionfetchVariables(String... fetchVariables) Set a list of variable names which should be fetch on job activation.fetchVariables(List<String> fetchVariables) Set a list of variable names which should be fetch on job activation.Set the type of jobs to work on.maxJobsToActivate(int maxJobsToActivate) Set the maximum of jobs to activate.requestTimeout(Duration requestTimeout) Sets the request timeout for the command.send()Sends the command to the Camunda gateway.Specifies the tenant that will own any entities (e.g. process definition, process instances, etc.) resulting from this command, or that owns any entities (e.g. jobs) referred to from this command.Shorthand method forCommandWithOneOrMoreTenantsStep.tenantIds(List).Specifies the tenants that may own any entities (e.g. process definition, process instances, etc.) resulting from this command.Set the time for how long a job is exclusively assigned for this subscription.useGrpc()Experimental: This method is under development, and as such using it may have no effect on the command builder when called.useRest()Experimental: This method is under development, and as such using it may have no effect on the command builder when called.workerName(String workerName) Set the name of the job worker.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
-
ActivateJobsCommandImpl
public ActivateJobsCommandImpl(GatewayGrpc.GatewayStub asyncStub, HttpClient httpClient, CamundaClientConfiguration config, JsonMapper jsonMapper, Predicate<CredentialsProvider.StatusCode> retryPredicate)
-
-
Method Details
-
useRest
Description copied from interface:CommandWithCommunicationApiStepExperimental: This method is under development, and as such using it may have no effect on the command builder when called. While unimplemented, it simply returns the command builder instance unchanged. This method already exists for software that is building support for a REST API in Camunda, and already wants to use this API during its development. As support for REST is added to Camunda, each of the commands that implement this method may start to take effect. Until this warning is removed, anything described below may not yet have taken effect, and the interface and its description are subject to change.Sets 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 using
CamundaClientBuilder.preferRestOverGrpc(boolean).- Specified by:
useRestin interfaceCommandWithCommunicationApiStep<ActivateJobsCommandStep1>- Returns:
- the configured command
-
useGrpc
Description copied from interface:CommandWithCommunicationApiStepExperimental: This method is under development, and as such using it may have no effect on the command builder when called. While unimplemented, it simply returns the command builder instance unchanged. This method already exists for software that is building support for a REST API in Camunda, and already wants to use this API during its development. As support for REST is added to Zeebe, each of the commands that implement this method may start to take effect. Until this warning is removed, anything described below may not yet have taken effect, and the interface and its description are subject to change.Sets 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 using
CamundaClientBuilder.preferRestOverGrpc(boolean).- Specified by:
useGrpcin interfaceCommandWithCommunicationApiStep<ActivateJobsCommandStep1>- Returns:
- the configured command
-
jobType
Description copied from interface:ActivateJobsCommandStep1Set the type of jobs to work on.- Specified by:
jobTypein interfaceActivateJobsCommandStep1- Parameters:
jobType- the type of jobs (e.g. "payment")- Returns:
- the builder for this command
-
maxJobsToActivate
Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep2Set the maximum of jobs to activate. If less jobs are available for activation the command will return a list with fewer jobs.- Specified by:
maxJobsToActivatein interfaceActivateJobsCommandStep1.ActivateJobsCommandStep2- Parameters:
maxJobsToActivate- the maximal number of jobs to activate- Returns:
- the builder for this command
-
timeout
Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep3Set the time for how long a job is exclusively assigned for this subscription.In this time, the job can not be assigned by other subscriptions to ensure that only one subscription work on the job. When the time is over then the job can be assigned again by this or other subscription if it's not completed yet.
If no time is set then the default is used from the configuration.
- Specified by:
timeoutin interfaceActivateJobsCommandStep1.ActivateJobsCommandStep3- Parameters:
timeout- the time as duration (e.g. "Duration.ofMinutes(5)")- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
workerName
Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep3Set the name of the job worker.This name is used to identify the worker which activated the jobs. Its main purpose is for monitoring and auditing. Commands on activated jobs do not check the worker name, i.e. complete or fail job.
If no name is set then the default is used from the configuration.
- Specified by:
workerNamein interfaceActivateJobsCommandStep1.ActivateJobsCommandStep3- Parameters:
workerName- the name of the worker (e.g. "payment-service")- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
fetchVariables
public ActivateJobsCommandStep1.ActivateJobsCommandStep3 fetchVariables(List<String> fetchVariables) Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep3Set a list of variable names which should be fetch on job activation.The jobs which are activated by this command will only contain variables from this list.
This can be used to limit the number of variables of the activated jobs.
- Specified by:
fetchVariablesin interfaceActivateJobsCommandStep1.ActivateJobsCommandStep3- Parameters:
fetchVariables- list of variables names to fetch on activation- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
fetchVariables
Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep3Set a list of variable names which should be fetch on job activation.The jobs which are activated by this command will only contain variables from this list.
This can be used to limit the number of variables of the activated jobs.
- Specified by:
fetchVariablesin interfaceActivateJobsCommandStep1.ActivateJobsCommandStep3- Parameters:
fetchVariables- list of variables names to fetch on activation- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
requestTimeout
Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep3Sets the request timeout for the command.Additionally, it sets the HTTP response timeout to the specified value, incremented by the offset defined in
CamundaClientConfiguration.getDefaultRequestTimeoutOffset()(default 1 second), ensuring that the client timeout does not occur before the server timeout.- Specified by:
requestTimeoutin interfaceActivateJobsCommandStep1.ActivateJobsCommandStep3- Specified by:
requestTimeoutin interfaceFinalCommandStep<ActivateJobsResponse>- Parameters:
requestTimeout- the request timeout- Returns:
- the configured command
- See Also:
-
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<ActivateJobsResponse>- Returns:
- a future tracking state of success/failure of the command.
-
tenantId
Description copied from interface:CommandWithOneOrMoreTenantsStepSpecifies the tenant that will own any entities (e.g. process definition, process instances, etc.) resulting from this command, or that owns any entities (e.g. jobs) referred to from this command.Multi-tenancy
Multiple tenants can share a Camunda cluster. Entities can be assigned to a specific tenant using an identifier. Only that tenant can access these entities.
Any entities created before multi-tenancy has been enabled in the Camunda cluster, are assigned to the
CommandWithTenantStep.DEFAULT_TENANT_IDENTIFIER.If no tenant is explicitly specified, then the command is rejected.
One or more tenants
This method can be called multiple times to specify multiple tenants.
This can be useful when requesting jobs for multiple tenants at once. Each of the activated jobs will be owned by the tenant that owns the corresponding process instance.
- Specified by:
tenantIdin interfaceCommandWithOneOrMoreTenantsStep<ActivateJobsCommandStep1.ActivateJobsCommandStep3>- Specified by:
tenantIdin interfaceCommandWithTenantStep<ActivateJobsCommandStep1.ActivateJobsCommandStep3>- Parameters:
tenantId- the identifier of the tenant to specify for this command, e.g."ACME"- Returns:
- the builder for this command with the tenant specified
-
tenantIds
Description copied from interface:CommandWithOneOrMoreTenantsStepSpecifies the tenants that may own any entities (e.g. process definition, process instances, etc.) resulting from this command.One or more tenants
This can be useful when requesting jobs for multiple tenants at once. Each of the activated jobs will be owned by the tenant that owns the corresponding process instance.
- Specified by:
tenantIdsin interfaceCommandWithOneOrMoreTenantsStep<ActivateJobsCommandStep1.ActivateJobsCommandStep3>- Parameters:
tenantIds- the identifiers of the tenants to specify for this command, e.g.["ACME", "OTHER"]- Returns:
- the builder for this command with the tenants specified
- See Also:
-
tenantIds
Description copied from interface:CommandWithOneOrMoreTenantsStepShorthand method forCommandWithOneOrMoreTenantsStep.tenantIds(List).- Specified by:
tenantIdsin interfaceCommandWithOneOrMoreTenantsStep<ActivateJobsCommandStep1.ActivateJobsCommandStep3>- Parameters:
tenantIds- the identifiers of the tenants to specify for this command, e.g.["ACME", "OTHER"]- Returns:
- the builder for this command with the tenants specified
- See Also:
-