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 Summary
ConstructorsConstructorDescriptionDeploymentWorkflowRequestErrorHandler(ChangeSummaryService<ChangeSummary> summaryService, ChangeSummaryGroupService<ChangeSummaryGroup> groupService, ChangeDeployService<ChangeDeploy> changeDeployService) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Determines if this handler can handle the givenWorkflowRequestCompletion.protected ChangeDeployService<ChangeDeploy>protected ChangeSummaryGroupService<ChangeSummaryGroup>protected ChangeSummaryService<ChangeSummary>voidhandle(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, String deployId) Responsible for any follow-up actions (like cleaning upChangeSummarystates/statuses) required after external microservices have met their responsibilities for a sandbox workflow transition triggered by aTransitionRequest.protected voidrecordDeploymentErrors(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, String deployId) Locks and records the exception encountered for a failed deployment onto theChangeDeployindicated by theWorkflowRequestCompletionand updates its status toChangeStatusType.ERROR_DEPLOY.protected voidrecordGroupDeploymentError(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Records the exception encountered for a failed deployment onto theChangeSummaryGroupindicated by theWorkflowRequestCompletionand updates its status toChangeStatusType.ERROR_DEPLOY.protected voidrecordSummaryDeploymentError(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Records the exception encountered for a failed deployment onto theChangeSummaryindicated by theWorkflowRequestCompletionand updates its status toChangeStatusType.ERROR_DEPLOY.
-
Constructor Details
-
DeploymentWorkflowRequestErrorHandler
public DeploymentWorkflowRequestErrorHandler(ChangeSummaryService<ChangeSummary> summaryService, ChangeSummaryGroupService<ChangeSummaryGroup> groupService, ChangeDeployService<ChangeDeploy> changeDeployService)
-
-
Method Details
-
canHandle
public boolean canHandle(@NonNull com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Description copied from interface:WorkflowRequestErrorHandlerDetermines if this handler can handle the givenWorkflowRequestCompletion. This is typically done by checking theWorkflowRequestCompletion.getRequestType().- Specified by:
canHandlein interfaceWorkflowRequestErrorHandler- Parameters:
completion- aWorkflowRequestCompletionreceived over theWorkflowRequestCompletionConsumer channelor manually fromTransitionErrorEndpoint- 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:WorkflowRequestErrorHandlerResponsible for any follow-up actions (like cleaning upChangeSummarystates/statuses) required after external microservices have met their responsibilities for a sandbox workflow transition triggered by aTransitionRequest.- Specified by:
handlein interfaceWorkflowRequestErrorHandler- Parameters:
completion- aWorkflowRequestCompletionreceived over theWorkflowRequestCompletionConsumer channelor manually fromTransitionErrorEndpointdeployId- the id of the top-most entity to handle the error, typically eitherChangeSummary,ChangeSummaryGroup, orChangeDeploy, depending on theWorkflowRequestCompletion.getRequestType()
-
recordSummaryDeploymentError
protected void recordSummaryDeploymentError(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Records the exception encountered for a failed deployment onto theChangeSummaryindicated by theWorkflowRequestCompletionand updates its status toChangeStatusType.ERROR_DEPLOY.- Parameters:
completion- TheWorkflowRequestCompletionindicating 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 theChangeSummaryGroupindicated by theWorkflowRequestCompletionand updates its status toChangeStatusType.ERROR_DEPLOY.- Parameters:
completion- TheWorkflowRequestCompletionindicating 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 theChangeDeployindicated by theWorkflowRequestCompletionand updates its status toChangeStatusType.ERROR_DEPLOY.- Parameters:
completion- TheWorkflowRequestCompletionindicating theChangeDeploythat encountered errors during deploymentdeployId- The ID of the deployment upon which to record errors- Throws:
QualifiedStateException- Thrown if the deployment encounters errors while being updated.
-
getSummaryService
-
getGroupService
-
getChangeDeployService
-