Package org.alfresco.repo.event2
Class EventConsolidator
- java.lang.Object
-
- org.alfresco.repo.event2.EventConsolidator
-
- All Implemented Interfaces:
EventSupportedPolicies,NodeServicePolicies.BeforeDeleteNodePolicy,NodeServicePolicies.OnAddAspectPolicy,NodeServicePolicies.OnCreateNodePolicy,NodeServicePolicies.OnMoveNodePolicy,NodeServicePolicies.OnRemoveAspectPolicy,NodeServicePolicies.OnSetNodeTypePolicy,NodeServicePolicies.OnUpdatePropertiesPolicy,ClassPolicy,Policy
public class EventConsolidator extends Object implements EventSupportedPolicies
Encapsulates events occurred in a single transaction.- Author:
- Jamal Kaabi-Mofrad
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
-
-
Field Summary
Fields Modifier and Type Field Description protected NodeRefnodeRef-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnMoveNodePolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnRemoveAspectPolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnSetNodeTypePolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy
ARG_0, ARG_1, ARG_2, QNAME
-
-
Constructor Summary
Constructors Constructor Description EventConsolidator(NodeResourceHelper nodeResourceHelper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeDeleteNode(NodeRef nodeRef)Called before a node is deleted.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, EventType eventType)protected org.alfresco.repo.event.v1.model.NodeResourcebuildNodeResourceBeforeDelta(org.alfresco.repo.event.v1.model.NodeResource after)List<QName>getAspectsAdded()List<QName>getAspectsRemoved()Deque<EventType>getEventTypes()QNamegetNodeType()org.alfresco.repo.event.v1.model.RepoEvent<org.alfresco.repo.event.v1.model.DataAttributes<org.alfresco.repo.event.v1.model.NodeResource>>getRepoEvent(EventInfo eventInfo)Builds and returns theRepoEventinstance.booleanisResourceBeforeAllFieldsNull()booleanisTemporaryNode()Whether or not the node has been created and then deleted, i.e.voidonAddAspect(NodeRef nodeRef, QName aspectTypeQName)Called after an aspect has been added to a nodevoidonCreateNode(ChildAssociationRef childAssocRef)Called when a new node has been created.voidonMoveNode(ChildAssociationRef oldChildAssocRef, ChildAssociationRef newChildAssocRef)Called when a node has been moved.voidonRemoveAspect(NodeRef nodeRef, QName aspectTypeQName)Called after an aspect has been removed from a nodevoidonSetNodeType(NodeRef nodeRef, QName before, QName after)Called after the type of a node is set explicitly.voidonUpdateProperties(NodeRef nodeRef, Map<QName,Serializable> before, Map<QName,Serializable> after)Called after a node's properties have been changed.
-
-
-
Field Detail
-
nodeRef
protected NodeRef nodeRef
-
-
Constructor Detail
-
EventConsolidator
public EventConsolidator(NodeResourceHelper nodeResourceHelper)
-
-
Method Detail
-
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)
Builds and returns theRepoEventinstance.- Parameters:
eventInfo- the object holding the event information- Returns:
- the
RepoEventinstance
-
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, EventType eventType)
-
onCreateNode
public void onCreateNode(ChildAssociationRef childAssocRef)
Description copied from interface:NodeServicePolicies.OnCreateNodePolicyCalled when a new node has been created.- Specified by:
onCreateNodein interfaceNodeServicePolicies.OnCreateNodePolicy- Parameters:
childAssocRef- the created child association reference
-
onMoveNode
public void onMoveNode(ChildAssociationRef oldChildAssocRef, ChildAssociationRef newChildAssocRef)
Description copied from interface:NodeServicePolicies.OnMoveNodePolicyCalled when a node has been moved.- Specified by:
onMoveNodein interfaceNodeServicePolicies.OnMoveNodePolicy- Parameters:
oldChildAssocRef- the child association reference prior to the movenewChildAssocRef- the child association reference after the move
-
onSetNodeType
public void onSetNodeType(NodeRef nodeRef, QName before, QName after)
Description copied from interface:NodeServicePolicies.OnSetNodeTypePolicyCalled after the type of a node is set explicitly.- Specified by:
onSetNodeTypein interfaceNodeServicePolicies.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.OnUpdatePropertiesPolicyCalled after a node's properties have been changed.- Specified by:
onUpdatePropertiesin interfaceNodeServicePolicies.OnUpdatePropertiesPolicy- Parameters:
nodeRef- reference to the updated nodebefore- the node's properties before the changeafter- the node's properties after the change
-
beforeDeleteNode
public void beforeDeleteNode(NodeRef nodeRef)
Description copied from interface:NodeServicePolicies.BeforeDeleteNodePolicyCalled before a node is deleted.- Specified by:
beforeDeleteNodein interfaceNodeServicePolicies.BeforeDeleteNodePolicy- Parameters:
nodeRef- the node reference
-
onAddAspect
public void onAddAspect(NodeRef nodeRef, QName aspectTypeQName)
Description copied from interface:NodeServicePolicies.OnAddAspectPolicyCalled after an aspect has been added to a node- Specified by:
onAddAspectin interfaceNodeServicePolicies.OnAddAspectPolicy- Parameters:
nodeRef- the node to which the aspect was addedaspectTypeQName- the type of the aspect
-
onRemoveAspect
public void onRemoveAspect(NodeRef nodeRef, QName aspectTypeQName)
Description copied from interface:NodeServicePolicies.OnRemoveAspectPolicyCalled after an aspect has been removed from a node- Specified by:
onRemoveAspectin interfaceNodeServicePolicies.OnRemoveAspectPolicy- Parameters:
nodeRef- the node from which the aspect will be removedaspectTypeQName- the type of the aspect
-
buildNodeResourceBeforeDelta
protected org.alfresco.repo.event.v1.model.NodeResource buildNodeResourceBeforeDelta(org.alfresco.repo.event.v1.model.NodeResource after)
-
isTemporaryNode
public boolean isTemporaryNode()
Whether or not the node has been created and then deleted, i.e. a temporary node.- Returns:
trueif the node has been created and then deleted, otherwise false
-
getNodeType
public QName getNodeType()
-
isResourceBeforeAllFieldsNull
public boolean isResourceBeforeAllFieldsNull()
-
-