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 TypeMethodDescriptionboolean
canHandle
(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>
void
handle
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, String deployId) Responsible for any follow-up actions (like cleaning upChangeSummary
states/statuses) required after external microservices have met their responsibilities for a sandbox workflow transition triggered by aTransitionRequest
.protected void
recordDeploymentErrors
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, String deployId) Locks and records the exception encountered for a failed deployment onto theChangeDeploy
indicated by theWorkflowRequestCompletion
and updates its status toChangeStatusType.ERROR_DEPLOY
.protected void
recordGroupDeploymentError
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Records the exception encountered for a failed deployment onto theChangeSummaryGroup
indicated by theWorkflowRequestCompletion
and updates its status toChangeStatusType.ERROR_DEPLOY
.protected void
recordSummaryDeploymentError
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Records the exception encountered for a failed deployment onto theChangeSummary
indicated by theWorkflowRequestCompletion
and 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:WorkflowRequestErrorHandler
Determines if this handler can handle the givenWorkflowRequestCompletion
. This is typically done by checking theWorkflowRequestCompletion.getRequestType()
.- Specified by:
canHandle
in interfaceWorkflowRequestErrorHandler
- Parameters:
completion
- aWorkflowRequestCompletion
received over theWorkflowRequestCompletionConsumer channel
or 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:WorkflowRequestErrorHandler
Responsible for any follow-up actions (like cleaning upChangeSummary
states/statuses) required after external microservices have met their responsibilities for a sandbox workflow transition triggered by aTransitionRequest
.- Specified by:
handle
in interfaceWorkflowRequestErrorHandler
- Parameters:
completion
- aWorkflowRequestCompletion
received over theWorkflowRequestCompletionConsumer channel
or manually fromTransitionErrorEndpoint
deployId
- 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 theChangeSummary
indicated by theWorkflowRequestCompletion
and updates its status toChangeStatusType.ERROR_DEPLOY
.- Parameters:
completion
- TheWorkflowRequestCompletion
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 theChangeSummaryGroup
indicated by theWorkflowRequestCompletion
and updates its status toChangeStatusType.ERROR_DEPLOY
.- Parameters:
completion
- TheWorkflowRequestCompletion
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 theChangeDeploy
indicated by theWorkflowRequestCompletion
and updates its status toChangeStatusType.ERROR_DEPLOY
.- Parameters:
completion
- TheWorkflowRequestCompletion
indicating theChangeDeploy
that 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
-