public class AlienProcessorImpl extends Object implements AlienProcessor
Constructor and Description |
---|
AlienProcessorImpl() |
Modifier and Type | Method and Description |
---|---|
void |
afterMoveAlien(org.alfresco.service.cmr.repository.ChildAssociationRef newAssocRef)
Called when an alien node has been moved from one parent to another.
|
void |
beforeDeleteAlien(org.alfresco.service.cmr.repository.NodeRef deletedNodeRef,
org.alfresco.service.cmr.repository.ChildAssociationRef oldAssoc)
Called before deleting an alien node.
|
BehaviourFilter |
getBehaviourFilter() |
DescriptorService |
getDescriptorService() |
org.alfresco.service.cmr.dictionary.DictionaryService |
getDictionaryService() |
org.alfresco.service.cmr.repository.NodeService |
getNodeService() |
void |
init() |
boolean |
isAlien(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Has the node been invaded by aliens ?
|
protected void |
logInvasionHierarchy(org.alfresco.service.cmr.repository.NodeRef parentRef,
org.alfresco.service.cmr.repository.NodeRef childRef)
Puts information about current
childRef and its parentRef into log in TRACE level. |
void |
onCreateChild(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef,
String repositoryId,
boolean isNewNode)
Called before creating a child of a transferred node.
|
void |
pruneNode(org.alfresco.service.cmr.repository.NodeRef nodeToPrune,
String fromRepositoryId)
Prune the given node of aliens from the specified repositoryId.
|
void |
setBehaviourFilter(BehaviourFilter behaviourFilter) |
void |
setDescriptorService(DescriptorService descriptorService) |
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
public void init()
public void onCreateChild(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef, String repositoryId, boolean isNewNode)
AlienProcessor
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.
onCreateChild
in interface AlienProcessor
childAssocRef
- the association ref to the new noderepositoryId
- - the repositoryId of the system who owns the new node.isNewNode
- - is this a new nideprotected void logInvasionHierarchy(org.alfresco.service.cmr.repository.NodeRef parentRef, org.alfresco.service.cmr.repository.NodeRef childRef)
childRef
and its parentRef
into log in TRACE level. Information includes 'name', 'fromRepositoryId', 'aliened' and
'invadedBy' properties. Additionally, collects the same information for children of childRef
parentRef
- - NodeRef
instance of child nodechildRef
- - NodeRef
instance of parent of the childRef
public void beforeDeleteAlien(org.alfresco.service.cmr.repository.NodeRef deletedNodeRef, org.alfresco.service.cmr.repository.ChildAssociationRef oldAssoc)
AlienProcessor
The tree needs to be walked upwards to take account of the removed alien node.
beforeDeleteAlien
in interface AlienProcessor
deletedNodeRef
- node about to be deletedoldAssoc
- null if the deleted node is still "in place" and readable else the old ref prior to
the node being moved.public void afterMoveAlien(org.alfresco.service.cmr.repository.ChildAssociationRef newAssocRef)
AlienProcessor
If the new parent is transferred or alien may make the new parent an alien.
The alien node may also stop being an alien node.
afterMoveAlien
in interface AlienProcessor
public boolean isAlien(org.alfresco.service.cmr.repository.NodeRef nodeRef)
AlienProcessor
isAlien
in interface AlienProcessor
nodeRef
- the node to checkpublic void pruneNode(org.alfresco.service.cmr.repository.NodeRef nodeToPrune, String fromRepositoryId)
AlienProcessor
So any children that are only invaded by the specified repository are deleted.
Folders which are invaded by more than one repository will remain.
pruneNode
in interface AlienProcessor
nodeToPrune
- the root to prunefromRepositoryId
- the repositoryId to prune.public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public org.alfresco.service.cmr.repository.NodeService getNodeService()
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
public BehaviourFilter getBehaviourFilter()
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
public org.alfresco.service.cmr.dictionary.DictionaryService getDictionaryService()
public void setDescriptorService(DescriptorService descriptorService)
public DescriptorService getDescriptorService()
Copyright © 2005–2017 Alfresco Software. All rights reserved.