Package org.nuxeo.ecm.core.bulk
Interface BulkService
- All Superinterfaces:
AsyncService<String,
BulkStatus, Map<String, Serializable>>
- All Known Implementing Classes:
BulkServiceImpl
API to manage Bulk Computation.
At this level, there is no verification of the user calling the method against command's user.
This kind of verification has to be done by caller if needed.
- Since:
- 10.2
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendExternalBucket
(BulkBucket bucket) Sends aBulkBucket
to the right bulk action.boolean
Waits for completion of given bulk command.boolean
Waits for completion of all bulk commands.void
completeExternalScroll
(String commandId, long count) Completes a running bulk computation having an external scroller.getCommand
(String commandId) Returns the command or null if the command is not found or aborted.getStatuses
(String username) Gets the list of action statuses triggered by the given user.submit
(BulkCommand command) Submits aBulkCommand
that will be processed asynchronously, even if the current transaction rolls back (the method is not transactional).submitTransactional
(BulkCommand command) Submits aBulkCommand
that will be processed asynchronously only if the transaction commits successfully (nothing will be submitted in case of transaction rollback).Methods inherited from interface org.nuxeo.ecm.core.api.AsyncService
abort, getResult, getStatus
-
Method Details
-
submit
Submits aBulkCommand
that will be processed asynchronously, even if the current transaction rolls back (the method is not transactional).- Parameters:
command
- the command to submit- Returns:
- a unique bulk command identifier
- Throws:
IllegalArgumentException
- when the command is invalidIllegalStateException
- when the bulk action is exclusive and another one is already running
-
submitTransactional
Submits aBulkCommand
that will be processed asynchronously only if the transaction commits successfully (nothing will be submitted in case of transaction rollback). Note that theAsyncService.getStatus(Serializable)
will return an unknown state until transaction is committed.- Parameters:
command
- the command to submit- Returns:
- a unique bulk command identifier
- Since:
- 2021.18
-
getCommand
Returns the command or null if the command is not found or aborted. -
await
Waits for completion of given bulk command.- Parameters:
commandId
- the command to waitduration
- the duration to wait- Returns:
true
if bulk command completed orfalse
if computation has not finished after the timeout- Throws:
InterruptedException
-
await
Waits for completion of all bulk commands.- Parameters:
duration
- the duration to wait- Returns:
true
if all bulk commands completed orfalse
if one or more has not finished after the timeout- Throws:
InterruptedException
- Since:
- 10.3
-
getStatuses
Gets the list of action statuses triggered by the given user.- Parameters:
username
- the user name- Returns:
- the list of statuses
- Since:
- 10.3
-
appendExternalBucket
Sends aBulkBucket
to the right bulk action.This method is useful to produce bucket externally when using an external scroller.
- Parameters:
bucket
- the bucket to send to a bulk action- Since:
- 11.3
-
completeExternalScroll
Completes a running bulk computation having an external scroller.- Parameters:
commandId
- the command idcount
- the total number of elements produced by the external scroller- Since:
- 11.3
-