Package org.alfresco.repo.event2
Class EventGenerator
java.lang.Object
org.springframework.extensions.surf.util.AbstractLifecycleBean
org.alfresco.repo.event2.EventGenerator
- All Implemented Interfaces:
EventListener,ChildAssociationEventSupportedPolicies,EventSupportedPolicies,PeerAssociationEventSupportedPolicies,NodeServicePolicies.BeforeDeleteAssociationPolicy,NodeServicePolicies.BeforeDeleteChildAssociationPolicy,NodeServicePolicies.BeforeDeleteNodePolicy,NodeServicePolicies.OnAddAspectPolicy,NodeServicePolicies.OnCreateAssociationPolicy,NodeServicePolicies.OnCreateChildAssociationPolicy,NodeServicePolicies.OnCreateNodePolicy,NodeServicePolicies.OnMoveNodePolicy,NodeServicePolicies.OnRemoveAspectPolicy,NodeServicePolicies.OnSetNodeTypePolicy,NodeServicePolicies.OnUpdatePropertiesPolicy,AssociationPolicy,ClassPolicy,Policy,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener
public class EventGenerator
extends org.springframework.extensions.surf.util.AbstractLifecycleBean
implements org.springframework.beans.factory.InitializingBean, EventSupportedPolicies, ChildAssociationEventSupportedPolicies, PeerAssociationEventSupportedPolicies
Generates events and sends them to an event topic.
- Author:
- Jamal Kaabi-Mofrad
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected classNested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DictionaryServiceprotected booleanprotected NodeDAOprotected NodeResourceHelperprotected NodeServiceprotected PolicyComponentprotected final EventGenerator.EventTransactionListenerFields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
logFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteAssociationPolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteChildAssociationPolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateAssociationPolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnMoveNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnRemoveAspectPolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnSetNodeTypePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy
ARG_0, ARG_1, ARG_2, QNAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidbeforeDeleteAssociation(AssociationRef associationRef) Called before a regular node association is deleted.voidbeforeDeleteChildAssociation(ChildAssociationRef childAssociationRef) Called before a node child association is deleted.voidbeforeDeleteNode(NodeRef nodeRef) Called before a node is deleted.protected BehaviourbindAssociationBehaviour(QName policyQName, String method) protected BehaviourbindClassBehaviour(QName policyQName, String method) protected ChildAssociationEventConsolidatorcreateChildAssociationEventConsolidator(ChildAssociationRef childAssociationRef) protected NodeEventConsolidatorprotected PeerAssociationEventConsolidatorcreatePeerAssociationEventConsolidator(AssociationRef peerAssociationRef) voiddisable()Disable Events2 generated eventsprotected voiddisableBehaviours(Set<Behaviour> boundBehaviours) voidenable()Enable Events2 generated eventsprotected voidenableBehaviours(Set<Behaviour> boundBehaviours) protected NodeEventConsolidatorgetEventConsolidator(NodeRef nodeRef) protected EventInfogetEventInfo(String user) protected EventGenerator.ConsolidatorsgetTxnConsolidators(Object resourceKey) booleanvoidonAddAspect(NodeRef nodeRef, QName aspectTypeQName) Called after an aspect has been added to a nodeprotected voidonBootstrap(org.springframework.context.ApplicationEvent applicationEvent) voidonCreateAssociation(AssociationRef associationRef) Called after a regular node association is created.voidonCreateChildAssociation(ChildAssociationRef childAssociationRef, boolean isNewNode) Called after a node child association has been created.voidonCreateNode(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.protected voidonShutdown(org.springframework.context.ApplicationEvent applicationEvent) voidonUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after) Called after a node's properties have been changed.voidsetDescriptorService(DescriptorService descriptorService) voidsetDictionaryService(DictionaryService dictionaryService) voidsetEnabled(boolean enabled) voidsetEventFilterRegistry(EventFilterRegistry eventFilterRegistry) voidsetEventSender(EventSender eventSender) voidsetNamespaceService(NamespaceService namespaceService) voidsetNodeDAO(NodeDAO nodeDAO) voidsetNodeResourceHelper(NodeResourceHelper nodeResourceHelper) voidsetNodeService(NodeService nodeService) voidsetPersonService(PersonService personService) voidsetPolicyComponent(PolicyComponent policyComponent) voidsetTransactionService(TransactionService transactionService) Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
getApplicationContext, onApplicationEvent, setApplicationContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Field Details
-
policyComponent
-
nodeService
-
dictionaryService
-
nodeResourceHelper
-
nodeDAO
-
transactionListener
-
enabled
protected boolean enabled
-
-
Constructor Details
-
EventGenerator
public EventGenerator()
-
-
Method Details
-
setEnabled
public void setEnabled(boolean enabled) -
isEnabled
public boolean isEnabled() -
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
disable
public void disable()Disable Events2 generated events -
enable
public void enable()Enable Events2 generated events -
setNodeDAO
-
setPolicyComponent
-
setNodeService
-
setNamespaceService
-
setDictionaryService
-
setDescriptorService
-
setEventFilterRegistry
-
setTransactionService
-
setPersonService
-
setNodeResourceHelper
-
setEventSender
-
getEventSender
-
onCreateNode
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
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
-
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
-
onSetNodeType
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.
-
beforeDeleteNode
Description copied from interface:NodeServicePolicies.BeforeDeleteNodePolicyCalled before a node is deleted.- Specified by:
beforeDeleteNodein interfaceNodeServicePolicies.BeforeDeleteNodePolicy- Parameters:
nodeRef- the node reference
-
onAddAspect
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
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
-
onCreateChildAssociation
Description copied from interface:NodeServicePolicies.OnCreateChildAssociationPolicyCalled after a node child association has been created.- Specified by:
onCreateChildAssociationin interfaceNodeServicePolicies.OnCreateChildAssociationPolicy- Parameters:
childAssociationRef- the child association that has been createdisNewNode- true if the node is new or false if the node is being linked in
-
beforeDeleteChildAssociation
Description copied from interface:NodeServicePolicies.BeforeDeleteChildAssociationPolicyCalled before a node child association is deleted.- Specified by:
beforeDeleteChildAssociationin interfaceNodeServicePolicies.BeforeDeleteChildAssociationPolicy- Parameters:
childAssociationRef- the child association to be deleted
-
onCreateAssociation
Description copied from interface:NodeServicePolicies.OnCreateAssociationPolicyCalled after a regular node association is created.- Specified by:
onCreateAssociationin interfaceNodeServicePolicies.OnCreateAssociationPolicy- Parameters:
associationRef- the regular node association that was created
-
beforeDeleteAssociation
Description copied from interface:NodeServicePolicies.BeforeDeleteAssociationPolicyCalled before a regular node association is deleted.- Specified by:
beforeDeleteAssociationin interfaceNodeServicePolicies.BeforeDeleteAssociationPolicy- Parameters:
associationRef- the regular node association that will be removed
-
createEventConsolidator
-
createChildAssociationEventConsolidator
protected ChildAssociationEventConsolidator createChildAssociationEventConsolidator(ChildAssociationRef childAssociationRef) -
createPeerAssociationEventConsolidator
protected PeerAssociationEventConsolidator createPeerAssociationEventConsolidator(AssociationRef peerAssociationRef) -
bindClassBehaviour
-
bindAssociationBehaviour
-
disableBehaviours
-
enableBehaviours
-
getEventConsolidator
- Returns:
- the
NodeEventConsolidatorfor the suppliednodeReffrom the current transaction context.
-
getTxnConsolidators
-
getEventInfo
-
onBootstrap
protected void onBootstrap(org.springframework.context.ApplicationEvent applicationEvent) - Specified by:
onBootstrapin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
onShutdown
protected void onShutdown(org.springframework.context.ApplicationEvent applicationEvent) - Specified by:
onShutdownin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-