Package org.alfresco.repo.transfer
Class RepoTransferReceiverImpl
java.lang.Object
org.alfresco.repo.transfer.RepoTransferReceiverImpl
- All Implemented Interfaces:
ContentServicePolicies.OnContentUpdatePolicy,NodeServicePolicies.BeforeDeleteNodePolicy,NodeServicePolicies.OnCreateChildAssociationPolicy,NodeServicePolicies.OnMoveNodePolicy,NodeServicePolicies.OnRestoreNodePolicy,AssociationPolicy,ClassPolicy,Policy,TransferReceiver
public class RepoTransferReceiverImpl
extends Object
implements TransferReceiver, NodeServicePolicies.OnCreateChildAssociationPolicy, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnRestoreNodePolicy, NodeServicePolicies.OnMoveNodePolicy, ContentServicePolicies.OnContentUpdatePolicy
The Repo Transfer Receiver is the "Back-End" for transfer subsystem.
Provides the implementation of the transfer commands on the destination repository.
Provides callback handlers for Aliens and Transferred Aspects.
Calls transfer policies.
Co-ordinates locking and logging as the transfer progresses.
- Author:
- brian
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThis embedded class is used to push requests for asynchronous commits onto a different threadNested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg -
Field Summary
Fields inherited from interface org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnMoveNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnRestoreNodePolicy
QNAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeDeleteNode(NodeRef deletedNodeRef) When an alien node is deleted the it may be the last alien invadervoidAbortorg.alfresco.repo.transfer.RepoTransferReceiverImpl.LockvoidCommitvoidcommitAsync(String transferId) Commit asynchronouslyvoidAsks the receiver to end (and clean up) the specified transfervoidgenerateRequsite(String transferId, OutputStream out) Generate the requsitelongintlonglongGet the rule servicegetStagingFolder(String transferId) getTempFolder(String transferId) getTransferReport(String transferId) get the transfer report for the specified transferGet the version that we are transfering to.voidinit()voidonContentUpdate(NodeRef nodeRef, boolean newContent) onCopyAlien(QName classRef, CopyDetails copyDetails) When an alien node is copied, don't copy the alien aspect.onCopyTransferred(QName classRef, CopyDetails copyDetails) When a transferred node is copied, don't copy the transferred aspect.voidonCreateChildAssociation(ChildAssociationRef childAssocRef, boolean isNewNode) When a new node is created as a child of a Transferred or Alien node then the new node needs to be marked as an alien.voidonMoveNode(ChildAssociationRef oldChildAssocRef, ChildAssociationRef newChildAssocRef) When an alien node is moved it may un-invade its old location and invade a new location.voidonRestoreNode(ChildAssociationRef childAssocRef) When a transferred node is restored it may be a new invader or it may no longer be an invader.voidPreparevoidsaveContent(String transferId, String contentFileId, InputStream contentStream) Save a content itemvoidsaveSnapshot(String transferId, InputStream openStream) Store the specified snapshot file into the transfer staging area.voidsetActionService(ActionService actionService) voidsetAlienProcessor(AlienProcessor alienProcessor) voidsetBehaviourFilter(BehaviourFilter behaviourFilter) voidsetDescriptorService(DescriptorService descriptorService) voidsetInboundTransferRecordsPath(String inboundTransferRecordsPath) voidsetJobLockService(JobLockService jobLockService) voidsetLockRefreshTime(long lockRefreshTime) voidsetLockRetryCount(int lockRetryCount) voidsetLockRetryWait(long lockRetryWait) voidsetLockTimeOut(long lockTimeOut) voidsetManifestProcessorFactory(ManifestProcessorFactory manifestProcessorFactory) voidsetNamespaceService(NamespaceService namespaceService) voidsetNodeService(NodeService nodeService) voidsetPolicyComponent(PolicyComponent policyComponent) voidsetProgressMonitor(TransferProgressMonitor progressMonitor) voidsetRootStagingDirectory(String rootStagingDirectory) voidsetRuleService(RuleService ruleService) Set the ruleServicevoidsetSearchService(SearchService searchService) voidsetSingletonCache(SimpleCache<String, NodeRef> singletonCache) voidsetTenantService(TenantService tenantService) voidsetTransactionService(TransactionService transactionService) voidsetTransferLockFolderPath(String transferLockFolderPath) voidsetTransferRootNode(String rootFileSystem) set the root node for the file system receivervoidsetTransferTempFolderPath(String transferTempFolderPath) voidsetTransferVersionChecker(TransferVersionChecker transferVersionChecker) start(String fromRepositoryId, boolean transferToSelf, TransferVersion fromVersion) Asks the receiver to setup a new transfer.
-
Constructor Details
-
RepoTransferReceiverImpl
public RepoTransferReceiverImpl()
-
-
Method Details
-
init
public void init() -
getStagingFolder
- Specified by:
getStagingFolderin interfaceTransferReceiver- Parameters:
transferId- String- Returns:
- File
-
getTempFolder
- Specified by:
getTempFolderin interfaceTransferReceiver- Parameters:
transferId- String- Returns:
- NodeRef
-
start
Description copied from interface:TransferReceiverAsks the receiver to setup a new transfer.- Specified by:
startin interfaceTransferReceiver- Parameters:
fromRepositoryId- the repositoryId of the sending systemtransferToSelf- are transfers to the same repository allowed?fromVersion- the version sending- Returns:
- The identifier of the new transfer
-
end
Description copied from interface:TransferReceiverAsks the receiver to end (and clean up) the specified transfer- Specified by:
endin interfaceTransferReceiver- Parameters:
transferId- The transfer to end
-
cancel
Description copied from interface:TransferReceiverAbort- Specified by:
cancelin interfaceTransferReceiver- Parameters:
transferId- String- Throws:
TransferException
-
prepare
Description copied from interface:TransferReceiverPrepare- Specified by:
preparein interfaceTransferReceiver- Parameters:
transferId- String- Throws:
TransferException
-
checkLock
public org.alfresco.repo.transfer.RepoTransferReceiverImpl.Lock checkLock(String transferId) throws TransferException - Throws:
TransferException
-
saveSnapshot
Description copied from interface:TransferReceiverStore the specified snapshot file into the transfer staging area. The specified transfer must currently be the holder of the transfer lock, otherwise an exception is thrown. This operation does not close the supplied stream, so the caller must do it as appropriate. The caller should assume that the supplied stream has been fully read when this operation returns.- Specified by:
saveSnapshotin interfaceTransferReceiver- Parameters:
transferId- The identifier of the transfer with which this snapshot is associatedopenStream- The open stream that holds the snapshot file.- Throws:
TransferException- If an error occurs while saving the snapshot file.
-
saveContent
public void saveContent(String transferId, String contentFileId, InputStream contentStream) throws TransferException Description copied from interface:TransferReceiverSave a content item- Specified by:
saveContentin interfaceTransferReceiver- Parameters:
transferId- StringcontentFileId- StringcontentStream- InputStream- Throws:
TransferException
-
commitAsync
Description copied from interface:TransferReceiverCommit asynchronously- Specified by:
commitAsyncin interfaceTransferReceiver- Parameters:
transferId- String
-
commit
Description copied from interface:TransferReceiverCommit- Specified by:
commitin interfaceTransferReceiver- Parameters:
transferId- String- Throws:
TransferException
-
getStatus
- Specified by:
getStatusin interfaceTransferReceiver- Parameters:
transferId- String- Returns:
- the trabsfer progress
- Throws:
TransferException
-
setSearchService
- Parameters:
searchService- the searchService to set
-
setTransactionService
- Parameters:
transactionService- the transactionService to set
-
setTenantService
-
setSingletonCache
-
setTransferLockFolderPath
- Parameters:
transferLockFolderPath- the transferLockFolderPath to set
-
setTransferTempFolderPath
- Parameters:
transferTempFolderPath- the transferTempFolderPath to set
-
setRootStagingDirectory
- Parameters:
rootStagingDirectory- the rootTransferFolder to set
-
setInboundTransferRecordsPath
- Parameters:
inboundTransferRecordsPath- the inboundTransferRecordsPath to set
-
setNodeService
- Parameters:
nodeService- the nodeService to set
-
setManifestProcessorFactory
- Parameters:
manifestProcessorFactory- the manifestProcessorFactory to set
-
setBehaviourFilter
- Parameters:
behaviourFilter- the behaviourFilter to set
-
getProgressMonitor
- Specified by:
getProgressMonitorin interfaceTransferReceiver- Returns:
- the progressMonitor
-
setProgressMonitor
- Parameters:
progressMonitor- the progressMonitor to set
-
setActionService
-
setRuleService
Set the ruleService- Parameters:
ruleService- the ruleService to set
-
getRuleService
Get the rule service- Returns:
- the rule service
-
setNamespaceService
-
generateRequsite
Generate the requsite- Specified by:
generateRequsitein interfaceTransferReceiverout- an open stream to receive the requisite- Throws:
TransferException
-
getTransferReport
Description copied from interface:TransferReceiverget the transfer report for the specified transfer- Specified by:
getTransferReportin interfaceTransferReceiver- Parameters:
transferId- String
-
setPolicyComponent
-
getPolicyComponent
-
onCreateChildAssociation
When a new node is created as a child of a Transferred or Alien node then the new node needs to be marked as an alien.Then the tree needs to be walked upwards to mark all parent transferred nodes as alien.
- Specified by:
onCreateChildAssociationin interfaceNodeServicePolicies.OnCreateChildAssociationPolicy- Parameters:
childAssocRef- the child association that has been createdisNewNode- true if the node is new or false if the node is being linked in
-
beforeDeleteNode
When an alien node is deleted the it may be the last alien invaderWalk the tree checking the invasion status!
- Specified by:
beforeDeleteNodein interfaceNodeServicePolicies.BeforeDeleteNodePolicy- Parameters:
deletedNodeRef- the node reference
-
onRestoreNode
When a transferred node is restored it may be a new invader or it may no longer be an invader.Walk the tree checking the invasion status!
- Specified by:
onRestoreNodein interfaceNodeServicePolicies.OnRestoreNodePolicy- Parameters:
childAssocRef- the newly created child association reference
-
onMoveNode
When an alien node is moved it may un-invade its old location and invade a new location. The node may also cease to be alien.- Specified by:
onMoveNodein interfaceNodeServicePolicies.OnMoveNodePolicy- Parameters:
oldChildAssocRef- the child association reference prior to the movenewChildAssocRef- the child association reference after the move
-
onCopyTransferred
When a transferred node is copied, don't copy the transferred aspect. -
onCopyAlien
When an alien node is copied, don't copy the alien aspect. -
setDescriptorService
-
getDescriptorService
-
setAlienProcessor
-
getAlienProcessor
-
onContentUpdate
- Specified by:
onContentUpdatein interfaceContentServicePolicies.OnContentUpdatePolicy- Parameters:
nodeRef- the node reference
-
setJobLockService
-
getJobLockService
-
setLockRetryCount
public void setLockRetryCount(int lockRetryCount) -
getLockRetryCount
public int getLockRetryCount() -
setLockRetryWait
public void setLockRetryWait(long lockRetryWait) -
getLockRetryWait
public long getLockRetryWait() -
setLockTimeOut
public void setLockTimeOut(long lockTimeOut) -
getLockTimeOut
public long getLockTimeOut() -
setLockRefreshTime
public void setLockRefreshTime(long lockRefreshTime) -
getLockRefreshTime
public long getLockRefreshTime() -
setTransferVersionChecker
-
getTransferVersionChecker
-
getVersion
Description copied from interface:TransferReceiverGet the version that we are transfering to.- Specified by:
getVersionin interfaceTransferReceiver
-
setTransferRootNode
Description copied from interface:TransferReceiverset the root node for the file system receiver- Specified by:
setTransferRootNodein interfaceTransferReceiver- Parameters:
rootFileSystem- String
-