Package org.nuxeo.ecm.core.bulk
Interface BulkService
-
- All Superinterfaces:
AsyncService<String,BulkStatus,Map<String,Serializable>>
- All Known Implementing Classes:
BulkServiceImpl
public interface BulkService extends AsyncService<String,BulkStatus,Map<String,Serializable>>
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
appendExternalBucket(BulkBucket bucket)
Sends aBulkBucket
to the right bulk action.boolean
await(String commandId, Duration duration)
Waits for completion of given bulk command.boolean
await(Duration duration)
Waits for completion of all bulk commands.void
completeExternalScroll(String commandId, long count)
Completes a running bulk computation having an external scroller.BulkCommand
getCommand(String commandId)
Returns the command or null if the command is not found or aborted.List<BulkStatus>
getStatuses(String username)
Gets the list of action statuses triggered by the given user.String
submit(BulkCommand command)
Submits aBulkCommand
that will be processed asynchronously, even if the current transaction rolls back (the method is not transactional).String
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 Detail
-
submit
String submit(BulkCommand command)
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
String 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). 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
BulkCommand getCommand(String commandId)
Returns the command or null if the command is not found or aborted.
-
await
boolean await(String commandId, Duration duration) throws InterruptedException
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
boolean await(Duration duration) throws InterruptedException
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
List<BulkStatus> getStatuses(String username)
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
void appendExternalBucket(BulkBucket bucket)
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
void completeExternalScroll(String commandId, long count)
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
-
-