Class InventoryEntityContributor
java.lang.Object
com.broadleafcommerce.datafeed.service.collector.product.InventoryEntityContributor
- All Implemented Interfaces:
CollectedEntityContributor
,org.springframework.core.Ordered
Contributes Inventory data to the Products that are collected for a Data Feed.
- Author:
- Kelly Tisdell (ktisdell)
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionInventoryEntityContributor
(InventoryProvider externalInventoryProvider, com.fasterxml.jackson.databind.ObjectMapper objectMapper, CollectedProductJsonAccessorUtils collectedProductJsonAccessorUtils) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canHandle
(@NonNull Class<?> entityType, @NonNull DataFeedCollectionRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Indicates if thisCollectedEntityContributor
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.protected CollectedProductJsonAccessorUtils
protected InventoryProvider
protected com.fasterxml.jackson.databind.ObjectMapper
parseSkusForProduct
(CollectedProduct product) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.datafeed.service.collector.CollectedEntityContributor
getOrder
-
Constructor Details
-
InventoryEntityContributor
public InventoryEntityContributor(InventoryProvider externalInventoryProvider, com.fasterxml.jackson.databind.ObjectMapper objectMapper, CollectedProductJsonAccessorUtils collectedProductJsonAccessorUtils)
-
-
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 thisCollectedEntityContributor
can handle the given batch of collected entities.- Specified by:
canHandle
in interfaceCollectedEntityContributor
- Parameters:
entityType
- the class that represents the batch of items to receive contributionsrequest
- the original requestcontextInfo
- 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 interfaceCollectedEntityContributor
- Parameters:
entities
- the List of entities that may require contributionsrequest
- the original requestprocessState
- A Map of shared context for storing details of the collection process - expected to be thread-safecontextInfo
- the context info associated with this process
-
parseSkusForProduct
-
getExternalInventoryProvider
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
getCollectedProductJsonAccessorUtils
-