Class DefaultIndexNotificationService
java.lang.Object
com.broadleafcommerce.dataimport.service.DefaultIndexNotificationService
- All Implemented Interfaces:
IndexNotificationService
Default instance of
IndexNotificationService- Author:
- Jeff Fischer
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultIndexNotificationService(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 voidcollectItemCompletionsAndNotify(@NonNull String importId, @NonNull com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion, @NonNull String batchIndexableType) Finds theBatchItemCompletioninstances for the givenBatchCompletion, and initializes/emits theBatchIndexRequestmessage for the entity IDs that should be reindexed.voidcompileAndNotify(com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion) Handle the compilation and notification to the search indexer for the batch completion.protected StringdetermineBatchIndexableType(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.BatchIndexableTypeDeprecated, for removal: This API element is subject to removal in a future version.protected voidprocess(Import importEntity, com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion) protected voidprocess(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)voidsetBatchIndexableTypeMappings(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:IndexNotificationServiceHandle the compilation and notification to the search indexer for the batch completion.- Specified by:
compileAndNotifyin 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). LeveragesImportBatchIndexableTypeMappingand 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
nullif 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 theBatchItemCompletioninstances for the givenBatchCompletion, and initializes/emits theBatchIndexRequestmessage 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 theImportBatchIndexableTypeMappingconcept. Please see the javadocs of that for more information.Finds the matchingBatchIndexableTypevalue for the given type string.- Parameters:
type- the type string for which to find the matchingBatchIndexableTypevalue- Returns:
- the matching
BatchIndexableTypevalue if found,nullotherwise
-
getBatchIndexableTypeMappings
-
ImportBatchIndexableTypeMappingconcept.