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 TypeMethodDescriptionbooleancanHandle(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Determines if this handler can handle the givenWorkflowRequestCompletion.voidhandle(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Retrieves theChangeDeployfor which to complete the unscheduling process and whether the microservice sending thecompletion messageencountered 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:WorkflowRequestCompletionHandlerDetermines if this handler can handle the givenWorkflowRequestCompletion. This is typically done by checking theWorkflowRequestCompletion.getRequestType().- Specified by:
canHandlein interfaceWorkflowRequestCompletionHandler- Parameters:
completion- aWorkflowRequestCompletionreceived 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 theChangeDeployfor which to complete the unscheduling process and whether the microservice sending thecompletion messageencountered errors while performing the scheduling. The states of the deployment, groups, and summaries are all reset toChangeState.APPROVEDIf errors were encountered, the statuses of the groups, summaries, and deployment are updated to
ChangeStatusType.ERROR_UNSCHEDULEand the error stack trace is recorded onto them.- Specified by:
handlein interfaceWorkflowRequestCompletionHandler- Parameters:
completion- aWorkflowRequestCompletionreceived over theWorkflowRequestCompletionConsumer channelcontaining information about the unscheduledChangeDeploy- Throws:
IllegalArgumentException- if the given deployment is invalidIllegalStateException- if there were errors experienced in performing the updates
-