Class DeploymentWorkflowRequestErrorHandler

java.lang.Object
com.broadleafcommerce.sandbox.messaging.completion.error.DeploymentWorkflowRequestErrorHandler
All Implemented Interfaces:
WorkflowRequestErrorHandler

public class DeploymentWorkflowRequestErrorHandler extends Object implements WorkflowRequestErrorHandler
Author:
Chad Harchar (charchar)
  • Constructor Details

  • Method Details

    • canHandle

      public boolean canHandle(@NonNull com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion)
      Description copied from interface: WorkflowRequestErrorHandler
      Determines if this handler can handle the given WorkflowRequestCompletion. This is typically done by checking the WorkflowRequestCompletion.getRequestType().
      Specified by:
      canHandle in interface WorkflowRequestErrorHandler
      Parameters:
      completion - a WorkflowRequestCompletion received over the WorkflowRequestCompletionConsumer channel or manually from TransitionErrorEndpoint
      Returns:
      whether this handler can handle errors for the given WorkflowRequestCompletion
    • handle

      public void handle(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, String deployId)
      Description copied from interface: WorkflowRequestErrorHandler
      Responsible for any follow-up actions (like cleaning up ChangeSummary states/statuses) required after external microservices have met their responsibilities for a sandbox workflow transition triggered by a TransitionRequest.
      Specified by:
      handle in interface WorkflowRequestErrorHandler
      Parameters:
      completion - a WorkflowRequestCompletion received over the WorkflowRequestCompletionConsumer channel or manually from TransitionErrorEndpoint
      deployId - the id of the top-most entity to handle the error, typically either ChangeSummary, ChangeSummaryGroup, or ChangeDeploy, depending on the WorkflowRequestCompletion.getRequestType()
    • recordSummaryDeploymentError

      protected void recordSummaryDeploymentError(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion)
      Records the exception encountered for a failed deployment onto the ChangeSummary indicated by the WorkflowRequestCompletion and updates its status to ChangeStatusType.ERROR_DEPLOY.
      Parameters:
      completion - The WorkflowRequestCompletion indicating the summary that encountered errors while being deployed
      Throws:
      QualifiedStateException - Thrown if the summary encounters errors while being updated.
    • recordGroupDeploymentError

      protected void recordGroupDeploymentError(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion)
      Records the exception encountered for a failed deployment onto the ChangeSummaryGroup indicated by the WorkflowRequestCompletion and updates its status to ChangeStatusType.ERROR_DEPLOY.
      Parameters:
      completion - The WorkflowRequestCompletion indicating the group that encountered errors while being deployed
      Throws:
      QualifiedStateException - Thrown if the group encounters errors while being updated.
    • recordDeploymentErrors

      protected void recordDeploymentErrors(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, String deployId)
      Locks and records the exception encountered for a failed deployment onto the ChangeDeploy indicated by the WorkflowRequestCompletion and updates its status to ChangeStatusType.ERROR_DEPLOY.
      Parameters:
      completion - The WorkflowRequestCompletion indicating the ChangeDeploy that encountered errors during deployment
      deployId - The ID of the deployment upon which to record errors
      Throws:
      QualifiedStateException - Thrown if the deployment encounters errors while being updated.
    • getSummaryService

      protected ChangeSummaryService<ChangeSummary> getSummaryService()
    • getGroupService

      protected ChangeSummaryGroupService<ChangeSummaryGroup> getGroupService()
    • getChangeDeployService

      protected ChangeDeployService<ChangeDeploy> getChangeDeployService()