Class DefaultIndexNotificationService

java.lang.Object
com.broadleafcommerce.dataimport.service.DefaultIndexNotificationService
All Implemented Interfaces:
IndexNotificationService

public class DefaultIndexNotificationService extends Object implements IndexNotificationService
Default instance of IndexNotificationService
Author:
Jeff Fischer
  • Field Details

  • Constructor Details

  • 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 interface IndexNotificationService
      Parameters:
      batchCompletion - The batch of completed items
    • process

      protected void process(Import importEntity, com.broadleafcommerce.common.dataimport.messaging.BatchCompletion batchCompletion)
    • determineBatchIndexableType

      @Nullable protected String determineBatchIndexableType(Import importEntity)
      Determines the batch indexable type to use for this import (if any). Leverages ImportBatchIndexableTypeMapping 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 the BatchItemCompletion instances for the given BatchCompletion, and initializes/emits the BatchIndexRequest message for the entity IDs that should be reindexed.
      Parameters:
      importId - ID of the import entity for which the batch completion is being processed
      batchCompletion - the batch completion for which to emit a batch index request
      batchIndexableType - 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.
      Parameters:
      importId - ID of the import entity for which the batch completion is being processed
      batchCompletion - the batch completion to process indexing for
      indexableType - 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 the ImportBatchIndexableTypeMapping concept. Please see the javadocs of that for more information.
      Finds the matching BatchIndexableType value for the given type string.
      Parameters:
      type - the type string for which to find the matching BatchIndexableType value
      Returns:
      the matching BatchIndexableType value if found, null otherwise
    • getBatchIndexableTypeMappings

      protected List<ImportBatchIndexableTypeMapping> getBatchIndexableTypeMappings()