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 Stringprotected final CommandExecutorprotected final JobServiceConfigurationprotected Durationprotected Stringprotected Stringprotected 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, waitMethods 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:ExternalWorkerJobAcquireBuilderThe topic and lock duration for the requested jobs- Specified by:
topicin interfaceExternalWorkerJobAcquireBuilder- Parameters:
topic- the topic of the jobslockDuration- the duration for locking the jobs
-
onlyBpmn
Description copied from interface:ExternalWorkerJobAcquireBuilderAcquire only jobs which are linked to a process instance. Cannot be combined withExternalWorkerJobAcquireBuilder.onlyCmmn()andExternalWorkerJobAcquireBuilder.scopeType(String)- Specified by:
onlyBpmnin interfaceExternalWorkerJobAcquireBuilder
-
onlyCmmn
Description copied from interface:ExternalWorkerJobAcquireBuilderAcquire only jobs which are linked to a case instance. Cannot be combined withExternalWorkerJobAcquireBuilder.onlyBpmn()andExternalWorkerJobAcquireBuilder.scopeType(String)- Specified by:
onlyCmmnin interfaceExternalWorkerJobAcquireBuilder
-
scopeType
Description copied from interface:ExternalWorkerJobAcquireBuilderAcquire only jobs which are linked to the given scope type. Cannot be combined withExternalWorkerJobAcquireBuilder.onlyBpmn()orExternalWorkerJobAcquireBuilder.onlyCmmn()- Specified by:
scopeTypein interfaceExternalWorkerJobAcquireBuilder
-
tenantId
Description copied from interface:ExternalWorkerJobAcquireBuilderAcquire only jobs which are within the given tenant.- Specified by:
tenantIdin interfaceExternalWorkerJobAcquireBuilder
-
forUserOrGroups
Description copied from interface:ExternalWorkerJobAcquireBuilderAcquire only jobs where the given user or groups are authorized to execute.- Specified by:
forUserOrGroupsin interfaceExternalWorkerJobAcquireBuilder
-
acquireAndLock
public List<AcquiredExternalWorkerJob> acquireAndLock(int numberOfTasks, String workerId, int numberOfRetries) Description copied from interface:ExternalWorkerJobAcquireBuilderAcquire and lock the given number of jobs for the given worker id. If it fails to lock the jobs / scope afternumberOfRetriesit will return an empty list- Specified by:
acquireAndLockin 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
-