Package org.flowable.job.service.impl
Class ExternalWorkerJobAcquireBuilderImpl
java.lang.Object
org.flowable.job.service.impl.ExternalWorkerJobAcquireBuilderImpl
- All Implemented Interfaces:
ExternalWorkerJobAcquireBuilder
public class ExternalWorkerJobAcquireBuilderImpl
extends Object
implements ExternalWorkerJobAcquireBuilder
- Author:
- Filip Hrisafov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Collection<String>
protected String
protected final CommandExecutor
protected final JobServiceConfiguration
protected Duration
protected String
protected String
protected String
-
Constructor Summary
ConstructorsConstructorDescriptionExternalWorkerJobAcquireBuilderImpl
(CommandExecutor commandExecutor, JobServiceConfiguration jobServiceConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionacquireAndLock
(int numberOfTasks, String workerId, int numberOfRetries) Acquire and lock the given number of jobs for the given worker id.forUserOrGroups
(String userId, Collection<String> groups) Acquire only jobs where the given user or groups are authorized to execute.getTopic()
onlyBpmn()
Acquire only jobs which are linked to a process instance.onlyCmmn()
Acquire only jobs which are linked to a case instance.Acquire only jobs which are linked to the given scope type.Acquire only jobs which are within the given tenant.The topic and lock duration for the requested jobsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.flowable.job.api.ExternalWorkerJobAcquireBuilder
acquireAndLock
-
Field Details
-
commandExecutor
-
jobServiceConfiguration
-
topic
-
lockDuration
-
scopeType
-
tenantId
-
authorizedUser
-
authorizedGroups
-
-
Constructor Details
-
ExternalWorkerJobAcquireBuilderImpl
public ExternalWorkerJobAcquireBuilderImpl(CommandExecutor commandExecutor, JobServiceConfiguration jobServiceConfiguration)
-
-
Method Details
-
topic
Description copied from interface:ExternalWorkerJobAcquireBuilder
The topic and lock duration for the requested jobs- Specified by:
topic
in interfaceExternalWorkerJobAcquireBuilder
- Parameters:
topic
- the topic of the jobslockDuration
- the duration for locking the jobs
-
onlyBpmn
Description copied from interface:ExternalWorkerJobAcquireBuilder
Acquire only jobs which are linked to a process instance. Cannot be combined withExternalWorkerJobAcquireBuilder.onlyCmmn()
andExternalWorkerJobAcquireBuilder.scopeType(String)
- Specified by:
onlyBpmn
in interfaceExternalWorkerJobAcquireBuilder
-
onlyCmmn
Description copied from interface:ExternalWorkerJobAcquireBuilder
Acquire only jobs which are linked to a case instance. Cannot be combined withExternalWorkerJobAcquireBuilder.onlyBpmn()
andExternalWorkerJobAcquireBuilder.scopeType(String)
- Specified by:
onlyCmmn
in interfaceExternalWorkerJobAcquireBuilder
-
scopeType
Description copied from interface:ExternalWorkerJobAcquireBuilder
Acquire only jobs which are linked to the given scope type. Cannot be combined withExternalWorkerJobAcquireBuilder.onlyBpmn()
orExternalWorkerJobAcquireBuilder.onlyCmmn()
- Specified by:
scopeType
in interfaceExternalWorkerJobAcquireBuilder
-
tenantId
Description copied from interface:ExternalWorkerJobAcquireBuilder
Acquire only jobs which are within the given tenant.- Specified by:
tenantId
in interfaceExternalWorkerJobAcquireBuilder
-
forUserOrGroups
Description copied from interface:ExternalWorkerJobAcquireBuilder
Acquire only jobs where the given user or groups are authorized to execute.- Specified by:
forUserOrGroups
in interfaceExternalWorkerJobAcquireBuilder
-
acquireAndLock
public List<AcquiredExternalWorkerJob> acquireAndLock(int numberOfTasks, String workerId, int numberOfRetries) Description copied from interface:ExternalWorkerJobAcquireBuilder
Acquire and lock the given number of jobs for the given worker id. If it fails to lock the jobs / scope afternumberOfRetries
it will return an empty list- Specified by:
acquireAndLock
in interfaceExternalWorkerJobAcquireBuilder
- Parameters:
numberOfTasks
- the number of jobs to acquireworkerId
- the id of the worker acquiring the jobsnumberOfRetries
- the number of retries if an optimistic lock exception occurs during acquiring
-
getTopic
-
getLockDuration
-
getScopeType
-
getTenantId
-
getAuthorizedUser
-
getAuthorizedGroups
-