atg.commerce.inventory
Interface InventoryManager

All Known Implementing Classes:
AbstractInventoryManagerImpl, CachingInventoryManager, LocalizingInventoryManager, NoInventoryManager, RepositoryInventoryManager

public interface InventoryManager

This interface describes an inventory manager. It provides capability to interact with a backend inventory system in three types of ways: -Inspect the inventory system -Alter the state of the inventory system -Inspect how users have been using the system


Field Summary
static int AVAILABILITY_STATUS_BACKORDERABLE
          Constant value for an item's "backorderable" state.
static int AVAILABILITY_STATUS_DERIVED
          Constant value specifying that the items availability status is derived.
static int AVAILABILITY_STATUS_DISCONTINUED
          Constant value for an item's "discontinued" state.
static int AVAILABILITY_STATUS_IN_STOCK
          Constant value for an item's "in stock" state.
static int AVAILABILITY_STATUS_OUT_OF_STOCK
          Constant value for an item's "out of stock" state.
static int AVAILABILITY_STATUS_PREORDERABLE
          Constant value for an item's "preorderable" state.
static java.lang.String CLASS_VERSION
           
static int INVENTORY_STATUS_FAIL
          Signifies a failed method call.
static int INVENTORY_STATUS_INSUFFICIENT_SUPPLY
          Signifies that the procedure failed because the inventory system is out of the item(s)
static int INVENTORY_STATUS_ITEM_NOT_FOUND
          Signifies that the procedure failed because the item wasn't found
static int INVENTORY_STATUS_SUCCEED
          Signifies a successful method call.
 
Method Summary
 void acquireInventoryLocks(java.util.List pItemIds)
          Acquires locks for the inventory items that apply to the given ids.
 int backorder(java.lang.String pId, long pHowMany)
          Backorder an item.
 int decreaseBackorderLevel(java.lang.String pId, long pNumber)
          Decrease an item's backorder level by the specified amount.
 int decreasePreorderLevel(java.lang.String pId, long pNumber)
          Decrease an item's preorder level by the specified amount.
 int decreaseStockLevel(java.lang.String pId, long pNumber)
          Decrease an item's stock level by the specified amount.
 java.lang.String getInventoryName()
          The displayable name of this inventory manager.
 int increaseBackorderLevel(java.lang.String pId, long pNumber)
          Increase an item's backorder level by the specified number.
 int increasePreorderLevel(java.lang.String pId, long pNumber)
          Increase an item's preorder level by the specified number.
 int increaseStockLevel(java.lang.String pId, long pNumber)
          Increase an item's stock level by the specified number.
 int inventoryWasUpdated(java.util.List pItemIds)
          Informs the inventory manager that the given ids are now available.
 int preorder(java.lang.String pId, long pHowMany)
          Preorder an item.
 int purchase(java.lang.String pId, long pHowMany)
          Actually purchases a product.
 int purchaseOffBackorder(java.lang.String pId, long pHowMany)
          Actually purchases a product.
 int purchaseOffPreorder(java.lang.String pId, long pHowMany)
          Actually purchases a product.
 java.util.Date queryAvailabilityDate(java.lang.String pId)
          Return the availability date of an item.
 int queryAvailabilityStatus(java.lang.String pId)
          Return the availability status of a given item.
 long queryBackorderLevel(java.lang.String pId)
          Return how many of a given item can be backorder.
 long queryBackorderThreshold(java.lang.String pId)
          Return the threshold associated with backorderLevel
 long queryPreorderLevel(java.lang.String pId)
          Return how many of a given item can be preorder.
 long queryPreorderThreshold(java.lang.String pId)
          Return the threshold associated with preorderLevel
 long queryStockLevel(java.lang.String pId)
          Return how many of a given item are in the system.
 long queryStockThreshold(java.lang.String pId)
          Return the threshold associated with stockLevel.
 void releaseInventoryLocks(java.util.List pItemIds)
          Release locks for the inventory items that apply to the given ids.
 int setAvailabilityDate(java.lang.String pId, java.util.Date pDate)
          Set an item's availability date.
 int setAvailabilityStatus(java.lang.String pId, int pStatus)
          Set an item's availability status.
 int setBackorderLevel(java.lang.String pId, long pNumber)
          Set an item's backorder level to the specified number.
 int setBackorderThreshold(java.lang.String pId, long pNumber)
          Set an item's backorder level threshold.
 int setPreorderLevel(java.lang.String pId, long pNumber)
          Set an item's preorder level to the specified number.
 int setPreorderThreshold(java.lang.String pId, long pNumber)
          Set an item's preorder level threshold.
 int setStockLevel(java.lang.String pId, long pNumber)
          Set an item's stock level to the specified number.
 int setStockThreshold(java.lang.String pId, long pNumber)
          Set an item's stock level threshold.
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values

