Class DefaultIndexNotificationService
java.lang.Object
com.broadleafcommerce.sandbox.messaging.completion.DefaultIndexNotificationService
- All Implemented Interfaces:
IndexNotificationService
Default implementation of
IndexNotificationService
- Author:
- Jeff Fischer
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultIndexNotificationService
(IndexNotificationProperties properties, ChangeSummaryService<ChangeSummary> summaryService, ChangeSummaryRepository<?> repository, com.broadleafcommerce.common.messaging.notification.MessageSerializationHelper helper, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, com.broadleafcommerce.common.extension.data.DataRouteSupporting route, com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?, ?> lockRepository) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
assess
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, boolean isDeploy, boolean isRevert, String previousState, String previousStatus, String targetState) Assess the status of the transition and process records if applicableprotected void
cleanup
(boolean isRevert, com.broadleafcommerce.data.tracking.core.Identifiable entity, boolean isApplicationLevel) Review a ChangeSummary that was skipped, or was not indexable, for any cleanup operations to perform.void
compileAndNotify
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Handle the compilation and notification to the search indexer for the completion.protected void
process
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, boolean isRevert, String targetState, List<String> requestedIds, com.broadleafcommerce.data.tracking.core.Identifiable summary, boolean isComplete, int count) Process records based on assessment status
-
Constructor Details
-
DefaultIndexNotificationService
public DefaultIndexNotificationService(IndexNotificationProperties properties, ChangeSummaryService<ChangeSummary> summaryService, ChangeSummaryRepository<?> repository, com.broadleafcommerce.common.messaging.notification.MessageSerializationHelper helper, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, com.broadleafcommerce.common.extension.data.DataRouteSupporting route, com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?, ?> lockRepository)
-
-
Method Details
-
compileAndNotify
@Async("sandboxIndexThreadPoolTaskExecutor") public void compileAndNotify(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Description copied from interface:IndexNotificationService
Handle the compilation and notification to the search indexer for the completion.- Specified by:
compileAndNotify
in interfaceIndexNotificationService
- Parameters:
completion
- The completion of transition for a singleChangeSummary
-
assess
protected void assess(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, boolean isDeploy, boolean isRevert, String previousState, String previousStatus, String targetState) Assess the status of the transition and process records if applicable- Parameters:
completion
- The completion for a single change summaryisDeploy
- Whether or not this is a deploy transitionisRevert
- Whether or not this is a revert transitionpreviousState
- The state of the change summary before the transition (ChangeState
)previousStatus
- The status of the change summary before the transition (ChangeStatusType
)targetState
- The state of the change summary after the transition (ChangeState
)
-
process
protected void process(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, boolean isRevert, String targetState, List<String> requestedIds, com.broadleafcommerce.data.tracking.core.Identifiable summary, boolean isComplete, int count) Process records based on assessment status- Parameters:
completion
- The completion for a single change summaryisRevert
- Whether or not this is a revert transitiontargetState
- The state of the change summary after the transition (ChangeState
)requestedIds
- All the summary ids included in the transitionsummary
- TheChangeSummary
instance for this completionisComplete
- Whether or not all summaries for the transition have completedcount
- The maximum number of records that should be processed. -1 indicates no limit.
-
cleanup
protected void cleanup(boolean isRevert, com.broadleafcommerce.data.tracking.core.Identifiable entity, boolean isApplicationLevel) Review a ChangeSummary that was skipped, or was not indexable, for any cleanup operations to perform.- Parameters:
isRevert
- Whether or not this is a revert transitionentity
- The repository entity instance for this completionisApplicationLevel
- Whether or not the summary represents a change made in an application context (rather than global)
-