Class BulkCommand.Builder

  • Enclosing class:
    BulkCommand

    public static class BulkCommand.Builder
    extends Object
    • 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
    • Constructor Detail

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

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