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 Details

    • DefaultStockChangeNotificationService

      public DefaultStockChangeNotificationService(SkuInventorySummaryService<?> skuInventorySummaryService, StockAvailabilityChangeNotifcationProducer stockAvailabilityChangeNotifcationProducer, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • 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 interface StockChangeNotificationService
    • 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()
    • getPublisher

      @Nullable protected org.springframework.context.ApplicationEventPublisher getPublisher()
    • setPublisher

      @Autowired(required=false) public void setPublisher(org.springframework.context.ApplicationEventPublisher publisher)