Class NodeEventConsolidator

java.lang.Object
org.alfresco.repo.event2.EventConsolidator<NodeRef,org.alfresco.repo.event.v1.model.NodeResource>
org.alfresco.repo.event2.NodeEventConsolidator
All Implemented Interfaces:
EventSupportedPolicies, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.OnCreateNodePolicy, NodeServicePolicies.OnMoveNodePolicy, NodeServicePolicies.OnRemoveAspectPolicy, NodeServicePolicies.OnSetNodeTypePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, ClassPolicy, Policy

public class NodeEventConsolidator extends EventConsolidator<NodeRef,org.alfresco.repo.event.v1.model.NodeResource> implements EventSupportedPolicies
Encapsulates node events occurred in a single transaction.
Author:
Jamal Kaabi-Mofrad
  • Constructor Details

    • NodeEventConsolidator

      public NodeEventConsolidator(NodeResourceHelper nodeResourceHelper)
  • Method Details

    • getRepoEvent

      public org.alfresco.repo.event.v1.model.RepoEvent<org.alfresco.repo.event.v1.model.DataAttributes<org.alfresco.repo.event.v1.model.NodeResource>> getRepoEvent(EventInfo eventInfo)
      Description copied from class: EventConsolidator
      Builds and returns the RepoEvent instance.
      Overrides:
      getRepoEvent in class EventConsolidator<NodeRef,org.alfresco.repo.event.v1.model.NodeResource>
      Parameters:
      eventInfo - the object holding the event information
      Returns:
      the RepoEvent instance
    • buildEventData

      protected org.alfresco.repo.event.v1.model.DataAttributes<org.alfresco.repo.event.v1.model.NodeResource> buildEventData(EventInfo eventInfo, org.alfresco.repo.event.v1.model.NodeResource resource, org.alfresco.repo.event.v1.model.EventType eventType)
      Description copied from class: EventConsolidator
      Provides primary event data.
      Overrides:
      buildEventData in class EventConsolidator<NodeRef,org.alfresco.repo.event.v1.model.NodeResource>
    • createBuilderIfAbsent

      protected void createBuilderIfAbsent(NodeRef nodeRef, boolean forceUpdate)
      Creates a builder instance if absent or forceUpdate is requested. It also, sets the required fields.
      Parameters:
      nodeRef - the nodeRef in the txn
      forceUpdate - if true, will get the latest node info and ignores the existing builder object.
    • createBuilderIfAbsent

      protected void createBuilderIfAbsent(NodeRef nodeRef)
      Creates a builder instance if absent, and sets the required fields.
      Parameters:
      nodeRef - the nodeRef in the txn
    • onCreateNode

      public void onCreateNode(ChildAssociationRef childAssocRef)
      Description copied from interface: NodeServicePolicies.OnCreateNodePolicy
      Called when a new node has been created.
      Specified by:
      onCreateNode in interface NodeServicePolicies.OnCreateNodePolicy
      Parameters:
      childAssocRef - the created child association reference
    • onMoveNode

      public void onMoveNode(ChildAssociationRef oldChildAssocRef, ChildAssociationRef newChildAssocRef)
      Description copied from interface: NodeServicePolicies.OnMoveNodePolicy
      Called when a node has been moved.
      Specified by:
      onMoveNode in interface NodeServicePolicies.OnMoveNodePolicy
      Parameters:
      oldChildAssocRef - the child association reference prior to the move
      newChildAssocRef - the child association reference after the move
    • onSetNodeType

      public void onSetNodeType(NodeRef nodeRef, QName before, QName after)
      Description copied from interface: NodeServicePolicies.OnSetNodeTypePolicy
      Called after the type of a node is set explicitly.
      Specified by:
      onSetNodeType in interface NodeServicePolicies.OnSetNodeTypePolicy
      Parameters:
      nodeRef - the node that has had its type set.
      before - the previous type of the node.
      after - the type the node has been given.
    • onUpdateProperties

      public void onUpdateProperties(NodeRef nodeRef, Map<QName,Serializable> before, Map<QName,Serializable> after)
      Description copied from interface: NodeServicePolicies.OnUpdatePropertiesPolicy
      Called after a node's properties have been changed.
      Specified by:
      onUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicy
      Parameters:
      nodeRef - reference to the updated node
      before - the node's properties before the change
      after - the node's properties after the change
    • beforeDeleteNode

      public void beforeDeleteNode(NodeRef nodeRef)
      Description copied from interface: NodeServicePolicies.BeforeDeleteNodePolicy
      Called before a node is deleted.
      Specified by:
      beforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicy
      Parameters:
      nodeRef - the node reference
    • onAddAspect

      public void onAddAspect(NodeRef nodeRef, QName aspectTypeQName)
      Description copied from interface: NodeServicePolicies.OnAddAspectPolicy
      Called after an aspect has been added to a node
      Specified by:
      onAddAspect in interface NodeServicePolicies.OnAddAspectPolicy
      Parameters:
      nodeRef - the node to which the aspect was added
      aspectTypeQName - the type of the aspect
    • onRemoveAspect

      public void onRemoveAspect(NodeRef nodeRef, QName aspectTypeQName)
      Description copied from interface: NodeServicePolicies.OnRemoveAspectPolicy
      Called after an aspect has been removed from a node
      Specified by:
      onRemoveAspect in interface NodeServicePolicies.OnRemoveAspectPolicy
      Parameters:
      nodeRef - the node from which the aspect will be removed
      aspectTypeQName - the type of the aspect
    • buildNodeResourceBeforeDelta

      protected org.alfresco.repo.event.v1.model.NodeResource buildNodeResourceBeforeDelta(org.alfresco.repo.event.v1.model.NodeResource after)
    • getDerivedEvent

      protected org.alfresco.repo.event.v1.model.EventType getDerivedEvent()
      Description copied from class: EventConsolidator
      Get a derived event for a transaction.
      Specified by:
      getDerivedEvent in class EventConsolidator<NodeRef,org.alfresco.repo.event.v1.model.NodeResource>
      Returns:
      a derived event type
    • isTemporaryEntity

      public boolean isTemporaryEntity()
      Description copied from class: EventConsolidator
      Whether the entity has been created and then deleted, e.g. a temporary node.
      Specified by:
      isTemporaryEntity in class EventConsolidator<NodeRef,org.alfresco.repo.event.v1.model.NodeResource>
      Returns:
      true if the node has been created and then deleted, otherwise false
    • getEntityType

      public QName getEntityType()
      Description copied from class: EventConsolidator
      Get entity (e.g. node, peer association, child association) type.
      Specified by:
      getEntityType in class EventConsolidator<NodeRef,org.alfresco.repo.event.v1.model.NodeResource>
      Returns:
      QName the peer association type
    • getAspectsAdded

      public List<QName> getAspectsAdded()
    • getAspectsRemoved

      public List<QName> getAspectsRemoved()
    • isResourceBeforeAllFieldsNull

      public boolean isResourceBeforeAllFieldsNull()
    • isEventTypeEqualTo

      public boolean isEventTypeEqualTo(org.alfresco.repo.event.v1.model.EventType eventType)
    • setResourceBeforeAllFieldsNull

      protected void setResourceBeforeAllFieldsNull(boolean resourceBeforeAllFieldsNull)