@Component(value="blAdvancedInventoryServiceExtensionHandler")
public class AdvancedInventoryServiceExtensionHandler
extends org.broadleafcommerce.core.inventory.service.AbstractInventoryServiceExtensionHandler
implements org.broadleafcommerce.core.inventory.service.InventoryServiceExtensionHandler
| Modifier and Type | Field and Description |
|---|---|
protected org.broadleafcommerce.core.inventory.service.InventoryServiceExtensionManager |
extensionManager |
protected AdvancedInventoryService |
inventoryService |
protected InventoryLocationResolver |
locationResolver |
protected List<InventoryReservationStrategy> |
reservationStrategies
Injects all of the
InventoryReservationStrategy types |
static String |
ROLLBACK_BLC_ADVANCED_INVENTORY_DECREMENTED |
static String |
ROLLBACK_BLC_ADVANCED_INVENTORY_INCREMENTED |
static String |
ROLLBACK_BLC_ADVANCED_INVENTORY_ORDER_ID |
protected InventoryReservationStrategy |
selectedStrategy |
| Constructor and Description |
|---|
AdvancedInventoryServiceExtensionHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildReservationsAndInventoryMap(org.broadleafcommerce.core.order.domain.Order order,
Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventoryMap,
List<InventoryReservation> inventoryReservations) |
protected Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> |
buildSkuQuantityMapFromLocationMap(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> locationMap) |
org.broadleafcommerce.common.extension.ExtensionResultStatusType |
decrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuQuantities,
Map<String,Object> context) |
protected void |
decrementInventoryFromLocations(Map<String,Object> context,
org.broadleafcommerce.core.order.domain.Order order,
Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventoryMap,
List<InventoryReservation> inventoryReservations,
Map<String,Object> rollbackState) |
protected org.broadleafcommerce.core.order.domain.Order |
getChangeOrderFromContext(Map<String,Object> context) |
int |
getMaxRetries() |
protected org.broadleafcommerce.core.order.domain.Order |
getOrderFromContext(Map<String,Object> context) |
protected InventoryReservationStrategy |
getReservationStrategy() |
protected Map<String,Object> |
getRollbackStateFromContext(Map<String,Object> context) |
protected org.broadleafcommerce.core.catalog.domain.Sku |
getSkuForItem(org.broadleafcommerce.core.order.domain.FulfillmentGroupItem item) |
org.broadleafcommerce.common.extension.ExtensionResultStatusType |
incrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuQuantities,
Map<String,Object> context) |
void |
init() |
org.broadleafcommerce.common.extension.ExtensionResultStatusType |
reconcileChangeOrderInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> decrementSkuQuantities,
Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> incrementSkuQuantities,
Map<String,Object> context)
In the case of a change order (i.e from the OMS workflow), we need to rollback existing reservations and start over
in order to reconcile the difference in inventory and reservations that have already been committed.
|
org.broadleafcommerce.common.extension.ExtensionResultStatusType |
retrieveQuantitiesAvailable(Collection<org.broadleafcommerce.core.catalog.domain.Sku> skus,
Map<String,Object> context,
org.broadleafcommerce.common.extension.ExtensionResultHolder<Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> result) |
protected Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> |
reverseLocationQuantityMapFromReservations(List<InventoryReservation> reservations)
Given a list of reservations (e.g.
|
protected void |
validateReservationQuantities(org.broadleafcommerce.core.order.domain.FulfillmentGroupItem item,
List<InventoryReservation> reservations) |
isProductBundleAvailablegetPriority, isEnabled, setEnabled, setPriorityclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final String ROLLBACK_BLC_ADVANCED_INVENTORY_DECREMENTED
public static final String ROLLBACK_BLC_ADVANCED_INVENTORY_INCREMENTED
public static final String ROLLBACK_BLC_ADVANCED_INVENTORY_ORDER_ID
protected InventoryLocationResolver locationResolver
protected AdvancedInventoryService inventoryService
protected org.broadleafcommerce.core.inventory.service.InventoryServiceExtensionManager extensionManager
@Autowired protected List<InventoryReservationStrategy> reservationStrategies
InventoryReservationStrategy typesprotected InventoryReservationStrategy selectedStrategy
public AdvancedInventoryServiceExtensionHandler()
@PostConstruct public void init()
public org.broadleafcommerce.common.extension.ExtensionResultStatusType retrieveQuantitiesAvailable(Collection<org.broadleafcommerce.core.catalog.domain.Sku> skus, Map<String,Object> context, org.broadleafcommerce.common.extension.ExtensionResultHolder<Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> result)
retrieveQuantitiesAvailable in interface org.broadleafcommerce.core.inventory.service.InventoryServiceExtensionHandlerretrieveQuantitiesAvailable in class org.broadleafcommerce.core.inventory.service.AbstractInventoryServiceExtensionHandlerpublic org.broadleafcommerce.common.extension.ExtensionResultStatusType decrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuQuantities, Map<String,Object> context) throws org.broadleafcommerce.core.inventory.service.InventoryUnavailableException
decrementInventory in interface org.broadleafcommerce.core.inventory.service.InventoryServiceExtensionHandlerdecrementInventory in class org.broadleafcommerce.core.inventory.service.AbstractInventoryServiceExtensionHandlerorg.broadleafcommerce.core.inventory.service.InventoryUnavailableExceptionprotected void decrementInventoryFromLocations(Map<String,Object> context, org.broadleafcommerce.core.order.domain.Order order, Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventoryMap, List<InventoryReservation> inventoryReservations, Map<String,Object> rollbackState) throws org.broadleafcommerce.core.inventory.service.InventoryUnavailableException
org.broadleafcommerce.core.inventory.service.InventoryUnavailableExceptionprotected void buildReservationsAndInventoryMap(org.broadleafcommerce.core.order.domain.Order order,
Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventoryMap,
List<InventoryReservation> inventoryReservations)
throws org.broadleafcommerce.core.inventory.service.InventoryUnavailableException
org.broadleafcommerce.core.inventory.service.InventoryUnavailableExceptionprotected Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> reverseLocationQuantityMapFromReservations(List<InventoryReservation> reservations)
reservations - protected Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> buildSkuQuantityMapFromLocationMap(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> locationMap)
protected void validateReservationQuantities(org.broadleafcommerce.core.order.domain.FulfillmentGroupItem item,
@Nullable
List<InventoryReservation> reservations)
throws org.broadleafcommerce.core.inventory.service.InventoryUnavailableException
org.broadleafcommerce.core.inventory.service.InventoryUnavailableExceptionprotected org.broadleafcommerce.core.catalog.domain.Sku getSkuForItem(org.broadleafcommerce.core.order.domain.FulfillmentGroupItem item)
public org.broadleafcommerce.common.extension.ExtensionResultStatusType incrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuQuantities, Map<String,Object> context)
incrementInventory in interface org.broadleafcommerce.core.inventory.service.InventoryServiceExtensionHandlerincrementInventory in class org.broadleafcommerce.core.inventory.service.AbstractInventoryServiceExtensionHandlerpublic org.broadleafcommerce.common.extension.ExtensionResultStatusType reconcileChangeOrderInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> decrementSkuQuantities, Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> incrementSkuQuantities, Map<String,Object> context) throws org.broadleafcommerce.core.inventory.service.InventoryUnavailableException
reconcileChangeOrderInventory in interface org.broadleafcommerce.core.inventory.service.InventoryServiceExtensionHandlerreconcileChangeOrderInventory in class org.broadleafcommerce.core.inventory.service.AbstractInventoryServiceExtensionHandlerdecrementSkuQuantities - incrementSkuQuantities - context - org.broadleafcommerce.core.inventory.service.InventoryUnavailableExceptionprotected InventoryReservationStrategy getReservationStrategy()
protected org.broadleafcommerce.core.order.domain.Order getOrderFromContext(Map<String,Object> context)
protected org.broadleafcommerce.core.order.domain.Order getChangeOrderFromContext(Map<String,Object> context)
protected Map<String,Object> getRollbackStateFromContext(Map<String,Object> context)
public int getMaxRetries()
Copyright © 2020. All rights reserved.