org.broadleafcommerce.inventory.service
Class InventoryServiceImpl

java.lang.Object
  extended by org.broadleafcommerce.inventory.service.InventoryServiceImpl
All Implemented Interfaces:
InventoryService

@Service(value="blInventoryService")
public class InventoryServiceImpl
extends Object
implements InventoryService


Field Summary
protected  org.broadleafcommerce.common.persistence.EntityConfiguration entityConfiguration
           
protected  FulfillmentLocationService fulfillmentLocationService
           
protected  InventoryDao inventoryDao
           
 
Constructor Summary
InventoryServiceImpl()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inventoryDao

protected InventoryDao inventoryDao

fulfillmentLocationService

protected FulfillmentLocationService fulfillmentLocationService

entityConfiguration

protected org.broadleafcommerce.common.persistence.EntityConfiguration entityConfiguration
Constructor Detail

InventoryServiceImpl

public InventoryServiceImpl()
Method Detail

isSkuEligibleForInventoryCheck

public boolean isSkuEligibleForInventoryCheck(org.broadleafcommerce.core.catalog.domain.Sku sku)
Description copied from interface: InventoryService
Tests whether an inventory check will be invoked for the given Sku.

Specified by:
isSkuEligibleForInventoryCheck in interface InventoryService
Returns:

isQuantityAvailable

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

Specified by:
isQuantityAvailable in interface InventoryService
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

@Transactional(value="blTransactionManager")
public boolean isQuantityAvailable(org.broadleafcommerce.core.catalog.domain.Sku sku,
                                                 Integer quantity,
                                                 FulfillmentLocation fulfillmentLocation)
Description copied from interface: InventoryService
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.

Specified by:
isQuantityAvailable in interface InventoryService
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

@Transactional(propagation=REQUIRES_NEW,
               value="blTransactionManager",
               rollbackFor={InventoryUnavailableException.class,ConcurrentInventoryModificationException.class})
public void decrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory)
                        throws ConcurrentInventoryModificationException,
                               InventoryUnavailableException
Description copied from interface: InventoryService
Subtracts the quantity from available inventory in the default fulfillment location for each sku in the map. Specified quantity must be a positive integer.

Specified by:
decrementInventory in interface InventoryService
Parameters:
skuInventory - a map which contains the quantity of inventory to subtract from available inventory for each sku
Throws:
ConcurrentInventoryModificationException
InventoryUnavailableException

decrementInventory

@Transactional(propagation=REQUIRES_NEW,
               value="blTransactionManager",
               rollbackFor={InventoryUnavailableException.class,ConcurrentInventoryModificationException.class})
public void decrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory,
                                                                                                                              FulfillmentLocation fulfillmentLocation)
                        throws ConcurrentInventoryModificationException,
                               InventoryUnavailableException
Description copied from interface: InventoryService
Subtracts the quantity from available inventory for each sku in the map for the given fulfillment location. Quantity must be a positive integer.

Specified by:
decrementInventory in interface InventoryService
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

@Transactional(propagation=REQUIRES_NEW,
               value="blTransactionManager",
               rollbackFor={InventoryUnavailableException.class,ConcurrentInventoryModificationException.class})
public void decrementInventoryOnHand(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory)
                              throws ConcurrentInventoryModificationException,
                                     InventoryUnavailableException
Description copied from interface: InventoryService
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.

Specified by:
decrementInventoryOnHand in interface InventoryService
Throws:
ConcurrentInventoryModificationException
InventoryUnavailableException

decrementInventoryOnHand

@Transactional(propagation=REQUIRES_NEW,
               value="blTransactionManager",
               rollbackFor={InventoryUnavailableException.class,ConcurrentInventoryModificationException.class})
public void decrementInventoryOnHand(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory,
                                                                                                                                    FulfillmentLocation fulfillmentLocation)
                              throws ConcurrentInventoryModificationException,
                                     InventoryUnavailableException
Description copied from interface: InventoryService
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.

Specified by:
decrementInventoryOnHand in interface InventoryService
Throws:
ConcurrentInventoryModificationException
InventoryUnavailableException

incrementInventory

