Class DataFeedMutationHandler

java.lang.Object
com.broadleafcommerce.data.tracking.jpa.datafeed.DataFeedMutationHandler
All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationListener<com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent>

public class DataFeedMutationHandler extends Object implements org.springframework.context.ApplicationListener<com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent>
Monitor MutationNotifyEvent occurrences for any entity types registered via DataFeedInspection bean instances. If detected and relevant, send a Spring Cloud Stream message via IncrementalDataFeedEntityUpdateEvent for subsequent data feed service processing.
  • Constructor Details

    • DataFeedMutationHandler

      public DataFeedMutationHandler(com.broadleafcommerce.common.messaging.notification.DetachedDurableMessageSender sender, @Nullable List<DataFeedInspection<? extends com.broadleafcommerce.data.tracking.core.Trackable>> inspections)
  • Method Details

    • onApplicationEvent

      public void onApplicationEvent(com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<com.broadleafcommerce.data.tracking.core.service.MutationNotifyEvent>
    • sendEvent

      public void sendEvent(Object event, @Nullable String dataRoute)
      Send a generic pojo as an event message on the incremental data feed update channel. Should generally relate to the fields and structure of IncrementalDataFeedEntityUpdateEvent from the data feed service version being used.
      Parameters:
      event - The generic pojo to send
      dataRoute - The data route on which to persist the durable state of the message. Optional if a route is already established on the current flow.