Interface CollectedEntityContributor

All Superinterfaces:
org.springframework.core.Ordered
All Known Implementing Classes:
InventoryEntityContributor, PricingEntityContributor, RatingsReviewsEntityContributor

public interface CollectedEntityContributor extends org.springframework.core.Ordered
Components to allow implementors to decorate additional data on CollectedEntities. For example, we might fetch products from the CatalogService, but those products may need to be additionally decorated with inventory details, dynamic pricing details, ratings and reviews, etc. Data is received in batches which makes batch querying easier.
Author:
Kelly Tisdell (ktisdell)
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canHandle(@NonNull Class<?> entityType, @NonNull DataFeedCollectionRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Indicates if this CollectedEntityContributor can handle the given batch of collected entities.
    void
    contribute(@NonNull List<? extends CollectedEntity<?>> entities, @NonNull DataFeedCollectionRequest request, @NonNull Map<String,Object> processState, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    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.
    default int
     
  • Method Details

    • canHandle

      boolean canHandle(@NonNull @NonNull Class<?> entityType, @NonNull @NonNull DataFeedCollectionRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Indicates if this CollectedEntityContributor can handle the given batch of collected entities.
      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

      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)
      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.
      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
    • getOrder

      default int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered