Class EventHandler

java.lang.Object
org.saidone.component.BaseComponent
org.saidone.behaviour.EventHandler
All Implemented Interfaces:
org.alfresco.event.sdk.handling.handler.EventHandler, org.alfresco.event.sdk.handling.handler.NodeEventHandler, org.alfresco.event.sdk.handling.handler.OnNodeCreatedEventHandler, org.alfresco.event.sdk.handling.handler.OnNodeUpdatedEventHandler, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Component @ConditionalOnProperty(name="application.event-handler.enabled", havingValue="true") public class EventHandler extends BaseComponent implements org.alfresco.event.sdk.handling.handler.OnNodeCreatedEventHandler, org.alfresco.event.sdk.handling.handler.OnNodeUpdatedEventHandler
Handles Alfresco repository events for archiving nodes when certain criteria are met.

This component listens to node-related events via the Alfresco Event SDK and triggers node archiving using the configured VaultService. Event handling is conditional, allowing activation through application properties.

Events are filtered based on: - Node type (must match AlfrescoContentModel.TYPE_CONTENT), - Presence of a specific archive aspect, - Whether the node has been processed recently (using a configurable threshold to avoid duplicate processing).

When an event passes the filters, the handler will archive the targeted node and log the operation outcome. Any errors during archiving are also logged.

Activation of this handler depends on the application.event-handler.enabled property.

See Also:
  • Constructor Details

    • EventHandler

      public EventHandler()
  • Method Details

    • handleEvent

      public void handleEvent(org.alfresco.repo.event.v1.model.RepoEvent<org.alfresco.repo.event.v1.model.DataAttributes<org.alfresco.repo.event.v1.model.Resource>> event)
      Specified by:
      handleEvent in interface org.alfresco.event.sdk.handling.handler.EventHandler
    • getEventFilter

      public org.alfresco.event.sdk.handling.filter.EventFilter getEventFilter()
      Specified by:
      getEventFilter in interface org.alfresco.event.sdk.handling.handler.EventHandler
    • getHandledEventTypes

      public Set<org.alfresco.repo.event.v1.model.EventType> getHandledEventTypes()
      Specified by:
      getHandledEventTypes in interface org.alfresco.event.sdk.handling.handler.EventHandler
      Specified by:
      getHandledEventTypes in interface org.alfresco.event.sdk.handling.handler.OnNodeCreatedEventHandler
      Specified by:
      getHandledEventTypes in interface org.alfresco.event.sdk.handling.handler.OnNodeUpdatedEventHandler