Class DeploymentJobUnschedulingRequestListener

java.lang.Object
com.broadleafcommerce.scheduledjob.messaging.transition.DeploymentJobUnschedulingRequestListener
All Implemented Interfaces:
TrackingWorkflowJobUnschedulingRequestListener

public class DeploymentJobUnschedulingRequestListener extends Object implements TrackingWorkflowJobUnschedulingRequestListener
This handler specializes in WorkflowJobUnschedulingRequests and is the main component that listens for the sandbox service to send it a request to cancel a previously scheduled deployment job.
Author:
Samarth Dhruva (samarthd)
  • Constructor Summary

    Constructors
    Constructor
    Description
    DeploymentJobUnschedulingRequestListener(ScheduledJobService<ScheduledJob> scheduledJobService, com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletionNotifier completionNotifier, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, ScheduledJobRepository<com.broadleafcommerce.data.tracking.core.Trackable> scheduledJobRepository, com.broadleafcommerce.common.extension.data.DataRouteSupporting route, com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doHandle(@NonNull org.springframework.messaging.Message<com.broadleafcommerce.data.tracking.core.transition.WorkflowJobUnschedulingRequest> message)
     
    void
    handle(org.springframework.messaging.Message<com.broadleafcommerce.data.tracking.core.transition.WorkflowJobUnschedulingRequest> message)
    First, this method finds the scheduled job whose details match the given request.

    Methods inherited from class java.lang.Object

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

    • DeploymentJobUnschedulingRequestListener

      public DeploymentJobUnschedulingRequestListener(ScheduledJobService<ScheduledJob> scheduledJobService, com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletionNotifier completionNotifier, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, ScheduledJobRepository<com.broadleafcommerce.data.tracking.core.Trackable> scheduledJobRepository, com.broadleafcommerce.common.extension.data.DataRouteSupporting route, com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService)
  • Method Details

    • handle

      @StreamListener("unscheduleDeploymentInput") public void handle(org.springframework.messaging.Message<com.broadleafcommerce.data.tracking.core.transition.WorkflowJobUnschedulingRequest> message)
      First, this method finds the scheduled job whose details match the given request. If found, that job's notification state container for WorkflowRequestCompletionProducer.TYPE is reset. This ensures that state set by other WorkflowRequestCompletionProducer.TYPE events is wiped and cannot interfere with the unschedule flow.

      After that, the job is deleted and a WorkflowRequestCompletion event is emitted.

      Specified by:
      handle in interface TrackingWorkflowJobUnschedulingRequestListener
      Parameters:
      message - a message of an unscheduling request with info needed to unschedule a previously scheduled deployment job
    • doHandle

      protected void doHandle(@NonNull @NonNull org.springframework.messaging.Message<com.broadleafcommerce.data.tracking.core.transition.WorkflowJobUnschedulingRequest> message)