org.alfresco.repo.transfer
Class AlienProcessorImpl

java.lang.Object
  extended by org.alfresco.repo.transfer.AlienProcessorImpl
All Implemented Interfaces:
AlienProcessor

public class AlienProcessorImpl
extends java.lang.Object
implements AlienProcessor

Class to encapsulate the behaviour of "Alien" nodes.


Constructor Summary
AlienProcessorImpl()
           
 
Method Summary
 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 ?
 void onCreateChild(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef, java.lang.String repositoryId, boolean isNewNode)
          Called before creating a child of a transferred node.
 void pruneNode(org.alfresco.service.cmr.repository.NodeRef nodeToPrune, java.lang.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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlienProcessorImpl

public AlienProcessorImpl()
Method Detail

init

public void init()

onCreateChild

public void onCreateChild(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef,
                          java.lang.String repositoryId,
                          boolean isNewNode)
Description copied from interface: AlienProcessor
Called before creating a child of a transferred node.

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:
onCreateChild in interface AlienProcessor
Parameters:
childAssocRef - the association ref to the new node
repositoryId - - the repositoryId of the system who owns the new node.
isNewNode - - is this a new nide

beforeDeleteAlien

public void beforeDeleteAlien(org.alfresco.service.cmr.repository.NodeRef deletedNodeRef,
                              org.alfresco.service.cmr.repository.ChildAssociationRef oldAssoc)
Description copied from interface: AlienProcessor
Called before deleting an alien node.

The tree needs to be walked upwards to take account of the removed alien node.

Specified by:
beforeDeleteAlien in interface AlienProcessor
oldAssoc - null if the deleted node is still "in place" and readable else the old ref prior to the node being moved.

afterMoveAlien

public void afterMoveAlien(org.alfresco.service.cmr.repository.ChildAssociationRef newAssocRef)
Description copied from interface: AlienProcessor
Called when an alien node has been moved from one parent to another.

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.

Specified by:
afterMoveAlien in interface AlienProcessor

isAlien

public boolean isAlien(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface: AlienProcessor
Has the node been invaded by aliens ?

Specified by:
isAlien in interface AlienProcessor
Parameters:
nodeRef - the node to check
Returns:
true the node has been invaded by aliens.

pruneNode

public void pruneNode(org.alfresco.service.cmr.repository.NodeRef nodeToPrune,
                      java.lang.String fromRepositoryId)
Description copied from interface: AlienProcessor
Prune the given node of aliens from the specified repositoryId.

So any children that are only invaded by the specified repository are deleted.

Folders which are invaded by more than one repository will remain.

Specified by:
pruneNode in interface AlienProcessor
Parameters:
nodeToPrune - the root to prune
fromRepositoryId - the repositoryId to prune.

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)

getNodeService

public org.alfresco.service.cmr.repository.NodeService getNodeService()

setBehaviourFilter

public void setBehaviourFilter(BehaviourFilter behaviourFilter)

getBehaviourFilter

public BehaviourFilter getBehaviourFilter()

setDictionaryService

public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)

getDictionaryService

public org.alfresco.service.cmr.dictionary.DictionaryService getDictionaryService()

setDescriptorService

public void setDescriptorService(DescriptorService descriptorService)

getDescriptorService

public DescriptorService getDescriptorService()


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.