Class DefaultIndexNotificationService

java.lang.Object
com.broadleafcommerce.sandbox.messaging.completion.DefaultIndexNotificationService
All Implemented Interfaces:
IndexNotificationService

public class DefaultIndexNotificationService extends Object implements IndexNotificationService
Default implementation of IndexNotificationService
Author:
Jeff Fischer
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultIndexNotificationService(IndexNotificationProperties properties, ChangeSummaryService<ChangeSummary> summaryService, ChangeSummaryRepository<?> repository, com.broadleafcommerce.common.messaging.notification.MessageSerializationHelper helper, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, com.broadleafcommerce.common.extension.data.DataRouteSupporting route, com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?,?> lockRepository)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    assess(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, boolean isDeploy, boolean isRevert, String previousState, String previousStatus, String targetState)
    Assess the status of the transition and process records if applicable
    protected void
    cleanup(boolean isRevert, com.broadleafcommerce.data.tracking.core.Identifiable entity, boolean isApplicationLevel)
    Review a ChangeSummary that was skipped, or was not indexable, for any cleanup operations to perform.
    void
    compileAndNotify(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion)
    Handle the compilation and notification to the search indexer for the completion.
    protected void
    process(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, boolean isRevert, String targetState, List<String> requestedIds, com.broadleafcommerce.data.tracking.core.Identifiable summary, boolean isComplete, int count)
    Process records based on assessment status

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultIndexNotificationService

      public DefaultIndexNotificationService(IndexNotificationProperties properties, ChangeSummaryService<ChangeSummary> summaryService, ChangeSummaryRepository<?> repository, com.broadleafcommerce.common.messaging.notification.MessageSerializationHelper helper, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, com.broadleafcommerce.common.extension.data.DataRouteSupporting route, com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?,?> lockRepository)
  • Method Details

    • compileAndNotify

      @Async("sandboxIndexThreadPoolTaskExecutor") public void compileAndNotify(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion)
      Description copied from interface: IndexNotificationService
      Handle the compilation and notification to the search indexer for the completion.
      Specified by:
      compileAndNotify in interface IndexNotificationService
      Parameters:
      completion - The completion of transition for a single ChangeSummary
    • assess

      protected void assess(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, boolean isDeploy, boolean isRevert, String previousState, String previousStatus, String targetState)
      Assess the status of the transition and process records if applicable
      Parameters:
      completion - The completion for a single change summary
      isDeploy - Whether or not this is a deploy transition
      isRevert - Whether or not this is a revert transition
      previousState - The state of the change summary before the transition (ChangeState)
      previousStatus - The status of the change summary before the transition (ChangeStatusType)
      targetState - The state of the change summary after the transition (ChangeState)
    • process

      protected void process(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, boolean isRevert, String targetState, List<String> requestedIds, com.broadleafcommerce.data.tracking.core.Identifiable summary, boolean isComplete, int count)
      Process records based on assessment status
      Parameters:
      completion - The completion for a single change summary
      isRevert - Whether or not this is a revert transition
      targetState - The state of the change summary after the transition (ChangeState)
      requestedIds - All the summary ids included in the transition
      summary - The ChangeSummary instance for this completion
      isComplete - Whether or not all summaries for the transition have completed
      count - The maximum number of records that should be processed. -1 indicates no limit.
    • cleanup

      protected void cleanup(boolean isRevert, com.broadleafcommerce.data.tracking.core.Identifiable entity, boolean isApplicationLevel)
      Review a ChangeSummary that was skipped, or was not indexable, for any cleanup operations to perform.
      Parameters:
      isRevert - Whether or not this is a revert transition
      entity - The repository entity instance for this completion
      isApplicationLevel - Whether or not the summary represents a change made in an application context (rather than global)