Package org.alfresco.repo.event2
Class PeerAssociationEventConsolidator
- java.lang.Object
-
- org.alfresco.repo.event2.PeerAssociationEventConsolidator
-
- All Implemented Interfaces:
PeerAssociationEventSupportedPolicies,NodeServicePolicies.BeforeDeleteAssociationPolicy,NodeServicePolicies.OnCreateAssociationPolicy,AssociationPolicy,Policy
public class PeerAssociationEventConsolidator extends java.lang.Object implements PeerAssociationEventSupportedPolicies
Encapsulates peer association events occurred in a single transaction.- Author:
- Sara Aspery
-
-
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 org.alfresco.service.cmr.repository.AssociationRefassociationRef-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteAssociationPolicy
QNAME
-
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateAssociationPolicy
QNAME
-
-
Constructor Summary
Constructors Constructor Description PeerAssociationEventConsolidator(org.alfresco.service.cmr.repository.AssociationRef associationRef, NodeResourceHelper helper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeDeleteAssociation(org.alfresco.service.cmr.repository.AssociationRef associationRef)Add peer association deleted event on delete of a peer association.protected org.alfresco.repo.event.v1.model.DataAttributes<org.alfresco.repo.event.v1.model.PeerAssociationResource>buildEventData(EventInfo eventInfo, org.alfresco.repo.event.v1.model.PeerAssociationResource resource)org.alfresco.service.namespace.QNamegetAssocType()Get peer association type.java.util.Deque<org.alfresco.repo.event.v1.model.EventType>getEventTypes()Get event types.org.alfresco.repo.event.v1.model.RepoEvent<org.alfresco.repo.event.v1.model.DataAttributes<org.alfresco.repo.event.v1.model.PeerAssociationResource>>getRepoEvent(EventInfo eventInfo)Builds and returns theRepoEventinstance.booleanisTemporaryPeerAssociation()Whether or not the association has been created and then deleted, i.e.voidonCreateAssociation(org.alfresco.service.cmr.repository.AssociationRef associationRef)Add peer association created event on create of a peer association.
-
-
-
Constructor Detail
-
PeerAssociationEventConsolidator
public PeerAssociationEventConsolidator(org.alfresco.service.cmr.repository.AssociationRef associationRef, NodeResourceHelper helper)
-
-
Method Detail
-
getRepoEvent
public org.alfresco.repo.event.v1.model.RepoEvent<org.alfresco.repo.event.v1.model.DataAttributes<org.alfresco.repo.event.v1.model.PeerAssociationResource>> 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.PeerAssociationResource> buildEventData(EventInfo eventInfo, org.alfresco.repo.event.v1.model.PeerAssociationResource resource)
-
onCreateAssociation
public void onCreateAssociation(org.alfresco.service.cmr.repository.AssociationRef associationRef)
Add peer association created event on create of a peer association.- Specified by:
onCreateAssociationin interfaceNodeServicePolicies.OnCreateAssociationPolicy- Parameters:
associationRef- AssociationRef
-
beforeDeleteAssociation
public void beforeDeleteAssociation(org.alfresco.service.cmr.repository.AssociationRef associationRef)
Add peer association deleted event on delete of a peer association.- Specified by:
beforeDeleteAssociationin interfaceNodeServicePolicies.BeforeDeleteAssociationPolicy- Parameters:
associationRef- AssociationRef
-
isTemporaryPeerAssociation
public boolean isTemporaryPeerAssociation()
Whether or not the association has been created and then deleted, i.e. a temporary association.- Returns:
trueif the association has been created and then deleted, otherwise false
-
getAssocType
public org.alfresco.service.namespace.QName getAssocType()
Get peer association type.- Returns:
- QName the peer association type
-
getEventTypes
public java.util.Deque<org.alfresco.repo.event.v1.model.EventType> getEventTypes()
Get event types.- Returns:
- Deque
queue of event types
-
-