AVAILABILITY_STATUS_IN_STOCK

static final int AVAILABILITY_STATUS_IN_STOCK
Constant value for an item's "in stock" state. value: 1000

See Also:
Constant Field Values

AVAILABILITY_STATUS_OUT_OF_STOCK

static final int AVAILABILITY_STATUS_OUT_OF_STOCK
Constant value for an item's "out of stock" state. value: 1001

See Also:
Constant Field Values

AVAILABILITY_STATUS_PREORDERABLE

static final int AVAILABILITY_STATUS_PREORDERABLE
Constant value for an item's "preorderable" state. value: 1002

See Also:
Constant Field Values

AVAILABILITY_STATUS_BACKORDERABLE

static final int AVAILABILITY_STATUS_BACKORDERABLE
Constant value for an item's "backorderable" state. value: 1003

See Also:
Constant Field Values

AVAILABILITY_STATUS_DERIVED

static final int AVAILABILITY_STATUS_DERIVED
Constant value specifying that the items availability status is derived. value: 1004

See Also:
Constant Field Values

AVAILABILITY_STATUS_DISCONTINUED

static final int AVAILABILITY_STATUS_DISCONTINUED
Constant value for an item's "discontinued" state. value: 1005

See Also:
Constant Field Values

INVENTORY_STATUS_SUCCEED

static final int INVENTORY_STATUS_SUCCEED
Signifies a successful method call. value: 1

See Also:
Constant Field Values

INVENTORY_STATUS_FAIL

static final int INVENTORY_STATUS_FAIL
Signifies a failed method call. value: -1

See Also:
Constant Field Values

INVENTORY_STATUS_INSUFFICIENT_SUPPLY

static final int INVENTORY_STATUS_INSUFFICIENT_SUPPLY
Signifies that the procedure failed because the inventory system is out of the item(s)

See Also:
Constant Field Values

INVENTORY_STATUS_ITEM_NOT_FOUND

static final int INVENTORY_STATUS_ITEM_NOT_FOUND
Signifies that the procedure failed because the item wasn't found

See Also:
Constant Field Values
Method Detail

getInventoryName

java.lang.String getInventoryName()
The displayable name of this inventory manager.


purchase

int purchase(java.lang.String pId,
             long pHowMany)
             throws InventoryException
Actually purchases a product. The backend inventory system should register that a purchase has been made.

Parameters:
pId - the id of the item involved
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem during the purchase process.

purchaseOffBackorder

int purchaseOffBackorder(java.lang.String pId,
                         long pHowMany)
                         throws InventoryException
Actually purchases a product. The backend inventory system should register that a purchase has been made. If the purchase succeeds, the item's backorderLevel is increased appropriately.

Parameters:
pId - the id of the item involved
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem during the purchase process.

purchaseOffPreorder

int purchaseOffPreorder(java.lang.String pId,
                        long pHowMany)
                        throws InventoryException
Actually purchases a product. The backend inventory system should register that a purchase has been made. If the purchase succeeds, the item's preorderLevel is increased appropriately.

Parameters:
pId - the id of the item involved
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem during the purchase process.

preorder

int preorder(java.lang.String pId,
             long pHowMany)
             throws InventoryException
Preorder an item. The usual implication of preordering is that the retailer has never had the item in stock, but promises to have the item soon.

