Package org.alfresco.repo.transfer
Class AbstractManifestProcessorBase
java.lang.Object
org.alfresco.repo.transfer.AbstractManifestProcessorBase
- All Implemented Interfaces:
TransferManifestProcessor,TransferSummaryAware
- Direct Known Subclasses:
RepoPrimaryManifestProcessorImpl,RepoRequisiteManifestProcessorImpl,RepoSecondaryManifestProcessorImpl,RepoTertiaryManifestProcessorImpl
public abstract class AbstractManifestProcessorBase
extends Object
implements TransferManifestProcessor, TransferSummaryAware
This abstract class handles the progress monitoring functionality as well as providing
some utility methods for sub-classes.
- Author:
- Brian
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidfinal voidSignals the end of a transfer manifestprotected TransferReceiverprotected Fileprotected ChildAssociationRefgetTemporaryLocation(NodeRef nodeRef) Given the node ref, this method constructs the appropriate ChildAssociationRef that would place this node in the transfer's temporary folder.protected Stringprotected voidThis method is invoked if an exception or error occurs while processing the manifest.protected voidlogComment(String message) protected voidlogCreated(NodeRef sourceNode, NodeRef destNode, NodeRef newParentNode, String parentPath, boolean orphan) protected voidlogDeleted(NodeRef sourceNode, NodeRef destNode, String parentPath) protected voidlogInvasionHierarchy(NodeRef parentRef, NodeRef childRef, NodeService nodeService, org.apache.commons.logging.Log log) Puts information about currentchildRefand itsparentRefinto log in TRACE level.protected voidprotected voidlogSummaryComment(String message) protected voidlogSummaryCreated(NodeRef sourceNode, NodeRef destNode, NodeRef newParentNode, String parentPath, boolean orphan) protected voidlogSummaryDeleted(NodeRef sourceNode, NodeRef destNode, String parentPath) protected voidlogSummaryMoved(NodeRef sourceNode, NodeRef destNode, String oldPath, NodeRef newParent, String newPath) protected voidlogSummaryUpdated(NodeRef sourceNode, NodeRef destNode, String newPath) protected voidlogUpdated(NodeRef sourceNode, NodeRef destNode, String newPath) protected abstract voidprocessHeader(TransferManifestHeader header) protected abstract voidprotected abstract voidfinal voidGives a deleted manifest node to be processedfinal voidGives a manifest node to be processedfinal voidGives the header to be proceessedvoidsetTransferSummaryReport(TransferSummaryReport transferSummaryReport) protected abstract voidfinal voidSignals the start of a transfer manifest
-
Constructor Details
-
AbstractManifestProcessorBase
-
-
Method Details
-
endTransferManifest
public final void endTransferManifest()Description copied from interface:TransferManifestProcessorSignals the end of a transfer manifest- Specified by:
endTransferManifestin interfaceTransferManifestProcessor
-
endManifest
protected abstract void endManifest() -
processTransferManifestNode
Description copied from interface:TransferManifestProcessorGives a manifest node to be processed- Specified by:
processTransferManifestNodein interfaceTransferManifestProcessor- Parameters:
node- the node
-
processNode
protected abstract void processNode(TransferManifestNormalNode node) throws TransferProcessingException - Throws:
TransferProcessingException
-
processTransferManifestNode
Description copied from interface:TransferManifestProcessorGives a deleted manifest node to be processed- Specified by:
processTransferManifestNodein interfaceTransferManifestProcessor- Parameters:
node- the node
-
processNode
protected abstract void processNode(TransferManifestDeletedNode node) throws TransferProcessingException - Throws:
TransferProcessingException
-
processTransferManifiestHeader
Description copied from interface:TransferManifestProcessorGives the header to be proceessed- Specified by:
processTransferManifiestHeaderin interfaceTransferManifestProcessor- Parameters:
header- the header
-
processHeader
-
startTransferManifest
public final void startTransferManifest()Description copied from interface:TransferManifestProcessorSignals the start of a transfer manifest- Specified by:
startTransferManifestin interfaceTransferManifestProcessor
-
startManifest
protected abstract void startManifest() -
getTemporaryLocation
Given the node ref, this method constructs the appropriate ChildAssociationRef that would place this node in the transfer's temporary folder. Useful when handling orphans.- Parameters:
nodeRef- NodeRef- Returns:
- ChildAssociationRef
-
getStagingFolder
-
getReceiver
-
getTransferId
-
localHandleException
This method is invoked if an exception or error occurs while processing the manifest. By default it does nothing, but classes that extend this class can override this to provide custom clean-up.- Parameters:
node- TransferManifestNodeex- Throwable
-
logComment
-
logCreated
-
logDeleted
-
logUpdated
-
logMoved
-
logInvasionHierarchy
protected void logInvasionHierarchy(NodeRef parentRef, NodeRef childRef, NodeService nodeService, org.apache.commons.logging.Log log) Puts information about currentchildRefand itsparentRefinto log in TRACE level. Information includes 'name', 'fromRepositoryId', 'aliened' and 'invadedBy' properties. Additionally, collects the same information for children ofchildRef- Parameters:
parentRef- -NodeRefinstance of child nodechildRef- -NodeRefinstance of parent of thechildRefnodeService- -NodeServiceinstance to get properties and checking other stateslog- -Loginstance to put log for appropriate class
-
setTransferSummaryReport
-
getTransferSummaryReport
- Specified by:
getTransferSummaryReportin interfaceTransferSummaryAware
-
logSummaryComment
-
logSummaryCreated
-
logSummaryDeleted
-
logSummaryUpdated
-
logSummaryMoved
-