Package org.nuxeo.ecm.core.bulk.message
Class BulkCommand.Builder
- java.lang.Object
-
- org.nuxeo.ecm.core.bulk.message.BulkCommand.Builder
-
- Enclosing class:
- BulkCommand
public static class BulkCommand.Builder extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected String
action
protected int
batchSize
protected Long
batchTransactionTimeout
protected int
bucketSize
protected Boolean
exclusive
protected Boolean
externalScroller
protected Boolean
genericScroller
protected Map<String,Serializable>
params
protected String
query
protected Long
queryLimit
protected String
repository
protected String
scroller
protected Boolean
sequentialProcessing
protected Boolean
sequentialScroll
protected String
username
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BulkCommand.Builder
batch(int size)
The number of documents processed by action within a transactionBulkCommand.Builder
batchTransactionTimeout(Duration timeout)
Precision is second.BulkCommand.Builder
bucket(int size)
The size of a bucket of documents id that fits into a recordBulkCommand
build()
protected void
checkScrollerType()
BulkCommand.Builder
orElseAction(String alternativeAction)
If the main action is not enabled or not exist fallback to the alternative action.BulkCommand.Builder
param(String key, Serializable value)
Add an action parameterBulkCommand.Builder
params(Map<String,Serializable> params)
Set all action parametersBulkCommand.Builder
queryLimit(long limit)
Limits the query result.BulkCommand.Builder
queryUnlimited()
Unlimited query results, this will override the action defaultQueryLimit.BulkCommand.Builder
repository(String name)
Use a non default document repositoryBulkCommand.Builder
scroller(String scrollerName)
Sets scroller name used to materialized the document setBulkCommand.Builder
setExclusive(Boolean value)
When set totrue
only one command of this action per repository can be scheduled or running.BulkCommand.Builder
setSequentialProcessing(Boolean value)
When set totrue
the processing of the command is done on the same thread sequentially.BulkCommand.Builder
setSequentialScroll(Boolean value)
When set totrue
the scroll with other bulk commands having the same flag is done sequentially.BulkCommand.Builder
useDocumentScroller()
Uses a document scroller, the query must be a valid NXQL query.BulkCommand.Builder
useExternalScroller()
Uses an external scroller.BulkCommand.Builder
useGenericScroller()
Uses a generic scroller, the query syntax depends on scroller implementation.BulkCommand.Builder
user(String name)
Deprecated.since 11.1, useBuilder(String, String, String)
constructor with username instead
-
-
-
Field Detail
-
action
protected String action
-
query
protected final String query
-
queryLimit
protected Long queryLimit
-
repository
protected String repository
-
username
protected String username
-
bucketSize
protected int bucketSize
-
batchSize
protected int batchSize
-
batchTransactionTimeout
protected Long batchTransactionTimeout
-
scroller
protected String scroller
-
genericScroller
protected Boolean genericScroller
-
externalScroller
protected Boolean externalScroller
-
sequentialScroll
protected Boolean sequentialScroll
-
sequentialProcessing
protected Boolean sequentialProcessing
-
exclusive
protected Boolean exclusive
-
params
protected Map<String,Serializable> params
-
-
Constructor Detail
-
Builder
public Builder(String action, String query, String username)
BulkCommand builder- Parameters:
action
- the registered bulk action namequery
- by default an NXQL query that represents the document set to apply the action. When using a generic scroller the query syntax is a convention with the scroller implementation. When using an external scroller the field is null.username
- the user with whose rights the computation will be executed- Since:
- 11.1
-
Builder
@Deprecated public Builder(String action, String nxqlQuery)
Deprecated.since 11.1, useBuilder(String, String, String)
constructor with username insteadBulkCommand builder- Parameters:
action
- the registered bulk action namenxqlQuery
- the query that represent the document set to apply the action
-
-
Method Detail
-
repository
public BulkCommand.Builder repository(String name)
Use a non default document repository
-
queryLimit
public BulkCommand.Builder queryLimit(long limit)
Limits the query result.- Since:
- 11.4
-
queryUnlimited
public BulkCommand.Builder queryUnlimited()
Unlimited query results, this will override the action defaultQueryLimit.- Since:
- 11.4
-
user
@Deprecated public BulkCommand.Builder user(String name)
Deprecated.since 11.1, useBuilder(String, String, String)
constructor with username insteadUser running the bulk action
-
bucket
public BulkCommand.Builder bucket(int size)
The size of a bucket of documents id that fits into a record
-
batch
public BulkCommand.Builder batch(int size)
The number of documents processed by action within a transaction
-
batchTransactionTimeout
public BulkCommand.Builder batchTransactionTimeout(Duration timeout)
Precision is second.- Since:
- 11.5
-
param
public BulkCommand.Builder param(String key, Serializable value)
Add an action parameter
-
params
public BulkCommand.Builder params(Map<String,Serializable> params)
Set all action parameters
-
scroller
public BulkCommand.Builder scroller(String scrollerName)
Sets scroller name used to materialized the document set
-
useGenericScroller
public BulkCommand.Builder useGenericScroller()
Uses a generic scroller, the query syntax depends on scroller implementation.- Since:
- 11.1
-
useDocumentScroller
public BulkCommand.Builder useDocumentScroller()
Uses a document scroller, the query must be a valid NXQL query. This is the default.- Since:
- 11.1
-
useExternalScroller
public BulkCommand.Builder useExternalScroller()
Uses an external scroller.- Since:
- 11.3
-
checkScrollerType
protected void checkScrollerType()
-
setSequentialScroll
public BulkCommand.Builder setSequentialScroll(Boolean value)
When set totrue
the scroll with other bulk commands having the same flag is done sequentially. Iffalse
the scroll is done concurrently with others bulk commands. When unsetnull
this choice is done at the action definition level.- Since:
- 2023.4
-
setSequentialProcessing
public BulkCommand.Builder setSequentialProcessing(Boolean value)
When set totrue
the processing of the command is done on the same thread sequentially. Iffalse
the processing is done concurrently. When unsetnull
this choice is done at the action definition level.- Since:
- 2023.4
-
setExclusive
public BulkCommand.Builder setExclusive(Boolean value)
When set totrue
only one command of this action per repository can be scheduled or running. Submitting exclusive command while one is already running raises an exception.- Since:
- 2023.4
-
build
public BulkCommand build()
-
orElseAction
public BulkCommand.Builder orElseAction(String alternativeAction)
If the main action is not enabled or not exist fallback to the alternative action.- Since:
- 2023.9
-
-