Class AlienProcessorImpl

  • All Implemented Interfaces:
    AlienProcessor

    public class AlienProcessorImpl
    extends java.lang.Object
    implements AlienProcessor
    Class to encapsulate the behaviour of "Alien" nodes.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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, 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
      • logInvasionHierarchy

        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. 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​(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
        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​(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)
      • 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)