Class ReversionWorkflowRequestCompletionHandler
java.lang.Object
com.broadleafcommerce.sandbox.messaging.completion.ReversionWorkflowRequestCompletionHandler
- All Implemented Interfaces:
WorkflowRequestCompletionHandler
public class ReversionWorkflowRequestCompletionHandler
extends Object
implements WorkflowRequestCompletionHandler
-
Constructor Summary
ConstructorsConstructorDescriptionReversionWorkflowRequestCompletionHandler
(ChangeSummaryService<ChangeSummary> summaryService, ReversionWorkflowRequestErrorHandler errorHandler, IndexNotificationService indexNotificationService) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canHandle
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Determines if this handler can handle the givenWorkflowRequestCompletion
.void
finishReversion
(String changeSummaryId) protected ReversionWorkflowRequestErrorHandler
protected IndexNotificationService
protected SandboxService<Sandbox>
protected ChangeSummaryService<ChangeSummary>
void
handle
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Gleans the ID of theChangeSummary
for which a reversion was requested and archives it if the microservice reports a successful reversion.void
setProperties
(CompletionCleanupProperties properties) void
setSandboxService
(SandboxService<Sandbox> sandboxService)
-
Constructor Details
-
ReversionWorkflowRequestCompletionHandler
public ReversionWorkflowRequestCompletionHandler(ChangeSummaryService<ChangeSummary> summaryService, ReversionWorkflowRequestErrorHandler errorHandler, IndexNotificationService indexNotificationService)
-
-
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) Gleans the ID of theChangeSummary
for which a reversion was requested and archives it if the microservice reports a successful reversion. If the microservice is reporting a error during the reversion, then the summary's status is changed toChangeStatusType.ERROR_REVERT
and the error trace is added to it.- Specified by:
handle
in interfaceWorkflowRequestCompletionHandler
- Parameters:
completion
- aWorkflowRequestCompletion
received over theWorkflowRequestCompletionConsumer channel
containing information about the revertedChangeSummary
.
-
finishReversion
-
getSummaryService
-
getErrorHandler
-
getIndexNotificationService
-
getSandboxService
-
setSandboxService
-
setProperties
-