Package org.saidone.processors
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
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.alfresco.core.model.NodeLoads a node by id without requesting additional include parameters.protected org.alfresco.core.model.NodeLoads a node by id, optionally requesting its properties.protected org.alfresco.core.model.NodeLoads a node by id with the provided include parameters.process(ProcessorConfig config) Starts asynchronous consumption of node identifiers from the queue.Methods inherited from class org.saidone.component.BaseComponent
setApplicationContext, shutDown, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.saidone.processors.NodeProcessor
processNode
-
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
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:
processin interfaceNodeProcessor- Parameters:
config- processor-specific configuration used byNodeProcessor.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
Loads a node by id without requesting additional include parameters.- Parameters:
nodeId- Alfresco node id- Returns:
- the fetched node entry
-
getNode
Loads a node by id, optionally requesting its properties.- Parameters:
nodeId- Alfresco node idincludeProperties- whether to includepropertiesin the API response- Returns:
- the fetched node entry
-
getNode
Loads a node by id with the provided include parameters.- Parameters:
nodeId- Alfresco node idinclude- include flags to pass to the API (for example,propertiesorpath)- Returns:
- the fetched node entry
-