Interface InventoryServiceExtensionHandler
- All Superinterfaces:
org.broadleafcommerce.common.extension.ExtensionHandler
- All Known Implementing Classes:
AbstractInventoryServiceExtensionHandler
public interface InventoryServiceExtensionHandler
extends org.broadleafcommerce.common.extension.ExtensionHandler
Marker interface to dictate the overridden methods within
ContextualInventoryService. Usually, implementers
will want to only override the ContextualInventoryService methods rather than all of the methods included
in InventoryService and so you will extend from AbstractInventoryServiceExtensionHandler.- Author:
- Phillip Verheyden (phillipuniverse)
-
Method Summary
Modifier and TypeMethodDescriptionorg.broadleafcommerce.common.extension.ExtensionResultStatusTypeUsually invoked within theDecrementInventoryActivityto decrement inventory for theSkus that are in skuQuantitiesorg.broadleafcommerce.common.extension.ExtensionResultStatusTypeorg.broadleafcommerce.common.extension.ExtensionResultStatusTypeisBlockingAvailabilityOfProduct(Product baseProduct, Product product, org.broadleafcommerce.common.extension.ExtensionResultHolder<Boolean> holder) This determines if the missing quantity is critical (blocking) to be added to the cart Usually invoked via the UncacheableDataProcessor to determine the availability of product.org.broadleafcommerce.common.extension.ExtensionResultStatusTypeisProductBundleAvailable(Product product, int quantity, org.broadleafcommerce.common.extension.ExtensionResultHolder<Boolean> holder) Usually invoked via the AdvancedProduct to determine the availability of product bundle.org.broadleafcommerce.common.extension.ExtensionResultStatusTypereconcileChangeOrderInventory(Map<Sku, Integer> decrementSkuQuantities, Map<Sku, Integer> incrementSkuQuantities, Map<String, Object> context) Usually invoked via the OMSReconcileInventoryChangeOrderActivityto determine how to handle a change order.org.broadleafcommerce.common.extension.ExtensionResultStatusTyperetrieveQuantitiesAvailable(Collection<Sku> skus, Map<String, Object> context, org.broadleafcommerce.common.extension.ExtensionResultHolder<Map<Sku, Integer>> result) Usually invoked within theCheckAddAvailabilityActivityto retrieve the quantity that is available for the given skus.Methods inherited from interface org.broadleafcommerce.common.extension.ExtensionHandler
getPriority, isEnabled
-
Method Details
-
retrieveQuantitiesAvailable
org.broadleafcommerce.common.extension.ExtensionResultStatusType retrieveQuantitiesAvailable(Collection<Sku> skus, Map<String, Object> context, org.broadleafcommerce.common.extension.ExtensionResultHolder<Map<Sku, Integer>> result) Usually invoked within theCheckAddAvailabilityActivityto retrieve the quantity that is available for the given skus.- Parameters:
context- can be null. If not null, this should at least contain theContextualInventoryService.ORDER_KEY
-
decrementInventory
org.broadleafcommerce.common.extension.ExtensionResultStatusType decrementInventory(Map<Sku, Integer> skuQuantities, Map<String, throws InventoryUnavailableExceptionObject> context) Usually invoked within theDecrementInventoryActivityto decrement inventory for theSkus that are in skuQuantities- Parameters:
context- can be null. If not null, this should at least contain theContextualInventoryService.ORDER_KEYand/or theContextualInventoryService.ROLLBACK_STATE_KEY- Throws:
InventoryUnavailableException
-
incrementInventory
org.broadleafcommerce.common.extension.ExtensionResultStatusType incrementInventory(Map<Sku, Integer> skuQuantities, Map<String, Object> context) - Parameters:
context- can be null. If not null, this should at least contain theContextualInventoryService.ROLLBACK_STATE_KEY
-
reconcileChangeOrderInventory
org.broadleafcommerce.common.extension.ExtensionResultStatusType reconcileChangeOrderInventory(Map<Sku, Integer> decrementSkuQuantities, Map<Sku, throws InventoryUnavailableExceptionInteger> incrementSkuQuantities, Map<String, Object> context) Usually invoked via the OMSReconcileInventoryChangeOrderActivityto determine how to handle a change order.- Parameters:
decrementSkuQuantities-incrementSkuQuantities-context-- Returns:
- Throws:
InventoryUnavailableException
-
isProductBundleAvailable
org.broadleafcommerce.common.extension.ExtensionResultStatusType isProductBundleAvailable(Product product, int quantity, org.broadleafcommerce.common.extension.ExtensionResultHolder<Boolean> holder) Usually invoked via the AdvancedProduct to determine the availability of product bundle.- Parameters:
product- contains Productquantity-holder-
-
isBlockingAvailabilityOfProduct
org.broadleafcommerce.common.extension.ExtensionResultStatusType isBlockingAvailabilityOfProduct(Product baseProduct, Product product, org.broadleafcommerce.common.extension.ExtensionResultHolder<Boolean> holder) This determines if the missing quantity is critical (blocking) to be added to the cart Usually invoked via the UncacheableDataProcessor to determine the availability of product.- Parameters:
baseProduct- base product with add-onsproduct- one of the add-on products of the base productholder- holder for result- Returns:
- ExtensionResultStatusType status after operation
-