Class DeploymentJobUnschedulingRequestCompletionHandler
java.lang.Object
com.broadleafcommerce.sandbox.messaging.completion.DeploymentJobUnschedulingRequestCompletionHandler
- All Implemented Interfaces:
WorkflowRequestCompletionHandler
public class DeploymentJobUnschedulingRequestCompletionHandler
extends Object
implements WorkflowRequestCompletionHandler
This handler deals with updating the states and statuses of
ChangeDeploys
that have just finished being unscheduled.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ChangeDeployService<ChangeDeploy>
protected final ChangeSummaryGroupService<ChangeSummaryGroup>
protected final ChangeSummaryService<ChangeSummary>
-
Constructor Summary
ConstructorsConstructorDescriptionDeploymentJobUnschedulingRequestCompletionHandler
(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
.void
handle
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Retrieves theChangeDeploy
for which to complete the unscheduling process and whether the microservice sending thecompletion message
encountered errors while performing the scheduling.
-
Field Details
-
summaryService
-
groupService
-
changeDeployService
-
-
Constructor Details
-
DeploymentJobUnschedulingRequestCompletionHandler
public DeploymentJobUnschedulingRequestCompletionHandler(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:WorkflowRequestCompletionHandler
Determines if this handler can handle the givenWorkflowRequestCompletion
. This is typically done by checking theWorkflowRequestCompletion.getRequestType()
.- Specified by:
canHandle
in interfaceWorkflowRequestCompletionHandler
- Parameters:
completion
- aWorkflowRequestCompletion
received over theWorkflowRequestCompletionConsumer channel
- Returns:
- whether this handler can handle the given
WorkflowRequestCompletion
-
handle
public void handle(@NonNull com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Retrieves theChangeDeploy
for which to complete the unscheduling process and whether the microservice sending thecompletion message
encountered errors while performing the scheduling. The states of the deployment, groups, and summaries are all reset toChangeState.APPROVED
If errors were encountered, the statuses of the groups, summaries, and deployment are updated to
ChangeStatusType.ERROR_UNSCHEDULE
and the error stack trace is recorded onto them.- Specified by:
handle
in interfaceWorkflowRequestCompletionHandler
- Parameters:
completion
- aWorkflowRequestCompletion
received over theWorkflowRequestCompletionConsumer channel
containing information about the unscheduledChangeDeploy
- Throws:
IllegalArgumentException
- if the given deployment is invalidIllegalStateException
- if there were errors experienced in performing the updates
-