Class AbstractEventsService

java.lang.Object
org.alfresco.repo.transaction.TransactionListenerAdapter
org.alfresco.repo.events.AbstractEventsService
All Implemented Interfaces:
TransactionListener, org.alfresco.util.transaction.TransactionListener
Direct Known Subclasses:
EventsServiceImpl, ExceptionEventsServiceImpl

public abstract class AbstractEventsService extends TransactionListenerAdapter
Author:
steveglover
  • Field Details

  • Constructor Details

    • AbstractEventsService

      public AbstractEventsService()
  • Method Details

    • setCociService

      public void setCociService(CheckOutCheckInService cociService)
    • setHiddenAspect

      public void setHiddenAspect(HiddenAspect hiddenAspect)
    • setSendEventsBeforeCommit

      public void setSendEventsBeforeCommit(boolean sendEventsBeforeCommit)
    • setTransactionService

      public void setTransactionService(TransactionService transactionService)
    • setIncludeEventTypes

      public void setIncludeEventTypes(String includeEventTypesStr)
    • setFileFolderService

      public void setFileFolderService(FileFolderService fileFolderService)
    • setEventRegistry

      public void setEventRegistry(org.alfresco.sync.events.EventRegistry eventRegistry)
    • setNamespaceService

      public void setNamespaceService(NamespaceService namespaceService)
    • setPermissionService

      public void setPermissionService(PermissionService permissionService)
    • setMessageProducer

      public void setMessageProducer(MessageProducer messageProducer)
    • setDictionaryService

      public void setDictionaryService(DictionaryService dictionaryService)
    • setNodeService

      public void setNodeService(NodeService nodeService)
    • setSiteService

      public void setSiteService(SiteService siteService)
    • init

      public void init()
    • nextSequenceNumber

      protected long nextSequenceNumber()
    • beforeCommit

      public void beforeCommit(boolean readOnly)
      Description copied from class: TransactionListenerAdapter
      Called before a transaction is committed.

      All transaction resources are still available.

      Specified by:
      beforeCommit in interface TransactionListener
      Specified by:
      beforeCommit in interface org.alfresco.util.transaction.TransactionListener
      Overrides:
      beforeCommit in class TransactionListenerAdapter
      Parameters:
      readOnly - true if the transaction is read-only
    • getAlfrescoClient

      protected org.alfresco.sync.repo.Client getAlfrescoClient(org.alfresco.sync.repo.Client knownClientType)
    • afterCommit

      public void afterCommit()
      Description copied from class: TransactionListenerAdapter
      Invoked after transaction commit.

      Any exceptions generated here will only be logged and will have no effect on the state of the transaction.

      Although all transaction resources are still available, this method should be used only for cleaning up resources after a commit has occured.

      Specified by:
      afterCommit in interface TransactionListener
      Specified by:
      afterCommit in interface org.alfresco.util.transaction.TransactionListener
      Overrides:
      afterCommit in class TransactionListenerAdapter
    • shouldSendCommitEvent

      protected boolean shouldSendCommitEvent()
      Determines whether it still makes sense to create and send a TransactionCommittedEvent after the transaction is committed. (e.g. if there are no events for the specific transaction makes no sense to signal the end of transaction with TransactionCommittedEvent)
      Returns:
      whether the TransactionCommitted event should be sent
    • filterEventsBeforeSend

      protected List<org.alfresco.sync.events.types.Event> filterEventsBeforeSend(List<org.alfresco.sync.events.types.Event> events)
      Filter out event before sending them to MessageProducer
      Parameters:
      events - the events to be filtered
      Returns:
      a filtered list of events
    • afterRollback

      public void afterRollback()
      Description copied from class: TransactionListenerAdapter
      Invoked after transaction rollback.

      Any exceptions generated here will only be logged and will have no effect on the state of the transaction.

      Although all transaction resources are still available, this method should be used only for cleaning up resources after a rollback has occured.

      Specified by:
      afterRollback in interface TransactionListener
      Specified by:
      afterRollback in interface org.alfresco.util.transaction.TransactionListener
      Overrides:
      afterRollback in class TransactionListenerAdapter
    • includeEventType

      protected boolean includeEventType(String eventType)
    • retrieveAdditionalProps

      protected void retrieveAdditionalProps(Map<String,Serializable> properties, NodeRef nodeRef)
      Extract additional information for the provided node
      Parameters:
      properties - the properties map to add the new info to
      nodeRef - the node to extract the property from
    • getPaths

      protected List<String> getPaths(List<Path> nodePaths, List<String> toAppend)
    • getNodeIdsFromParent

      protected List<List<String>> getNodeIdsFromParent(List<Path> nodePaths)
      For each path, construct a list of ancestor node ids starting with the parent node id first.
      Parameters:
      nodePaths -
      Returns:
    • getNodeIds

      protected List<List<String>> getNodeIds(List<Path> nodePaths)
      For each path, construct a list of ancestor node ids starting with the leaf path element node id first.
      Parameters:
      nodePaths -
      Returns:
    • getTxnEvents

      protected org.alfresco.repo.events.AbstractEventsService.TxnEvents getTxnEvents()
    • sendEvent

      public void sendEvent(org.alfresco.sync.events.types.Event event)
      Register the event to be sent to a message producer once the transaction is over
      Parameters:
      event - event to be sent
    • getNodeInfo

      protected AbstractEventsService.NodeInfo getNodeInfo(NodeRef nodeRef, String eventType)