public abstract class AbstractEventsService extends TransactionListenerAdapter
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractEventsService.NodeInfo |
| Modifier and Type | Field and Description |
|---|---|
protected CheckOutCheckInService |
cociService |
protected org.alfresco.service.cmr.dictionary.DictionaryService |
dictionaryService |
protected org.alfresco.sync.events.EventRegistry |
eventRegistry |
protected FileFolderService |
fileFolderService |
protected HiddenAspect |
hiddenAspect |
protected Set<String> |
includeEventTypes |
protected Set<org.alfresco.service.namespace.QName> |
matchingTypes |
protected org.alfresco.service.namespace.NamespaceService |
namespaceService |
protected org.alfresco.service.cmr.repository.NodeService |
nodeService |
protected org.alfresco.service.cmr.security.PermissionService |
permissionService |
protected boolean |
sendEventsBeforeCommit |
protected SiteService |
siteService |
protected static String |
TRANSACTION_HAS_EVENTS |
protected TransactionService |
transactionService |
| Constructor and Description |
|---|
AbstractEventsService() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterCommit()
Invoked after transaction commit.
|
void |
afterRollback()
Invoked after transaction rollback.
|
void |
beforeCommit(boolean readOnly)
Called before a transaction is committed.
|
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 |
protected org.alfresco.sync.repo.Client |
getAlfrescoClient(org.alfresco.sync.repo.Client knownClientType) |
protected List<List<String>> |
getNodeIds(List<org.alfresco.service.cmr.repository.Path> nodePaths)
For each path, construct a list of ancestor node ids starting with the leaf path element node id first.
|
protected List<List<String>> |
getNodeIdsFromParent(List<org.alfresco.service.cmr.repository.Path> nodePaths)
For each path, construct a list of ancestor node ids starting with the parent node id first.
|
protected AbstractEventsService.NodeInfo |
getNodeInfo(org.alfresco.service.cmr.repository.NodeRef nodeRef,
String eventType) |
protected List<String> |
getPaths(List<org.alfresco.service.cmr.repository.Path> nodePaths,
List<String> toAppend) |
protected org.alfresco.repo.events.AbstractEventsService.TxnEvents |
getTxnEvents() |
protected boolean |
includeEventType(String eventType) |
void |
init() |
protected long |
nextSequenceNumber() |
protected void |
retrieveAdditionalProps(Map<String,Serializable> properties,
org.alfresco.service.cmr.repository.NodeRef nodeRef)
Extract additional information for the provided node
|
void |
sendEvent(org.alfresco.sync.events.types.Event event)
Register the event to be sent to a message producer once the transaction is over
|
void |
setCociService(CheckOutCheckInService cociService) |
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) |
void |
setEventRegistry(org.alfresco.sync.events.EventRegistry eventRegistry) |
void |
setFileFolderService(FileFolderService fileFolderService) |
void |
setHiddenAspect(HiddenAspect hiddenAspect) |
void |
setIncludeEventTypes(String includeEventTypesStr) |
void |
setMessageProducer(org.gytheio.messaging.MessageProducer messageProducer) |
void |
setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService) |
void |
setSendEventsBeforeCommit(boolean sendEventsBeforeCommit) |
void |
setSiteService(SiteService siteService) |
void |
setTransactionService(TransactionService transactionService) |
protected boolean |
shouldSendCommitEvent()
Determines whether it still makes sense to create and send a TransactionCommittedEvent after the transaction is committed.
|
beforeCompletion, flushprotected static final String TRANSACTION_HAS_EVENTS
protected CheckOutCheckInService cociService
protected SiteService siteService
protected org.alfresco.service.cmr.repository.NodeService nodeService
protected org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
protected org.alfresco.service.namespace.NamespaceService namespaceService
protected org.alfresco.service.cmr.security.PermissionService permissionService
protected HiddenAspect hiddenAspect
protected org.alfresco.sync.events.EventRegistry eventRegistry
protected FileFolderService fileFolderService
protected TransactionService transactionService
protected Set<org.alfresco.service.namespace.QName> matchingTypes
protected boolean sendEventsBeforeCommit
public void setCociService(CheckOutCheckInService cociService)
public void setHiddenAspect(HiddenAspect hiddenAspect)
public void setSendEventsBeforeCommit(boolean sendEventsBeforeCommit)
public void setTransactionService(TransactionService transactionService)
public void setIncludeEventTypes(String includeEventTypesStr)
public void setFileFolderService(FileFolderService fileFolderService)
public void setEventRegistry(org.alfresco.sync.events.EventRegistry eventRegistry)
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
public void setMessageProducer(org.gytheio.messaging.MessageProducer messageProducer)
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setSiteService(SiteService siteService)
public void init()
protected long nextSequenceNumber()
public void beforeCommit(boolean readOnly)
TransactionListenerAdapterAll transaction resources are still available.
beforeCommit in interface org.alfresco.util.transaction.TransactionListenerbeforeCommit in class TransactionListenerAdapterreadOnly - true if the transaction is read-onlyprotected org.alfresco.sync.repo.Client getAlfrescoClient(org.alfresco.sync.repo.Client knownClientType)
public void afterCommit()
TransactionListenerAdapterAny 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.
afterCommit in interface org.alfresco.util.transaction.TransactionListenerafterCommit in class TransactionListenerAdapterprotected boolean shouldSendCommitEvent()
protected List<org.alfresco.sync.events.types.Event> filterEventsBeforeSend(List<org.alfresco.sync.events.types.Event> events)
MessageProducerevents - the events to be filteredpublic void afterRollback()
TransactionListenerAdapterAny 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.
afterRollback in interface org.alfresco.util.transaction.TransactionListenerafterRollback in class TransactionListenerAdapterprotected boolean includeEventType(String eventType)
protected void retrieveAdditionalProps(Map<String,Serializable> properties, org.alfresco.service.cmr.repository.NodeRef nodeRef)
properties - the properties map to add the new info tonodeRef - the node to extract the property fromprotected List<String> getPaths(List<org.alfresco.service.cmr.repository.Path> nodePaths, List<String> toAppend)
protected List<List<String>> getNodeIdsFromParent(List<org.alfresco.service.cmr.repository.Path> nodePaths)
nodePaths - protected List<List<String>> getNodeIds(List<org.alfresco.service.cmr.repository.Path> nodePaths)
nodePaths - protected org.alfresco.repo.events.AbstractEventsService.TxnEvents getTxnEvents()
public void sendEvent(org.alfresco.sync.events.types.Event event)
event - event to be sentprotected AbstractEventsService.NodeInfo getNodeInfo(org.alfresco.service.cmr.repository.NodeRef nodeRef, String eventType)
Copyright © 2005–2018 Alfresco Software. All rights reserved.