Parameters:
pId - the id of the item involved
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem in trying to preorder the item

backorder

int backorder(java.lang.String pId,
              long pHowMany)
              throws InventoryException
Backorder an item. The usual implication of this is very similar to preorder, except that the store did at one time have this item, it's just out of it now.

Parameters:
pId - the id of the item involved
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem with the backordering process.

setStockLevel

int setStockLevel(java.lang.String pId,
                  long pNumber)
                  throws InventoryException
Set an item's stock level to the specified number.

Parameters:
pId - the id of the item involved
pNumber - the number of the given item to restock
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem trying to restock

setBackorderLevel

int setBackorderLevel(java.lang.String pId,
                      long pNumber)
                      throws InventoryException
Set an item's backorder level to the specified number.

Parameters:
pId - the id of the item involved
pNumber - the number of the given item to restock
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem trying to restock

setPreorderLevel

int setPreorderLevel(java.lang.String pId,
                     long pNumber)
                     throws InventoryException
Set an item's preorder level to the specified number.

Parameters:
pId - the id of the item involved
pNumber - the number of the given item to restock
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem trying to restock

increaseStockLevel

int increaseStockLevel(java.lang.String pId,
                       long pNumber)
                       throws InventoryException
Increase an item's stock level by the specified number.

Parameters:
pId - the id of the item involved
pNumber - the number of items to add to the current stock level
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem trying to restock

decreaseStockLevel

int decreaseStockLevel(java.lang.String pId,
                       long pNumber)
                       throws InventoryException
Decrease an item's stock level by the specified amount. This method is to be used for inventory adjustments, not for purchases. For purchases, use the purchase(String pId, long pHowMany) method.

Parameters:
pId - the id of the item involved
pNumber - the number of items to decrease from the current stock level
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem trying to restock

increaseBackorderLevel

int increaseBackorderLevel(java.lang.String pId,
                           long pNumber)
                           throws InventoryException
Increase an item's backorder level by the specified number.

Parameters:
pId - the id of the item involved
pNumber - the number of items to add to the current stock level
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem trying to restock

decreaseBackorderLevel

int decreaseBackorderLevel(java.lang.String pId,
                           long pNumber)
                           throws InventoryException
Decrease an item's backorder level by the specified amount.

Parameters:
pId - the id of the item involved
pNumber - the number of items to decrease from the current stock level
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem trying to restock

increasePreorderLevel

int increasePreorderLevel(java.lang.String pId,
                          long pNumber)
                          throws InventoryException
Increase an item's preorder level by the specified number.

Parameters:
pId - the id of the item involved
pNumber - the number of items to add to the current stock level
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem trying to restock

decreasePreorderLevel

int decreasePreorderLevel(java.lang.String pId,
                          long pNumber)
                          throws InventoryException
Decrease an item's preorder level by the specified amount.

Parameters:
pId - the id of the item involved
pNumber - the number of items to decrease from the current stock level
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem trying to restock

setStockThreshold

int setStockThreshold(java.lang.String pId,
                      long pNumber)
                      throws InventoryException
Set an item's stock level threshold.

Parameters:
pId - the id of the item involved
pNumber - the number of the given item to restock
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem trying to restock

setBackorderThreshold

int setBackorderThreshold(java.lang.String pId,
                          long pNumber)
                          throws InventoryException
Set an item's backorder level threshold.

Parameters:
pId - the id of the item involved
pNumber - the number of the given item to restock
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem trying to restock

setPreorderThreshold

int setPreorderThreshold(java.lang.String pId,
                         long pNumber)
                         throws InventoryException
Set an item's preorder level threshold.

Parameters:
pId - the id of the item involved
pNumber - the number of the given item to restock
Returns:
INVENTORY_STATUS_SUCCEED or INVENTORY_STATUS_FAIL
Throws:
InventoryException - if there was a problem trying to restock

setAvailabilityStatus

int setAvailabilityStatus(java.lang.String pId,
                          int pStatus)
                          throws InventoryException
Set an item's availability status.

