The InventoryManager is a public interface that contains all of the Inventory system functionality. Each method described below returns an integer status code. All successful return codes should be greater than or equal to zero, all failure codes should be less than zero. By default, the codes are:

Status Code

Description

int INVENTORY_STATUS_SUCCEED=0

There was no problem performing the operation.

int INVENTORY_STATUS_FAIL=-1

There was an unknown/generic problem performing the operation.

int INVENTORY_STATUS_INSUFFICIENT_SUPPLY = -2

The operation could not be completed because there were not enough of the items in the inventory system.

int INVENTORY_STATUS_ITEM_NOT_FOUND = -3

The operation could not be completed because a specified item could not be found in the inventory system.

The methods that effect a change on the backend system return an integer status code. Methods that inspect the backend system return the answer to the query. The status return codes listed above and any implementer-defined status codes usually should be used to convey a definitive answer concerning a method’s success.

When a method succeeds, an answer is prepared for return from the method. When a method fails, you can either return a failure code or throw an exception. In general, a method should return a failure code only if it is determined that the operation will not succeed. For example:

The following table lists all the methods provided by the InventoryManager interface. In methods below, the pID parameter would usually be a SKU ID.

Methods

Exception thrown

int purchase (String pId, long pHowMany)

InventoryException

int purchaseOffBackorder (String pId, long pHowMany)

InventoryException

int purchaseOffPreorder (String pId, long pHowMany)

InventoryException

int preorder (String pId, long pHowMany)

InventoryException

int backorder (String pId, long pHowMany)

InventoryException

int setStocklevel (String pId, long pNumber)

InventoryException

int setBackorderLevel (String pId, long pNumber)

InventoryException

int setPreorderLevel (String pId, long pNumber)

InventoryException

int increaseStocklevel (String pId, long pNumber)

InventoryException

int decreaseStocklevel (String pId, long pNumber)

InventoryException

int increaseBackorderLevel (String pId, long pNumber)

InventoryException

int decreaseBackorderLevel (String pId, long pNumber)

InventoryException

int increasePreorderLevel (String pId, long pNumber)

InventoryException

int decreasePreorderLevel (String pId, long pNumber)

InventoryException

int setStockThreshold (String pId, long pNumber)

InventoryException

int setBackorderThreshold (String pId, long pNumber)

InventoryException

int setPreorderThreshold (String pId, long pNumber)

InventoryException

int setAvailabilityStatus (String pId, int pStatus)

InventoryException

int setAvailabilityDate (String pId, Date pDate)

InventoryException

int queryAvailabilityStatus(String pId)

InventoryException, MissingInventoryItemException

long queryStocklevel(String pId)

InventoryException, MissingInventoryItemException

long queryBackorderLevel(String pId)

InventoryException, MissingInventoryItemException

long queryPreorderLevel(String pId)

InventoryException, MissingInventoryItemException

long queryStockThreshold(String pId)

InventoryException, MissingInventoryItemException

long queryBackorderThreshold(String pId)

InventoryException, MissingInventoryItemException

long queryPreorderThreshold(String pId)

InventoryException, MissingInventoryItemException

Date queryAvailabilityDate(String pId)

InventoryException, MissingInventoryItemException

int inventoryWasUpdated(List pItemIds)

InventoryException

For more information, see the Examples of Using the Inventory Manager section.


Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices