Class AbstractInventoryServiceExtensionHandler
java.lang.Object
org.broadleafcommerce.common.extension.AbstractExtensionHandler
org.broadleafcommerce.core.inventory.service.AbstractInventoryServiceExtensionHandler
- All Implemented Interfaces:
org.broadleafcommerce.common.extension.ExtensionHandler,InventoryServiceExtensionHandler
public abstract class AbstractInventoryServiceExtensionHandler
extends org.broadleafcommerce.common.extension.AbstractExtensionHandler
implements InventoryServiceExtensionHandler
-
Field Summary
Fields inherited from class org.broadleafcommerce.common.extension.AbstractExtensionHandler
enabled, priority -
Constructor Summary
Constructors -
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 class org.broadleafcommerce.common.extension.AbstractExtensionHandler
getPriority, isEnabled, setEnabled, setPriorityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.broadleafcommerce.common.extension.ExtensionHandler
getPriority, isEnabled
-
Constructor Details
-
AbstractInventoryServiceExtensionHandler
public AbstractInventoryServiceExtensionHandler()
-
-
Method Details
-
retrieveQuantitiesAvailable
public org.broadleafcommerce.common.extension.ExtensionResultStatusType retrieveQuantitiesAvailable(Collection<Sku> skus, Map<String, Object> context, org.broadleafcommerce.common.extension.ExtensionResultHolder<Map<Sku, Integer>> result) Description copied from interface:InventoryServiceExtensionHandlerUsually invoked within theCheckAddAvailabilityActivityto retrieve the quantity that is available for the given skus.- Specified by:
retrieveQuantitiesAvailablein interfaceInventoryServiceExtensionHandlercontext- can be null. If not null, this should at least contain theContextualInventoryService.ORDER_KEY
-
decrementInventory
public org.broadleafcommerce.common.extension.ExtensionResultStatusType decrementInventory(Map<Sku, Integer> skuQuantities, Map<String, throws InventoryUnavailableExceptionObject> context) Description copied from interface:InventoryServiceExtensionHandlerUsually invoked within theDecrementInventoryActivityto decrement inventory for theSkus that are in skuQuantities- Specified by:
decrementInventoryin interfaceInventoryServiceExtensionHandlercontext- can be null. If not null, this should at least contain theContextualInventoryService.ORDER_KEYand/or theContextualInventoryService.ROLLBACK_STATE_KEY- Throws:
InventoryUnavailableException
-
incrementInventory
public org.broadleafcommerce.common.extension.ExtensionResultStatusType incrementInventory(Map<Sku, Integer> skuQuantities, Map<String, Object> context) - Specified by:
incrementInventoryin interfaceInventoryServiceExtensionHandlercontext- can be null. If not null, this should at least contain theContextualInventoryService.ROLLBACK_STATE_KEY
-
reconcileChangeOrderInventory
public org.broadleafcommerce.common.extension.ExtensionResultStatusType reconcileChangeOrderInventory(Map<Sku, Integer> decrementSkuQuantities, Map<Sku, throws InventoryUnavailableExceptionInteger> incrementSkuQuantities, Map<String, Object> context) Description copied from interface:InventoryServiceExtensionHandlerUsually invoked via the OMSReconcileInventoryChangeOrderActivityto determine how to handle a change order.- Specified by:
reconcileChangeOrderInventoryin interfaceInventoryServiceExtensionHandler- Returns:
- Throws:
InventoryUnavailableException
-
isProductBundleAvailable
public org.broadleafcommerce.common.extension.ExtensionResultStatusType isProductBundleAvailable(Product product, int quantity, org.broadleafcommerce.common.extension.ExtensionResultHolder<Boolean> holder) Description copied from interface:InventoryServiceExtensionHandlerUsually invoked via the AdvancedProduct to determine the availability of product bundle.- Specified by:
isProductBundleAvailablein interfaceInventoryServiceExtensionHandler- Parameters:
product- contains Product
-
isBlockingAvailabilityOfProduct
public org.broadleafcommerce.common.extension.ExtensionResultStatusType isBlockingAvailabilityOfProduct(Product baseProduct, Product product, org.broadleafcommerce.common.extension.ExtensionResultHolder<Boolean> holder) Description copied from interface:InventoryServiceExtensionHandlerThis 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.- Specified by:
isBlockingAvailabilityOfProductin interfaceInventoryServiceExtensionHandler- 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
-