Class BulkBaseService<T>

java.lang.Object
org.alfresco.module.org_alfresco_module_rm.bulk.BulkBaseService<T>
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
HoldBulkServiceImpl

public abstract class BulkBaseService<T> extends Object implements org.springframework.beans.factory.InitializingBean
A base class for executing bulk operations on nodes based on search query results
  • Field Details

    • executorService

      protected ExecutorService executorService
    • serviceRegistry

      protected ServiceRegistry serviceRegistry
    • searchService

      protected SearchService searchService
    • transactionService

      protected TransactionService transactionService
    • searchMapper

      protected SearchMapper searchMapper
    • bulkMonitor

      protected BulkMonitor<T> bulkMonitor
    • threadCount

      protected int threadCount
    • batchSize

      protected int batchSize
    • itemsPerTransaction

      protected int itemsPerTransaction
    • maxItems

      protected int maxItems
    • loggingInterval

      protected int loggingInterval
    • maxParallelRequests

      protected int maxParallelRequests
  • Constructor Details

    • BulkBaseService

      public BulkBaseService()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • execute

      public T execute(NodeRef nodeRef, BulkOperation bulkOperation)
      Execute bulk operation on node based on the search query results
      Parameters:
      nodeRef - node reference
      bulkOperation - bulk operation
      Returns:
      bulk status
    • runAsyncBatchProcessor

      protected void runAsyncBatchProcessor(BatchProcessor<NodeRef> batchProcessor, BatchProcessor.BatchProcessWorker<NodeRef> batchProcessWorker, BulkStatusUpdater bulkStatusUpdater)
      Run batch processor
    • getInitBulkStatus

      protected abstract T getInitBulkStatus(String processId, long totalItems)
      Get initial bulk status
      Parameters:
      processId - process id
      totalItems - total items
      Returns:
      bulk status
    • getBulkStatusUpdater

      protected abstract BulkStatusUpdater getBulkStatusUpdater()
      Get bulk status updater
      Returns:
      bulk status updater
    • getWorkProvider

      protected abstract BatchProcessWorkProvider<NodeRef> getWorkProvider(BulkOperation bulkOperation, BulkStatusUpdater bulkStatusUpdater, BulkProgress bulkProgress)
      Get work provider
      Parameters:
      bulkOperation - bulk operation
      bulkStatusUpdater - bulk status updater
      bulkProgress - bulk progress
      Returns:
      work provider
    • getWorkerProvider

      protected abstract BatchProcessor.BatchProcessWorker<NodeRef> getWorkerProvider(NodeRef nodeRef, BulkOperation bulkOperation, BulkProgress bulkProgress)
      Get worker provider
      Parameters:
      nodeRef - node reference
      bulkOperation - bulk operation
      bulkProgress - bulk progress
      Returns:
      worker provider
    • checkPermissions

      protected abstract void checkPermissions(NodeRef nodeRef, BulkOperation bulkOperation)
      Check permissions
      Parameters:
      nodeRef - node reference
      bulkOperation - bulk operation
    • getTotalItems

      protected ResultSet getTotalItems(Query searchQuery, int skipCount)
    • setServiceRegistry

      public void setServiceRegistry(ServiceRegistry serviceRegistry)
    • setSearchService

      public void setSearchService(SearchService searchService)
    • setTransactionService

      public void setTransactionService(TransactionService transactionService)
    • setSearchMapper

      public void setSearchMapper(SearchMapper searchMapper)
    • setBulkMonitor

      public void setBulkMonitor(BulkMonitor<T> bulkMonitor)
    • setThreadCount

      public void setThreadCount(int threadCount)
    • setBatchSize

      public void setBatchSize(int batchSize)
    • setMaxItems

      public void setMaxItems(int maxItems)
    • setLoggingInterval

      public void setLoggingInterval(int loggingInterval)
    • setItemsPerTransaction

      public void setItemsPerTransaction(int itemsPerTransaction)
    • setMaxParallelRequests

      public void setMaxParallelRequests(int maxParallelRequests)