org.broadleafcommerce.inventory.service
Interface InventoryService

All Known Implementing Classes:
InventoryServiceImpl

public interface InventoryService

This is a basic inventory service for Broadleaf Commerce. This API defines a basic set of functions for checking inventory availability and for adjusting inventory. 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

Author:
Kelly Tisdell

Method Summary
 void decrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory)
          Subtracts the quantity from available inventory in the default fulfillment location for each sku in the map.
 void decrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory, FulfillmentLocation fulfillmentLocation)
          Subtracts the quantity from available inventory for each sku in the map for the given fulfillment location.
 void decrementInventoryOnHand(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory)
          Subtracts the quantity from inventory on hand in the default fulfillment location for each sku in the map.
 void decrementInventoryOnHand(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory, FulfillmentLocation fulfillmentLocation)
          Subtracts the quantity from inventory on hand for each sku in the map for the given fulfillment location.
 void incrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory)
          Attempts to add available inventory to an inventory record associated with a default fulfillment location.
 void incrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory, FulfillmentLocation fulfillmentLocation)
          Add available inventory to sku.
 void incrementInventoryOnHand(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory)
          Attempts to add inventory on hand to an inventory record associated with a default fulfillment location.
 void incrementInventoryOnHand(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory, FulfillmentLocation fulfillmentLocation)
          Add inventory on hand to sku.
 boolean isQuantityAvailable(org.broadleafcommerce.core.catalog.domain.Sku sku, Integer quantity)
          Retrieves whether or not the quantity is available for a sku at all fulfillment locations.
 boolean isQuantityAvailable(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 isSkuEligibleForInventoryCheck(org.broadleafcommerce.core.catalog.domain.Sku sku)
          Tests whether an inventory check will be invoked for the given Sku.
 Inventory readInventory(org.broadleafcommerce.core.catalog.domain.Sku sku)
          Retrieves inventory for this sku at the default fulfillment location.
 Inventory readInventory(org.broadleafcommerce.core.catalog.domain.Sku sku, FulfillmentLocation fulfillmentLocation)
          Retrieves the Inventory for the given Sku and FulfillmentLocation
 List<Inventory> readInventoryForFulfillmentLocation(FulfillmentLocation fulfillmentLocation)
          Retrieves all instances of Inventory for this fulfillmentLocation
 List<org.broadleafcommerce.core.catalog.domain.Sku> readSkusNotAtFulfillmentLocation(FulfillmentLocation fulfillmentLocation)
          Retrieves skus that do not have inventory records at a particular fulfillment location
 Inventory save(Inventory inventory)
          Persists the inventory
 

Method Detail

isSkuEligibleForInventoryCheck

boolean isSkuEligibleForInventoryCheck(org.broadleafcommerce.core.catalog.domain.Sku sku)
Tests whether an inventory check will be invoked for the given Sku.

Parameters:
sku -
Returns:

isQuantityAvailable

boolean isQuantityAvailable(org.broadleafcommerce.core.catalog.domain.Sku sku,
                            Integer quantity)
Retrieves whether or not the quantity is available for a sku at all fulfillment locations.

Parameters:
sku - the sku
quantity - the amount for which to check; must be a positive integer
Returns:
the boolean result of whether or not the quantity is available

isQuantityAvailable

boolean isQuantityAvailable(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. If fulfillmentLocation is not supplied, this will check all fulfillment locations for availability.

Parameters:
sku - the sku
quantity - the amount for which to check; must be a positive integer
fulfillmentLocation - the fulfillment location
Returns:
boolean result of whether or not the specified quantity is available

decrementInventory

void decrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory)
                        throws ConcurrentInventoryModificationException,
                               InventoryUnavailableException
Subtracts the quantity from available inventory in the default fulfillment location for each sku in the map. Specified quantity must be a positive integer.

Parameters:
skuInventory - a map which contains the quantity of inventory to subtract from available inventory for each sku
Throws:
ConcurrentInventoryModificationException
InventoryUnavailableException

decrementInventory

void decrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory,
                        FulfillmentLocation fulfillmentLocation)
                        throws ConcurrentInventoryModificationException,
                               InventoryUnavailableException
