Class ActivateJobsCommandImpl
- java.lang.Object
-
- io.zeebe.client.impl.command.ActivateJobsCommandImpl
-
- All Implemented Interfaces:
ActivateJobsCommandStep1
,ActivateJobsCommandStep1.ActivateJobsCommandStep2
,ActivateJobsCommandStep1.ActivateJobsCommandStep3
,FinalCommandStep<ActivateJobsResponse>
public final class ActivateJobsCommandImpl extends Object implements ActivateJobsCommandStep1, ActivateJobsCommandStep1.ActivateJobsCommandStep2, ActivateJobsCommandStep1.ActivateJobsCommandStep3
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.zeebe.client.api.command.ActivateJobsCommandStep1
ActivateJobsCommandStep1.ActivateJobsCommandStep2, ActivateJobsCommandStep1.ActivateJobsCommandStep3
-
-
Constructor Summary
Constructors Constructor Description ActivateJobsCommandImpl(GatewayGrpc.GatewayStub asyncStub, ZeebeClientConfiguration config, JsonMapper jsonMapper, Predicate<Throwable> retryPredicate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActivateJobsCommandStep1.ActivateJobsCommandStep3
fetchVariables(String... fetchVariables)
Set a list of variable names which should be fetch on job activation.ActivateJobsCommandStep1.ActivateJobsCommandStep3
fetchVariables(List<String> fetchVariables)
Set a list of variable names which should be fetch on job activation.ActivateJobsCommandStep1.ActivateJobsCommandStep2
jobType(String jobType)
Set the type of jobs to work on.ActivateJobsCommandStep1.ActivateJobsCommandStep3
maxJobsToActivate(int maxJobsToActivate)
Set the maximum of jobs to activate.FinalCommandStep<ActivateJobsResponse>
requestTimeout(Duration requestTimeout)
Sets the request timeout for the command.ZeebeFuture<ActivateJobsResponse>
send()
Sends the command to the Zeebe broker.ActivateJobsCommandStep1.ActivateJobsCommandStep3
timeout(Duration timeout)
Set the time for how long a job is exclusively assigned for this subscription.ActivateJobsCommandStep1.ActivateJobsCommandStep3
workerName(String workerName)
Set the name of the job worker.
-
-
-
Constructor Detail
-
ActivateJobsCommandImpl
public ActivateJobsCommandImpl(GatewayGrpc.GatewayStub asyncStub, ZeebeClientConfiguration config, JsonMapper jsonMapper, Predicate<Throwable> retryPredicate)
-
-
Method Detail
-
jobType
public ActivateJobsCommandStep1.ActivateJobsCommandStep2 jobType(String jobType)
Description copied from interface:ActivateJobsCommandStep1
Set the type of jobs to work on.- Specified by:
jobType
in interfaceActivateJobsCommandStep1
- Parameters:
jobType
- the type of jobs (e.g. "payment")- Returns:
- the builder for this command
-
maxJobsToActivate
public ActivateJobsCommandStep1.ActivateJobsCommandStep3 maxJobsToActivate(int maxJobsToActivate)
Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep2
Set the maximum of jobs to activate. If less jobs are available for activation the command will return a list with fewer jobs.- Specified by:
maxJobsToActivate
in interfaceActivateJobsCommandStep1.ActivateJobsCommandStep2
- Parameters:
maxJobsToActivate
- the maximal number of jobs to activate- Returns:
- the builder for this command
-
timeout
public ActivateJobsCommandStep1.ActivateJobsCommandStep3 timeout(Duration timeout)
Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep3
Set 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:
timeout
in 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
public ActivateJobsCommandStep1.ActivateJobsCommandStep3 workerName(String workerName)
Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep3
Set 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:
workerName
in 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.ActivateJobsCommandStep3
Set 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:
fetchVariables
in 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
public ActivateJobsCommandStep1.ActivateJobsCommandStep3 fetchVariables(String... fetchVariables)
Description copied from interface:ActivateJobsCommandStep1.ActivateJobsCommandStep3
Set 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:
fetchVariables
in 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
public FinalCommandStep<ActivateJobsResponse> requestTimeout(Duration requestTimeout)
Description copied from interface:FinalCommandStep
Sets the request timeout for the command. The default request timeout can be configured usingZeebeClientBuilder.defaultRequestTimeout(Duration)
.- Specified by:
requestTimeout
in interfaceFinalCommandStep<ActivateJobsResponse>
- Parameters:
requestTimeout
- the request timeout- Returns:
- the configured command
-
send
public ZeebeFuture<ActivateJobsResponse> send()
Description copied from interface:FinalCommandStep
Sends the command to the Zeebe broker. This operation is asynchronous. In case of success, the future returns the event that was generated by the Zeebe broker in response to the command.Call
ZeebeFuture.join()
to wait until the response is available.Future<JobEvent> future = command.send(); JobEvent event = future.join();
- Specified by:
send
in interfaceFinalCommandStep<ActivateJobsResponse>
- Returns:
- a future tracking state of success/failure of the command.
-
-