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 Stringactionprotected intbatchSizeprotected LongbatchTransactionTimeoutprotected intbucketSizeprotected Booleanexclusiveprotected BooleanexternalScrollerprotected BooleangenericScrollerprotected Map<String,Serializable>paramsprotected Stringqueryprotected LongqueryLimitprotected Stringrepositoryprotected Stringscrollerprotected BooleansequentialProcessingprotected BooleansequentialScrollprotected Stringusername
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BulkCommand.Builderbatch(int size)The number of documents processed by action within a transactionBulkCommand.BuilderbatchTransactionTimeout(Duration timeout)Precision is second.BulkCommand.Builderbucket(int size)The size of a bucket of documents id that fits into a recordBulkCommandbuild()protected voidcheckScrollerType()BulkCommand.BuilderorElseAction(String alternativeAction)If the main action is not enabled or not exist fallback to the alternative action.BulkCommand.Builderparam(String key, Serializable value)Add an action parameterBulkCommand.Builderparams(Map<String,Serializable> params)Set all action parametersBulkCommand.BuilderqueryLimit(long limit)Limits the query result.BulkCommand.BuilderqueryUnlimited()Unlimited query results, this will override the action defaultQueryLimit.BulkCommand.Builderrepository(String name)Use a non default document repositoryBulkCommand.Builderscroller(String scrollerName)Sets scroller name used to materialized the document setBulkCommand.BuildersetExclusive(Boolean value)When set totrueonly one command of this action per repository can be scheduled or running.BulkCommand.BuildersetSequentialProcessing(Boolean value)When set totruethe processing of the command is done on the same thread sequentially.BulkCommand.BuildersetSequentialScroll(Boolean value)When set totruethe scroll with other bulk commands having the same flag is done sequentially.BulkCommand.BuilderuseDocumentScroller()Uses a document scroller, the query must be a valid NXQL query.BulkCommand.BuilderuseExternalScroller()Uses an external scroller.BulkCommand.BuilderuseGenericScroller()Uses a generic scroller, the query syntax depends on scroller implementation.BulkCommand.Builderuser(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 totruethe scroll with other bulk commands having the same flag is done sequentially. Iffalsethe scroll is done concurrently with others bulk commands. When unsetnullthis choice is done at the action definition level.- Since:
- 2023.4
-
setSequentialProcessing
public BulkCommand.Builder setSequentialProcessing(Boolean value)
When set totruethe processing of the command is done on the same thread sequentially. Iffalsethe processing is done concurrently. When unsetnullthis choice is done at the action definition level.- Since:
- 2023.4
-
setExclusive
public BulkCommand.Builder setExclusive(Boolean value)
When set totrueonly 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
-
-