public class RepoTransferReceiverImpl extends Object implements TransferReceiver, NodeServicePolicies.OnCreateChildAssociationPolicy, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnRestoreNodePolicy, NodeServicePolicies.OnMoveNodePolicy, ContentServicePolicies.OnContentUpdatePolicy
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.
Modifier and Type | Class and Description |
---|---|
class |
RepoTransferReceiverImpl.AsyncCommitCommand
This embedded class is used to push requests for asynchronous commits onto a different thread
|
Policy.Arg
QNAME
QNAME
QNAME
QNAME
QNAME
Constructor and Description |
---|
RepoTransferReceiverImpl() |
Modifier and Type | Method and Description |
---|---|
void |
beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef deletedNodeRef)
When an alien node is deleted the it may be the last alien invader
|
void |
cancel(String transferId)
Abort
|
org.alfresco.repo.transfer.RepoTransferReceiverImpl.Lock |
checkLock(String transferId) |
void |
commit(String transferId)
Commit
|
void |
commitAsync(String transferId)
Commit asynchronously
|
void |
end(String transferId)
Asks the receiver to end (and clean up) the specified transfer
|
void |
generateRequsite(String transferId,
OutputStream out)
Generate the requsite
|
AlienProcessor |
getAlienProcessor() |
DescriptorService |
getDescriptorService() |
JobLockService |
getJobLockService() |
long |
getLockRefreshTime() |
int |
getLockRetryCount() |
long |
getLockRetryWait() |
long |
getLockTimeOut() |
PolicyComponent |
getPolicyComponent() |
TransferProgressMonitor |
getProgressMonitor() |
RuleService |
getRuleService()
Get the rule service
|
File |
getStagingFolder(String transferId) |
TransferProgress |
getStatus(String transferId) |
org.alfresco.service.cmr.repository.NodeRef |
getTempFolder(String transferId) |
InputStream |
getTransferReport(String transferId)
get the transfer report for the specified transfer
|
TransferVersionChecker |
getTransferVersionChecker() |
TransferVersion |
getVersion()
Get the version that we are transfering to.
|
void |
init() |
void |
onContentUpdate(org.alfresco.service.cmr.repository.NodeRef nodeRef,
boolean newContent) |
CopyBehaviourCallback |
onCopyAlien(org.alfresco.service.namespace.QName classRef,
CopyDetails copyDetails)
When an alien node is copied, don't copy the alien aspect.
|
CopyBehaviourCallback |
onCopyTransferred(org.alfresco.service.namespace.QName classRef,
CopyDetails copyDetails)
When a transferred node is copied, don't copy the transferred aspect.
|
void |
onCreateChildAssociation(org.alfresco.service.cmr.repository.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.
|
void |
onMoveNode(org.alfresco.service.cmr.repository.ChildAssociationRef oldChildAssocRef,
org.alfresco.service.cmr.repository.ChildAssociationRef newChildAssocRef)
When an alien node is moved it may un-invade its old location and invade a new
location.
|
void |
onRestoreNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
When a transferred node is restored it may be a new invader or it may no
longer be an invader.
|
void |
prepare(String transferId)
Prepare
|
void |
saveContent(String transferId,
String contentFileId,
InputStream contentStream)
Save a content item
|
void |
saveSnapshot(String transferId,
InputStream openStream)
Store the specified snapshot file into the transfer staging area.
|
void |
setActionService(ActionService actionService) |
void |
setAlienProcessor(AlienProcessor alienProcessor) |
void |
setBehaviourFilter(BehaviourFilter behaviourFilter) |
void |
setDescriptorService(DescriptorService descriptorService) |
void |
setInboundTransferRecordsPath(String inboundTransferRecordsPath) |
void |
setJobLockService(JobLockService jobLockService) |
void |
setLockRefreshTime(long lockRefreshTime) |
void |
setLockRetryCount(int lockRetryCount) |
void |
setLockRetryWait(long lockRetryWait) |
void |
setLockTimeOut(long lockTimeOut) |
void |
setManifestProcessorFactory(ManifestProcessorFactory manifestProcessorFactory) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setPolicyComponent(PolicyComponent policyComponent) |
void |
setProgressMonitor(TransferProgressMonitor progressMonitor) |
void |
setRootStagingDirectory(String rootStagingDirectory) |
void |
setRuleService(RuleService ruleService)
Set the ruleService
|
void |
setSearchService(org.alfresco.service.cmr.search.SearchService searchService) |
void |
setSingletonCache(org.alfresco.repo.cache.SimpleCache<String,org.alfresco.service.cmr.repository.NodeRef> singletonCache) |
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService) |
void |
setTransactionService(TransactionService transactionService) |
void |
setTransferLockFolderPath(String transferLockFolderPath) |
void |
setTransferRootNode(String rootFileSystem)
set the root node for the file system receiver
|
void |
setTransferTempFolderPath(String transferTempFolderPath) |
void |
setTransferVersionChecker(TransferVersionChecker transferVersionChecker) |
String |
start(String fromRepositoryId,
boolean transferToSelf,
TransferVersion fromVersion)
Asks the receiver to setup a new transfer.
|
public void init()
public File getStagingFolder(String transferId)
getStagingFolder
in interface TransferReceiver
transferId
- Stringpublic org.alfresco.service.cmr.repository.NodeRef getTempFolder(String transferId)
getTempFolder
in interface TransferReceiver
transferId
- Stringpublic String start(String fromRepositoryId, boolean transferToSelf, TransferVersion fromVersion)
TransferReceiver
start
in interface TransferReceiver
fromRepositoryId
- the repositoryId of the sending systemtransferToSelf
- are transfers to the same repository allowed?fromVersion
- the version sendingpublic void end(String transferId)
TransferReceiver
end
in interface TransferReceiver
transferId
- The transfer to endpublic void cancel(String transferId) throws TransferException
TransferReceiver
cancel
in interface TransferReceiver
transferId
- StringTransferException
public void prepare(String transferId) throws TransferException
TransferReceiver
prepare
in interface TransferReceiver
transferId
- StringTransferException
public org.alfresco.repo.transfer.RepoTransferReceiverImpl.Lock checkLock(String transferId) throws TransferException
TransferException
public void saveSnapshot(String transferId, InputStream openStream) throws TransferException
TransferReceiver
saveSnapshot
in interface TransferReceiver
transferId
- The identifier of the transfer with which this snapshot is associatedopenStream
- The open stream that holds the snapshot file.TransferException
- If an error occurs while saving the snapshot file.public void saveContent(String transferId, String contentFileId, InputStream contentStream) throws TransferException
TransferReceiver
saveContent
in interface TransferReceiver
transferId
- StringcontentFileId
- StringcontentStream
- InputStreamTransferException
public void commitAsync(String transferId)
TransferReceiver
commitAsync
in interface TransferReceiver
transferId
- Stringpublic void commit(String transferId) throws TransferException
TransferReceiver
commit
in interface TransferReceiver
transferId
- StringTransferException
public TransferProgress getStatus(String transferId) throws TransferException
getStatus
in interface TransferReceiver
transferId
- StringTransferException
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
searchService
- the searchService to setpublic void setTransactionService(TransactionService transactionService)
transactionService
- the transactionService to setpublic void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
public void setSingletonCache(org.alfresco.repo.cache.SimpleCache<String,org.alfresco.service.cmr.repository.NodeRef> singletonCache)
public void setTransferLockFolderPath(String transferLockFolderPath)
transferLockFolderPath
- the transferLockFolderPath to setpublic void setTransferTempFolderPath(String transferTempFolderPath)
transferTempFolderPath
- the transferTempFolderPath to setpublic void setRootStagingDirectory(String rootStagingDirectory)
rootStagingDirectory
- the rootTransferFolder to setpublic void setInboundTransferRecordsPath(String inboundTransferRecordsPath)
inboundTransferRecordsPath
- the inboundTransferRecordsPath to setpublic void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- the nodeService to setpublic void setManifestProcessorFactory(ManifestProcessorFactory manifestProcessorFactory)
manifestProcessorFactory
- the manifestProcessorFactory to setpublic void setBehaviourFilter(BehaviourFilter behaviourFilter)
behaviourFilter
- the behaviourFilter to setpublic TransferProgressMonitor getProgressMonitor()
getProgressMonitor
in interface TransferReceiver
public void setProgressMonitor(TransferProgressMonitor progressMonitor)
progressMonitor
- the progressMonitor to setpublic void setActionService(ActionService actionService)
public void setRuleService(RuleService ruleService)
ruleService
- the ruleService to setpublic RuleService getRuleService()
public void generateRequsite(String transferId, OutputStream out) throws TransferException
generateRequsite
in interface TransferReceiver
out
- an open stream to receive the requisiteTransferException
public InputStream getTransferReport(String transferId)
TransferReceiver
getTransferReport
in interface TransferReceiver
transferId
- Stringpublic void setPolicyComponent(PolicyComponent policyComponent)
public PolicyComponent getPolicyComponent()
public void onCreateChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef, boolean isNewNode)
Then the tree needs to be walked upwards to mark all parent transferred nodes as alien.
onCreateChildAssociation
in interface NodeServicePolicies.OnCreateChildAssociationPolicy
childAssocRef
- the child association that has been createdisNewNode
- true if the node is new or false if the node is being linked inpublic void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef deletedNodeRef)
Walk the tree checking the invasion status!
beforeDeleteNode
in interface NodeServicePolicies.BeforeDeleteNodePolicy
deletedNodeRef
- the node referencepublic void onRestoreNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
Walk the tree checking the invasion status!
onRestoreNode
in interface NodeServicePolicies.OnRestoreNodePolicy
childAssocRef
- the newly created child association referencepublic void onMoveNode(org.alfresco.service.cmr.repository.ChildAssociationRef oldChildAssocRef, org.alfresco.service.cmr.repository.ChildAssociationRef newChildAssocRef)
onMoveNode
in interface NodeServicePolicies.OnMoveNodePolicy
oldChildAssocRef
- the child association reference prior to the movenewChildAssocRef
- the child association reference after the movepublic CopyBehaviourCallback onCopyTransferred(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
public CopyBehaviourCallback onCopyAlien(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
public void setDescriptorService(DescriptorService descriptorService)
public DescriptorService getDescriptorService()
public void setAlienProcessor(AlienProcessor alienProcessor)
public AlienProcessor getAlienProcessor()
public void onContentUpdate(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean newContent)
onContentUpdate
in interface ContentServicePolicies.OnContentUpdatePolicy
nodeRef
- the node referencepublic void setJobLockService(JobLockService jobLockService)
public JobLockService getJobLockService()
public void setLockRetryCount(int lockRetryCount)
public int getLockRetryCount()
public void setLockRetryWait(long lockRetryWait)
public long getLockRetryWait()
public void setLockTimeOut(long lockTimeOut)
public long getLockTimeOut()
public void setLockRefreshTime(long lockRefreshTime)
public long getLockRefreshTime()
public void setTransferVersionChecker(TransferVersionChecker transferVersionChecker)
public TransferVersionChecker getTransferVersionChecker()
public TransferVersion getVersion()
TransferReceiver
getVersion
in interface TransferReceiver
public void setTransferRootNode(String rootFileSystem)
TransferReceiver
setTransferRootNode
in interface TransferReceiver
rootFileSystem
- StringCopyright © 2005–2017 Alfresco Software. All rights reserved.