mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
transfer service : sync mode for hub and spoke and chain + unit test
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21383 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -59,6 +59,7 @@ public class RepoTertiaryManifestProcessorImpl extends AbstractManifestProcessor
|
||||
* Is this a "sync" transfer. If not then does nothing.
|
||||
*/
|
||||
boolean isSync = false;
|
||||
String manifestRepositoryId;
|
||||
|
||||
/**
|
||||
* @param receiver
|
||||
@@ -131,9 +132,21 @@ public class RepoTertiaryManifestProcessorImpl extends AbstractManifestProcessor
|
||||
log.debug("an unexpected child node:" + child);
|
||||
if(nodeService.hasAspect(childNodeRef, TransferModel.ASPECT_TRANSFERRED))
|
||||
{
|
||||
// Destination node needs to be deleted.
|
||||
nodeService.deleteNode(childNodeRef);
|
||||
log.debug("deleted node:" + childNodeRef);
|
||||
String fromRepositoryId = (String)nodeService.getProperty(childNodeRef, TransferModel.PROP_FROM_REPOSITORY_ID);
|
||||
|
||||
// Yes this is a transferred node. When syncing we only delete nodes that are "from"
|
||||
// the system that is transferring to this repo.
|
||||
if(fromRepositoryId != null && manifestRepositoryId != null)
|
||||
{
|
||||
if(manifestRepositoryId.equalsIgnoreCase(fromRepositoryId))
|
||||
{
|
||||
// Yes the manifest repository Id and the from repository Id match.
|
||||
|
||||
// Destination node needs to be deleted.
|
||||
nodeService.deleteNode(childNodeRef);
|
||||
log.debug("deleted node:" + childNodeRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,6 +159,9 @@ public class RepoTertiaryManifestProcessorImpl extends AbstractManifestProcessor
|
||||
{
|
||||
isSync = header.isSync();
|
||||
log.debug("isSync :" + isSync);
|
||||
|
||||
manifestRepositoryId = header.getRepositoryId();
|
||||
log.debug("fromRepositoryId:" + manifestRepositoryId);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user