Subtracts the quantity from available inventory for each sku in the map for the given fulfillment location. Quantity must be a positive integer.

Parameters:
skuInventory - a map which contains the quantity of inventory to subtract from available inventory for each sku
fulfillmentLocation - the fulfillment location
Throws:
ConcurrentInventoryModificationException
InventoryUnavailableException

decrementInventoryOnHand

void decrementInventoryOnHand(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory)
                              throws ConcurrentInventoryModificationException,
                                     InventoryUnavailableException
Subtracts the quantity from inventory on hand in the default fulfillment location for each sku in the map. Specified quantity must be a positive integer. This is typically done when the items are shipped or fulfilled.

Parameters:
skuInventory -
Throws:
ConcurrentInventoryModificationException
InventoryUnavailableException

decrementInventoryOnHand

void decrementInventoryOnHand(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory,
                              FulfillmentLocation fulfillmentLocation)
                              throws ConcurrentInventoryModificationException,
                                     InventoryUnavailableException
Subtracts the quantity from inventory on hand for each sku in the map for the given fulfillment location. Specified quantity must be a positive integer. This is typically done when inventory is shipped or fulfilled.

Parameters:
skuInventory -
fulfillmentLocation -
Throws:
ConcurrentInventoryModificationException
InventoryUnavailableException

incrementInventory

void incrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory,
                        FulfillmentLocation fulfillmentLocation)
                        throws ConcurrentInventoryModificationException
Add available inventory to sku. If fulfillment location is null, this method throws an IllegalArgumentException.

Parameters:
skuInventory -
fulfillmentLocation -
Throws:
ConcurrentInventoryModificationException

incrementInventory

void incrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory)
                        throws ConcurrentInventoryModificationException
Attempts to add available inventory to an inventory record associated with a default fulfillment location.

Parameters:
skuInventory -
Throws:
ConcurrentInventoryModificationException
IllegalStateException - if no default fulfillment location could be found for the Sku.

incrementInventoryOnHand

void incrementInventoryOnHand(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory,
                              FulfillmentLocation fulfillmentLocation)
                              throws ConcurrentInventoryModificationException
Add inventory on hand to sku. If fulfillment location is null, this method throws an IllegalArgumentException.

Parameters:
skuInventory -
fulfillmentLocation -
Throws:
ConcurrentInventoryModificationException

incrementInventoryOnHand

void incrementInventoryOnHand(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory)
                              throws ConcurrentInventoryModificationException
Attempts to add inventory on hand to an inventory record associated with a default fulfillment location.

Parameters:
skuInventory -
Throws:
ConcurrentInventoryModificationException

readInventory

Inventory readInventory(org.broadleafcommerce.core.catalog.domain.Sku sku,
                        FulfillmentLocation fulfillmentLocation)
Retrieves the Inventory for the given Sku and FulfillmentLocation

Parameters:
sku - Sku
fulfillmentLocation - FulfillmentLocation
Returns:
Inventory

readInventory

Inventory readInventory(org.broadleafcommerce.core.catalog.domain.Sku sku)
Retrieves inventory for this sku at the default fulfillment location.

Parameters:
sku -
Returns:

readInventoryForFulfillmentLocation

List<Inventory> readInventoryForFulfillmentLocation(FulfillmentLocation fulfillmentLocation)
Retrieves all instances of Inventory for this fulfillmentLocation

Parameters:
fulfillmentLocation -
Returns:
list of Inventory

save

Inventory save(Inventory inventory)
               throws ConcurrentInventoryModificationException
Persists the inventory

Throws:
ConcurrentInventoryModificationException

readSkusNotAtFulfillmentLocation

List<org.broadleafcommerce.core.catalog.domain.Sku> readSkusNotAtFulfillmentLocation(FulfillmentLocation fulfillmentLocation)
Retrieves skus that do not have inventory records at a particular fulfillment location

Parameters:
fulfillmentLocation -
Returns:


Copyright © 2013. All Rights Reserved.