Class AlienProcessorImpl

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

public class AlienProcessorImpl extends Object implements AlienProcessor
Class to encapsulate the behaviour of "Alien" nodes.
  • Constructor Details

    • AlienProcessorImpl

      public AlienProcessorImpl()
  • Method Details

    • init

      public void init()
    • onCreateChild

      public void onCreateChild(ChildAssociationRef childAssocRef, 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
    • logInvasionHierarchy

      protected void logInvasionHierarchy(NodeRef parentRef, NodeRef childRef)
      Puts information about current 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
      Parameters:
      parentRef - - NodeRef instance of child node
      childRef - - NodeRef instance of parent of the childRef
    • beforeDeleteAlien

      public void beforeDeleteAlien(NodeRef deletedNodeRef, 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
      Parameters:
      deletedNodeRef - node about to be deleted
      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(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(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(NodeRef nodeToPrune, 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(NodeService nodeService)
    • getNodeService

      public NodeService getNodeService()
    • setBehaviourFilter

      public void setBehaviourFilter(BehaviourFilter behaviourFilter)
    • getBehaviourFilter

      public BehaviourFilter getBehaviourFilter()
    • setDictionaryService

      public void setDictionaryService(DictionaryService dictionaryService)
    • getDictionaryService

      public DictionaryService getDictionaryService()
    • setDescriptorService

      public void setDescriptorService(DescriptorService descriptorService)
    • getDescriptorService

      public DescriptorService getDescriptorService()