@Transactional(propagation=REQUIRES_NEW,
               value="blTransactionManager",
               rollbackFor={InventoryUnavailableException.class,ConcurrentInventoryModificationException.class})
public void incrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory,
                                                                                                                              FulfillmentLocation fulfillmentLocation)
                        throws ConcurrentInventoryModificationException
Description copied from interface: InventoryService
Add available inventory to sku. If fulfillment location is null, this method throws an IllegalArgumentException.

Specified by:
incrementInventory in interface InventoryService
Throws:
ConcurrentInventoryModificationException

incrementInventory

@Transactional(propagation=REQUIRES_NEW,
               value="blTransactionManager",
               rollbackFor={InventoryUnavailableException.class,ConcurrentInventoryModificationException.class})
public void incrementInventory(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory)
                        throws ConcurrentInventoryModificationException
Description copied from interface: InventoryService
Attempts to add available inventory to an inventory record associated with a default fulfillment location.

Specified by:
incrementInventory in interface InventoryService
Throws:
ConcurrentInventoryModificationException

incrementInventoryOnHand

@Transactional(propagation=REQUIRES_NEW,
               value="blTransactionManager",
               rollbackFor={InventoryUnavailableException.class,ConcurrentInventoryModificationException.class})
public void incrementInventoryOnHand(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory,
                                                                                                                                    FulfillmentLocation fulfillmentLocation)
                              throws ConcurrentInventoryModificationException
Description copied from interface: InventoryService
Add inventory on hand to sku. If fulfillment location is null, this method throws an IllegalArgumentException.

Specified by:
incrementInventoryOnHand in interface InventoryService
Throws:
ConcurrentInventoryModificationException

incrementInventoryOnHand

@Transactional(propagation=REQUIRES_NEW,
               value="blTransactionManager",
               rollbackFor={InventoryUnavailableException.class,ConcurrentInventoryModificationException.class})
public void incrementInventoryOnHand(Map<org.broadleafcommerce.core.catalog.domain.Sku,Integer> skuInventory)
                              throws ConcurrentInventoryModificationException
Description copied from interface: InventoryService
Attempts to add inventory on hand to an inventory record associated with a default fulfillment location.

Specified by:
incrementInventoryOnHand in interface InventoryService
Throws:
ConcurrentInventoryModificationException

readInventory

@Transactional(value="blTransactionManager")
public Inventory readInventory(org.broadleafcommerce.core.catalog.domain.Sku sku,
                                             FulfillmentLocation fulfillmentLocation)
Description copied from interface: InventoryService
Retrieves the Inventory for the given Sku and FulfillmentLocation

Specified by:
readInventory in interface InventoryService
Parameters:
sku - Sku
fulfillmentLocation - FulfillmentLocation
Returns:
Inventory

readInventory

@Transactional(value="blTransactionManager")
public Inventory readInventory(org.broadleafcommerce.core.catalog.domain.Sku sku)
Description copied from interface: InventoryService
Retrieves inventory for this sku at the default fulfillment location.

Specified by:
readInventory in interface InventoryService
Returns:

readInventoryForFulfillmentLocation

@Transactional(value="blTransactionManager")
public List<Inventory> readInventoryForFulfillmentLocation(FulfillmentLocation fulfillmentLocation)
Description copied from interface: InventoryService
Retrieves all instances of Inventory for this fulfillmentLocation

Specified by:
readInventoryForFulfillmentLocation in interface InventoryService
Returns:
list of Inventory

save

@Transactional(value="blTransactionManager")
public Inventory save(Inventory inventory)
               throws ConcurrentInventoryModificationException
Description copied from interface: InventoryService
Persists the inventory

Specified by:
save in interface InventoryService
Throws:
ConcurrentInventoryModificationException

readSkusNotAtFulfillmentLocation

@Transactional(value="blTransactionManager")
public List<org.broadleafcommerce.core.catalog.domain.Sku> readSkusNotAtFulfillmentLocation(FulfillmentLocation fulfillmentLocation)
Description copied from interface: InventoryService
Retrieves skus that do not have inventory records at a particular fulfillment location

Specified by:
readSkusNotAtFulfillmentLocation in interface InventoryService
Returns:


Copyright © 2013. All Rights Reserved.