Class DefaultIndexNotificationService
java.lang.Object
com.broadleafcommerce.dataimport.service.DefaultIndexNotificationService
- All Implemented Interfaces:
IndexNotificationService
Default instance of
IndexNotificationService
- Author:
- Jeff Fischer
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultIndexNotificationService
(ImportService<Import> importService, BatchItemCompletionService<BatchItemCompletion> batchItemCompletionService, ImportBatchItemCompletionRepository<?> repository, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, com.broadleafcommerce.common.extension.data.DataRouteSupporting route) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
collectItemCompletionsAndNotify
(@NonNull String importId, @NonNull com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion, @NonNull String batchIndexableType) Finds theBatchItemCompletion
instances for the givenBatchCompletion
, and initializes/emits theBatchIndexRequest
message for the entity IDs that should be reindexed.void
compileAndNotify
(com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion) Handle the compilation and notification to the search indexer for the batch completion.protected String
determineBatchIndexableType
(Import importEntity) Determines the batch indexable type to use for this import (if any).protected List<ImportBatchIndexableTypeMapping>
protected com.broadleafcommerce.data.tracking.core.messaging.search.BatchIndexableType
Deprecated, for removal: This API element is subject to removal in a future version.protected void
process
(Import importEntity, com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion) protected void
process
(String importId, com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion, com.broadleafcommerce.data.tracking.core.messaging.search.BatchIndexableType indexableType) Deprecated, for removal: This API element is subject to removal in a future version.this is replaced bycollectItemCompletionsAndNotify(String, BatchCompletion, String)
void
setBatchIndexableTypeMappings
(List<ImportBatchIndexableTypeMapping> batchIndexableTypeMappings)
-
Field Details
-
INDEX_BATCH_COMPLETION_CONCEPT_KEY
- See Also:
-
-
Constructor Details
-
DefaultIndexNotificationService
public DefaultIndexNotificationService(ImportService<Import> importService, BatchItemCompletionService<BatchItemCompletion> batchItemCompletionService, ImportBatchItemCompletionRepository<?> repository, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, com.broadleafcommerce.common.extension.data.DataRouteSupporting route)
-
-
Method Details
-
setBatchIndexableTypeMappings
@Autowired public void setBatchIndexableTypeMappings(@Nullable List<ImportBatchIndexableTypeMapping> batchIndexableTypeMappings) -
compileAndNotify
public void compileAndNotify(com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion) Description copied from interface:IndexNotificationService
Handle the compilation and notification to the search indexer for the batch completion.- Specified by:
compileAndNotify
in interfaceIndexNotificationService
- Parameters:
batchCompletion
- The batch of completed items
-
process
protected void process(Import importEntity, com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion) -
determineBatchIndexableType
Determines the batch indexable type to use for this import (if any). LeveragesImportBatchIndexableTypeMapping
and uses the result of the first implementation to return a value.- Parameters:
importEntity
- the import entity to determine the batch indexable type for- Returns:
- the batch indexable type to use for this import, or
null
if no batch indexable type could be determined
-
collectItemCompletionsAndNotify
protected void collectItemCompletionsAndNotify(@NonNull @NonNull String importId, @NonNull @NonNull com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion, @NonNull @NonNull String batchIndexableType) Finds theBatchItemCompletion
instances for the givenBatchCompletion
, and initializes/emits theBatchIndexRequest
message for the entity IDs that should be reindexed.- Parameters:
importId
- ID of the import entity for which the batch completion is being processedbatchCompletion
- the batch completion for which to emit a batch index requestbatchIndexableType
- the batch indexable type to set on the batch index request message
-
process
@Deprecated(since="1.8.2", forRemoval=true) protected void process(String importId, com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion, com.broadleafcommerce.data.tracking.core.messaging.search.BatchIndexableType indexableType) Deprecated, for removal: This API element is subject to removal in a future version.this is replaced bycollectItemCompletionsAndNotify(String, BatchCompletion, String)
- Parameters:
importId
- ID of the import entity for which the batch completion is being processedbatchCompletion
- the batch completion to process indexing forindexableType
- the indexable type appropriate for the import
-
indexType
@Nullable @Deprecated(since="1.8.2", forRemoval=true) protected com.broadleafcommerce.data.tracking.core.messaging.search.BatchIndexableType indexType(String type) Deprecated, for removal: This API element is subject to removal in a future version.this method has been replaced with theImportBatchIndexableTypeMapping
concept. Please see the javadocs of that for more information.Finds the matchingBatchIndexableType
value for the given type string.- Parameters:
type
- the type string for which to find the matchingBatchIndexableType
value- Returns:
- the matching
BatchIndexableType
value if found,null
otherwise
-
getBatchIndexableTypeMappings
-
ImportBatchIndexableTypeMapping
concept.