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 Details

    • 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 Details

    • Builder

      public Builder(String action, String query, String username)
      BulkCommand builder
      Parameters:
      action - the registered bulk action name
      query - 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, use Builder(String, String, String) constructor with username instead
      BulkCommand builder
      Parameters:
      action - the registered bulk action name
      nxqlQuery - the query that represent the document set to apply the action
  • Method Details

    • 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.
      since 11.1, use Builder(String, String, String) constructor with username instead
      User 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 to true the scroll with other bulk commands having the same flag is done sequentially. If false the scroll is done concurrently with others bulk commands. When unset null this choice is done at the action definition level.
      Since:
      2023.4
    • setSequentialProcessing

      public BulkCommand.Builder setSequentialProcessing(Boolean value)
      When set to true the processing of the command is done on the same thread sequentially. If false the processing is done concurrently. When unset null this choice is done at the action definition level.
      Since:
      2023.4
    • setExclusive

      public BulkCommand.Builder setExclusive(Boolean value)
      When set to true 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