Class InventoryEntityContributor

java.lang.Object
com.broadleafcommerce.datafeed.service.collector.product.InventoryEntityContributor
All Implemented Interfaces:
CollectedEntityContributor, org.springframework.core.Ordered

public class InventoryEntityContributor extends Object implements CollectedEntityContributor
Contributes Inventory data to the Products that are collected for a Data Feed.
Author:
Kelly Tisdell (ktisdell)
  • Constructor Details

  • Method Details

    • canHandle

      public boolean canHandle(@NonNull @NonNull Class<?> entityType, @NonNull @NonNull DataFeedCollectionRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CollectedEntityContributor
      Indicates if this CollectedEntityContributor can handle the given batch of collected entities.
      Specified by:
      canHandle in interface CollectedEntityContributor
      Parameters:
      entityType - the class that represents the batch of items to receive contributions
      request - the original request
      contextInfo - the context info associated with this process
      Returns:
    • contribute

      public void contribute(@NonNull @NonNull List<? extends CollectedEntity<?>> entities, @NonNull @NonNull DataFeedCollectionRequest request, @NonNull @NonNull Map<String,Object> processState, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CollectedEntityContributor
      Hook point to allow the augmentation or decoration of a batch of entities that have been fetched, but that may need additional data from other sources.
      Specified by:
      contribute in interface CollectedEntityContributor
      Parameters:
      entities - the List of entities that may require contributions
      request - the original request
      processState - A Map of shared context for storing details of the collection process - expected to be thread-safe
      contextInfo - the context info associated with this process
    • parseSkusForProduct

      protected Set<String> parseSkusForProduct(CollectedProduct product)
    • getExternalInventoryProvider

      protected InventoryProvider getExternalInventoryProvider()
    • getObjectMapper

      protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
    • getCollectedProductJsonAccessorUtils

      protected CollectedProductJsonAccessorUtils getCollectedProductJsonAccessorUtils()