Class AbstractNodeProcessor

java.lang.Object
org.saidone.component.BaseComponent
org.saidone.processors.AbstractNodeProcessor
All Implemented Interfaces:
NodeProcessor, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
AspectsAndPropertiesProcessor, ChainingNodeProcessor, DeleteNodeProcessor, DownloadNodeProcessor, LogNodeNameProcessor, MoveNodeProcessor, NormalizeMetadataProcessor, SetPermissionsProcessor, VoidProcessor

public abstract class AbstractNodeProcessor extends BaseComponent implements NodeProcessor
Base implementation of NodeProcessor that consumes node identifiers from a shared queue and delegates the concrete operation to NodeProcessor.processNode(String, ProcessorConfig).

Subclasses typically use the getNode(String) helper methods to retrieve node metadata and should honor the readOnly flag to avoid write operations when running in dry-run mode.

  • Field Details

    • nodesApi

      @Autowired protected org.alfresco.core.handler.NodesApi nodesApi
    • readOnly

      @Value("${application.read-only:true}") protected boolean readOnly
  • Constructor Details

    • AbstractNodeProcessor

      public AbstractNodeProcessor()
  • Method Details

    • process

      public CompletableFuture<Void> process(ProcessorConfig config)
      Starts asynchronous consumption of node identifiers from the queue.

      Processing stops when polling times out and no further node id is available. Each successfully processed node increments the shared counter and optionally waits according to the configured rate limit.

      Specified by:
      process in interface NodeProcessor
      Parameters:
      config - processor-specific configuration used by NodeProcessor.processNode(String, ProcessorConfig)
      Returns:
      future representing the asynchronous processing task
      Throws:
      RuntimeException - if the processing thread is interrupted while waiting for the next node id
    • getNode

      protected org.alfresco.core.model.Node getNode(String nodeId)
      Loads a node by id without requesting additional include parameters.
      Parameters:
      nodeId - Alfresco node id
      Returns:
      the fetched node entry
    • getNode

      protected org.alfresco.core.model.Node getNode(String nodeId, boolean includeProperties)
      Loads a node by id, optionally requesting its properties.
      Parameters:
      nodeId - Alfresco node id
      includeProperties - whether to include properties in the API response
      Returns:
      the fetched node entry
    • getNode

      protected org.alfresco.core.model.Node getNode(String nodeId, List<String> include)
      Loads a node by id with the provided include parameters.
      Parameters:
      nodeId - Alfresco node id
      include - include flags to pass to the API (for example, properties or path)
      Returns:
      the fetched node entry