Parameters:
pId - the id of the item involved
pStatus - the new status (one of AVAILABILITY_STATUS_IN_STOCK, AVAILABILITY_STATUS_BACKORDERABLE, AVAILABILITY_STATUS_PREORDERABLE, AVAILABILITY_STATUS_OUT_OF_STOCK, AVAILABILITY_STATUS_DISCONTINUED, or AVAILABILITY_STATUS_DERIVED)
Returns:
INVENTORY_STATUS_SUCCEED, INVENTORY_STATUS_ITEM_NOT_FOUND, or INVENTORY_STATUS_FAIL
Throws:
InventoryException

setAvailabilityDate

int setAvailabilityDate(java.lang.String pId,
                        java.util.Date pDate)
                        throws InventoryException
Set an item's availability date.

Parameters:
pId - the id of the item involved
pDate - The new availability date for the item.
Returns:
INVENTORY_STATUS_SUCCEED, INVENTORY_STATUS_ITEM_NOT_FOUND, or INVENTORY_STATUS_FAIL
Throws:
InventoryException

queryAvailabilityStatus

int queryAvailabilityStatus(java.lang.String pId)
                            throws InventoryException
Return the availability status of a given item. If an item has a status of DERIVED, then the return value is calculated. Otherwise the existing status is returned. An item can be in one of four states:

Returns:
AVAILABILITY_STATUS_IN_STOCK
Throws:
InventoryException - if there was a problem determining the status of the item

queryStockLevel

long queryStockLevel(java.lang.String pId)
                     throws InventoryException
Return how many of a given item are in the system.

Returns:
how many items, with the given id, are available for purchase
Throws:
InventoryException - if there was a problem determining the number

queryBackorderLevel

long queryBackorderLevel(java.lang.String pId)
                         throws InventoryException
Return how many of a given item can be backorder.

Returns:
how many items, with the given id, are available for purchase
Throws:
InventoryException - if there was a problem determining the number

queryPreorderLevel

long queryPreorderLevel(java.lang.String pId)
                        throws InventoryException
Return how many of a given item can be preorder.

Returns:
how many items, with the given id, are available for purchase
Throws:
InventoryException - if there was a problem determining the number

queryStockThreshold

long queryStockThreshold(java.lang.String pId)
                         throws InventoryException
Return the threshold associated with stockLevel.

Returns:
how many items, with the given id, are available for purchase
Throws:
InventoryException - if there was a problem determining the number

queryBackorderThreshold

long queryBackorderThreshold(java.lang.String pId)
                             throws InventoryException
Return the threshold associated with backorderLevel

Returns:
how many items, with the given id, are available for purchase
Throws:
InventoryException - if there was a problem determining the number

queryPreorderThreshold

long queryPreorderThreshold(java.lang.String pId)
                            throws InventoryException
Return the threshold associated with preorderLevel

Returns:
how many items, with the given id, are available for purchase
Throws:
InventoryException - if there was a problem determining the number

queryAvailabilityDate

java.util.Date queryAvailabilityDate(java.lang.String pId)
                                     throws InventoryException
Return the availability date of an item.

Returns:
the date that the item will be available for puchase if the item's availability status is not AVAILABILITY_STATUS_IN_STOCK. If the item's availability status is AVAILABILITY_STATUS_IN_STOCK, then we return null.
Throws:
InventoryException - if there was a problem determining the date

inventoryWasUpdated

int inventoryWasUpdated(java.util.List pItemIds)
                        throws InventoryException
Informs the inventory manager that the given ids are now available. Some implementations of the InventoryManager may send a message informing other systems that some items that were previously unavailable are now available. No changes are made to the inventory.

Parameters:
pItemIds - The items with recently added inventory
Throws:
InventoryException

acquireInventoryLocks

void acquireInventoryLocks(java.util.List pItemIds)
                           throws InventoryException
Acquires locks for the inventory items that apply to the given ids.

Throws:
InventoryException

releaseInventoryLocks

void releaseInventoryLocks(java.util.List pItemIds)
                           throws InventoryException
Release locks for the inventory items that apply to the given ids.

Throws:
InventoryException