public interface AdvancedInventoryService
extends org.broadleafcommerce.core.inventory.service.InventoryService
InventoryService.decrementInventory(Map) and decrementInventoryOnHand(Map))
could roll back transactions from optimistic
NOTE: If you wrap this service inside another service or transactional component, it may be best to ensure that
transactions are rolled back when encountering checked exceptions that are thrown from this service, such as
InventoryUnavailableException and ConcurrentInventoryModificationException| Modifier and Type | Method and Description |
|---|---|
void |
decrementInventoryFromLocations(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventory)
Subtracts the quantity from available inventory for each sku in the map for the given fulfillment location.
|
void |
decrementInventoryFromLocations(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventory,
List<InventoryReservation> reservations)
The same as
decrementInventoryFromLocations(Map) except that this will also persist the given reservations
so that everything can be apart of a single transaction |
void |
decrementInventoryOnHand(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventory)
Subtracts the quantity from inventory on hand for each sku in the map for the given fulfillment location.
|
void |
deleteReservation(InventoryReservation reservation)
Deletes the reservation from the system
|
Inventory |
findInventory(org.broadleafcommerce.core.catalog.domain.Sku sku)
Retrieves inventory for this sku at the default fulfillment location.
|
Inventory |
findInventory(org.broadleafcommerce.core.catalog.domain.Sku sku,
FulfillmentLocation fulfillmentLocation)
|
List<Inventory> |
findInventoryAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku)
Gets the list of inventory across all
FulfillmentLocations for the given sku |
List<Inventory> |
findInventoryAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku,
org.broadleafcommerce.core.order.service.type.FulfillmentType fulfillmentType)
|
int |
findInventoryCountAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku)
Counts the quantity available across all
FulfillmentLocations |
int |
findInventoryCountAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku,
org.broadleafcommerce.core.order.service.type.FulfillmentType fulfillmentType)
Counts the quantity available across all
FulfillmentLocations for the given FulfillmentType |
int |
findInventoryCountInFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku,
List<FulfillmentLocation> locations)
Counts the quantity available across the given set of locations for a given sku
|
List<Inventory> |
findInventoryForFulfillmentLocation(FulfillmentLocation fulfillmentLocation)
Retrieves all instances of Inventory for this fulfillmentLocation
|
int |
findMaxInventoryAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku)
Gets the maximum quantity available in a single
FulfillmentLocation for the given sku across all
FulfillmentLocations |
int |
findMaxInventoryInFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku,
List<FulfillmentLocation> locations)
Gets the maximum quantity available in a single
FulfillmentLocation for the given sku filtered by the
list of given locations |
void |
incrementInventoryFromLocations(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventory)
Add available inventory to sku.
|
void |
incrementInventoryFromLocations(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventory,
List<InventoryReservation> reservations) |
void |
incrementInventoryOnHand(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventory)
Add inventory on hand to sku.
|
Map<org.broadleafcommerce.core.catalog.domain.Sku,Boolean> |
isAvailable(org.broadleafcommerce.core.catalog.domain.Product product,
Integer quantity)
Returns a map indicating if the quantity requested is available for each sku associated with the Product in the default fulfillment location.
|
Map<org.broadleafcommerce.core.catalog.domain.Sku,Boolean> |
isAvailable(org.broadleafcommerce.core.catalog.domain.Product product,
Integer quantity,
FulfillmentLocation fulfillmentLocation)
Returns a map indicating whether the quantity requested is available for the specified Product in the fulfillment location.
|
boolean |
isAvailable(org.broadleafcommerce.core.catalog.domain.Sku sku,
Integer quantity,
FulfillmentLocation fulfillmentLocation)
Retrieves whether or not the quantity is available for a sku at a fulfillment location.
|
boolean |
isAvailable(org.broadleafcommerce.core.catalog.domain.Sku sku,
int quantity,
List<FulfillmentLocation> locations)
Determines if quantity is available for the given sku at the given locations
|
boolean |
isAvailableAtDefaultFulfillmentLocation(org.broadleafcommerce.core.catalog.domain.Sku sku,
Integer quantity)
Retrieves whether or not the quantity is available for a sku at the default fulfillment location.
|
boolean |
isSkuEligibleForInventoryCheck(org.broadleafcommerce.core.catalog.domain.Sku sku)
Tests whether an inventory check will be invoked for the given Sku.
|
boolean |
isSkuEligibleForReservation(org.broadleafcommerce.core.catalog.domain.Sku sku)
Tests whether a reservation will be created for a given Sku.
|
Inventory |
save(Inventory inventory)
Persists the inventory
|
InventoryReservation |
saveReservation(InventoryReservation reservation)
Saves the given reservation
|
void |
setInventory(Map<FulfillmentLocation,List<UpdateInventoryInfo>> inventoryInfos)
Sets the on hand and available quantities for a sku at a fulfillment location.
|
boolean isSkuEligibleForInventoryCheck(org.broadleafcommerce.core.catalog.domain.Sku sku)
sku - boolean isSkuEligibleForReservation(org.broadleafcommerce.core.catalog.domain.Sku sku)
sku - boolean isAvailableAtDefaultFulfillmentLocation(org.broadleafcommerce.core.catalog.domain.Sku sku,
Integer quantity)
sku - the skuquantity - the amount for which to check; must be a positive integerMap<org.broadleafcommerce.core.catalog.domain.Sku,Boolean> isAvailable(org.broadleafcommerce.core.catalog.domain.Product product, Integer quantity)
product - quantity - boolean isAvailable(org.broadleafcommerce.core.catalog.domain.Sku sku,
Integer quantity,
FulfillmentLocation fulfillmentLocation)
sku - the skuquantity - the amount for which to check; must be a positive integerfulfillmentLocation - the fulfillment locationboolean isAvailable(org.broadleafcommerce.core.catalog.domain.Sku sku,
int quantity,
List<FulfillmentLocation> locations)
sku - the Sku to checkquantity - the quantity that should be verified for availabilitylocations - the locations that should be checked for the given skuInventory.getQuantityAvailable() at any of the given locations is greater than
or equal to the given quantity, false otherwise.#findInventoryCountInFulfillmentLocations(Sku, List)}Map<org.broadleafcommerce.core.catalog.domain.Sku,Boolean> isAvailable(org.broadleafcommerce.core.catalog.domain.Product product, Integer quantity, FulfillmentLocation fulfillmentLocation)
product - quantity - fulfillmentLocation - void decrementInventoryFromLocations(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventory) throws ConcurrentInventoryModificationException, org.broadleafcommerce.core.inventory.service.InventoryUnavailableException
skuInventory - a map which contains the quantity of inventory to subtract from available inventory for each skufulfillmentLocation - the fulfillment locationConcurrentInventoryModificationExceptionorg.broadleafcommerce.core.inventory.service.InventoryUnavailableExceptionvoid decrementInventoryFromLocations(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventory, List<InventoryReservation> reservations) throws ConcurrentInventoryModificationException, org.broadleafcommerce.core.inventory.service.InventoryUnavailableException
decrementInventoryFromLocations(Map) except that this will also persist the given reservations
so that everything can be apart of a single transactionskuInventory - the inventory map to decrementreservations - optional list of reservations that should be persisted along with the new decremented inventory
valuesConcurrentInventoryModificationExceptionorg.broadleafcommerce.core.inventory.service.InventoryUnavailableExceptionvoid decrementInventoryOnHand(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventory) throws ConcurrentInventoryModificationException, org.broadleafcommerce.core.inventory.service.InventoryUnavailableException
skuInventory - fulfillmentLocation - ConcurrentInventoryModificationExceptionorg.broadleafcommerce.core.inventory.service.InventoryUnavailableExceptionvoid incrementInventoryFromLocations(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventory) throws ConcurrentInventoryModificationException
IllegalArgumentException.skuInventory - fulfillmentLocation - ConcurrentInventoryModificationExceptionvoid incrementInventoryFromLocations(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventory, List<InventoryReservation> reservations) throws ConcurrentInventoryModificationException
void incrementInventoryOnHand(Map<FulfillmentLocation,Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer>> skuInventory) throws ConcurrentInventoryModificationException
IllegalArgumentException.skuInventory - fulfillmentLocation - ConcurrentInventoryModificationExceptionvoid setInventory(Map<FulfillmentLocation,List<UpdateInventoryInfo>> inventoryInfos) throws ConcurrentInventoryModificationException
inventoryInfos - ConcurrentInventoryModificationExceptionInventory findInventory(org.broadleafcommerce.core.catalog.domain.Sku sku, FulfillmentLocation fulfillmentLocation)
sku - SkufulfillmentLocation - FulfillmentLocationInventoryInventory findInventory(org.broadleafcommerce.core.catalog.domain.Sku sku)
sku - List<Inventory> findInventoryForFulfillmentLocation(FulfillmentLocation fulfillmentLocation)
fulfillmentLocation - InventoryInventory save(Inventory inventory) throws ConcurrentInventoryModificationException
ConcurrentInventoryModificationExceptionint findInventoryCountAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku)
FulfillmentLocationssku - the Sku to look for inventory forFulfillmentLocations for this Sku#findInventoryAcrossFulfillmentLocations(Sku)}int findInventoryCountAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku,
org.broadleafcommerce.core.order.service.type.FulfillmentType fulfillmentType)
FulfillmentLocations for the given FulfillmentTypesku - the Sku from the catalog to find inventory forfulfillmentType - restriction on the types of FulfillmentLocations that should be checked for inventoryInventory.getQuantityAvailable() for the given sku within
FulfillmentLocations filtered by the given fulfillmentType#findInventoryAcrossFulfillmentLocations(Sku, FulfillmentType)}int findMaxInventoryAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku)
FulfillmentLocation for the given sku across all
FulfillmentLocationssku - the Sku to find inventory forFulfillmentLocations then this will return 0int findInventoryCountInFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku,
List<FulfillmentLocation> locations)
sku - the Sku from the catalog to find inventory forlocations - restriction on the FulfillmentLocations to count inventory forInventory.getQuantityAvailable() across all of the fulfillment locationsint findMaxInventoryInFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku,
List<FulfillmentLocation> locations)
FulfillmentLocation for the given sku filtered by the
list of given locationssku - the Sku to find inventory forlocations - a subset of FulfillmentLocations to look for inventoryList<Inventory> findInventoryAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku)
FulfillmentLocations for the given skusku - the Sku to find inventory forInventory for the given sku#findInventoryAcrossFulfillmentLocations(Sku, FulfillmentType)},
#findInventoryCountAcrossFulfillmentLocations(Sku)}List<Inventory> findInventoryAcrossFulfillmentLocations(org.broadleafcommerce.core.catalog.domain.Sku sku, @Nullable org.broadleafcommerce.core.order.service.type.FulfillmentType fulfillmentType)
sku - the Sku from the catalog to find inventory forfulfillmentType - (optional) restriction on the types of FulfillmentLocations that should be checked for inventoryInventory records for the given sku within all
FulfillmentLocations filtered by the given fulfillmentType#findInventoryCountAcrossFulfillmentLocations(Sku, FulfillmentType)}InventoryReservation saveReservation(InventoryReservation reservation)
reservation - the entity to savevoid deleteReservation(InventoryReservation reservation)
reservation - the InventoryReservation to deleteCopyright © 2020. All rights reserved.