Class DefaultStockChangeNotificationService
- java.lang.Object
-
- com.broadleafcommerce.inventory.service.DefaultStockChangeNotificationService
-
- All Implemented Interfaces:
StockChangeNotificationService
public class DefaultStockChangeNotificationService extends Object implements StockChangeNotificationService
Default component that sends stock change notifications via Spring Cloud Stream.- Author:
- Kelly Tisdell (ktisdell)
-
-
Constructor Summary
Constructors Constructor Description DefaultStockChangeNotificationService(SkuInventorySummaryService<?> skuInventorySummaryService, StockAvailabilityChangeNotifcationProducer stockAvailabilityChangeNotifcationProducer, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.springframework.messaging.Message<ConsolidatedInventoryAvailability>
createMessage(ConsolidatedInventoryAvailability consolidatedInventoryAvailability)
protected com.fasterxml.jackson.databind.ObjectMapper
getObjectMapper()
protected SkuInventorySummaryService<?>
getSkuInventorySummaryService()
protected StockAvailabilityChangeNotifcationProducer
getStockAvailabilityChangeNotifcationProducer()
protected com.broadleafcommerce.common.extension.TypeFactory
getTypeFactory()
void
notifyOfStockChange(String skuCode, int previousQuantityAvailable, int newQuantityAvailable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
API to notify, typically via an asynchronous message, that stock has become available or unavailable for a tenant or application.
-
-
-
Constructor Detail
-
DefaultStockChangeNotificationService
public DefaultStockChangeNotificationService(SkuInventorySummaryService<?> skuInventorySummaryService, StockAvailabilityChangeNotifcationProducer stockAvailabilityChangeNotifcationProducer, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Detail
-
notifyOfStockChange
public void notifyOfStockChange(@NonNull String skuCode, int previousQuantityAvailable, int newQuantityAvailable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:StockChangeNotificationService
API to notify, typically via an asynchronous message, that stock has become available or unavailable for a tenant or application.- Specified by:
notifyOfStockChange
in interfaceStockChangeNotificationService
-
createMessage
protected org.springframework.messaging.Message<ConsolidatedInventoryAvailability> createMessage(ConsolidatedInventoryAvailability consolidatedInventoryAvailability)
-
getSkuInventorySummaryService
protected SkuInventorySummaryService<?> getSkuInventorySummaryService()
-
getStockAvailabilityChangeNotifcationProducer
protected StockAvailabilityChangeNotifcationProducer getStockAvailabilityChangeNotifcationProducer()
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-
-