Package sonia.scm.work
Interface CentralWorkQueue.Enqueue
- Enclosing interface:
- CentralWorkQueue
public static interface CentralWorkQueue.Enqueue
Builder interface for the enqueueing of a new task.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Enqueue the given task toCentralWorkQueue
.void
Enqueue the given task toCentralWorkQueue
.Configure a lock for the given resource type.Configure a lock for the resource with the given type and id.default CentralWorkQueue.Enqueue
locks
(String resourceType, ModelObject object) Configure a lock for the resource with the given type and the id from the givenModelObject
.Run the enqueued task with administrator permission.
-
Method Details
-
locks
Configure a lock for the given resource type. For more information on locks see the class documentation (CentralWorkQueue
).- Parameters:
resourceType
- resource type to lock- Returns:
this
- See Also:
-
locks
Configure a lock for the resource with the given type and id. Note if the id isnull
the whole resource type is locked. For more information on locks see the class documentation (CentralWorkQueue
).- Parameters:
resourceType
- resource type to lockid
- id of resource to lock- Returns:
this
- See Also:
-
locks
Configure a lock for the resource with the given type and the id from the givenModelObject
. For more information on locks see the class documentation (CentralWorkQueue
).- Parameters:
resourceType
- resource type to lockobject
- which holds the id of the resource to lock- Returns:
this
- See Also:
-
runAsAdmin
CentralWorkQueue.Enqueue runAsAdmin()Run the enqueued task with administrator permission.- Returns:
this
-
enqueue
Enqueue the given task toCentralWorkQueue
. Warning: Ensure that the task is serializable. If the task is not serializable anNonPersistableTaskException
will be thrown. For more information about the persistence of tasks see class documentation.- Parameters:
task
- serializable task to enqueue- See Also:
-
enqueue
Enqueue the given task toCentralWorkQueue
.- Parameters:
task
- task to enqueue
-