atg.commerce.inventory
Class LocalizingInventoryManager

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.messaging.SourceSinkTemplate
              extended by atg.commerce.inventory.LocalizingInventoryManager
All Implemented Interfaces:
InventoryManager, MessageSink, MessageSource, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class LocalizingInventoryManager
extends SourceSinkTemplate
implements InventoryManager

This class implements InventoryManager for the purpose of localizing inventory. It provides capability to call a particular inventory manager, based on a locale key.


Field Summary
static java.lang.String CLASS_VERSION
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.commerce.inventory.InventoryManager
AVAILABILITY_STATUS_BACKORDERABLE, AVAILABILITY_STATUS_DERIVED, AVAILABILITY_STATUS_DISCONTINUED, AVAILABILITY_STATUS_IN_STOCK, AVAILABILITY_STATUS_OUT_OF_STOCK, AVAILABILITY_STATUS_PREORDERABLE, INVENTORY_STATUS_FAIL, INVENTORY_STATUS_INSUFFICIENT_SUPPLY, INVENTORY_STATUS_ITEM_NOT_FOUND, INVENTORY_STATUS_SUCCEED
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
LocalizingInventoryManager()
           
 
Method Summary
 void acquireInventoryLocks(java.util.List pItemIds)
          Acquires locks for the inventory items that apply to the given ids.
 void acquireInventoryLocks(java.util.List pItemIds, java.lang.String pLocaleKey)
           
 int backorder(java.lang.String pId, long pHowMany)
          Backorder an item.
 int backorder(java.lang.String pId, long pHowMany, java.lang.String pLocaleKey)
           
 int decreaseBackorderLevel(java.lang.String pId, long pNumber)
          Decrease an item's backorder level by the specified amount.
 int decreaseBackorderLevel(java.lang.String pId, long pNumber, java.lang.String pLocaleKey)
           
 int decreasePreorderLevel(java.lang.String pId, long pNumber)
          Decrease an item's preorder level by the specified amount.
 int decreasePreorderLevel(java.lang.String pId, long pNumber, java.lang.String pLocaleKey)
           
 int decreaseStockLevel(java.lang.String pId, long pNumber)
          Decrease an item's stock level by the specified amount.
 int decreaseStockLevel(java.lang.String pId, long pNumber, java.lang.String pLocaleKey)
           
 InventoryManager getDefaultInventoryManager()
          Returns property DefaultInventoryManager
 java.lang.String getDefaultLocaleKey()
           
 InventoryManager getInventoryManager(java.lang.String pLocaleKey)
          Returns an InventoryManager, localized if the localeKey parameter was passed as a parameter to the servlet bean and a map of InventoryManagers has been defined.
 ServiceMap getInventoryManagers()
          Returns property InventoryManagers
 java.lang.String getInventoryName()
          The displayable name of this inventory manager.
 java.lang.String getInventoryName(java.lang.String pLocaleKey)
           
 int increaseBackorderLevel(java.lang.String pId, long pNumber)
          Increase an item's backorder level by the specified number.
 int increaseBackorderLevel(java.lang.String pId, long pNumber, java.lang.String pLocaleKey)
           
 int increasePreorderLevel(java.lang.String pId, long pNumber)
          Increase an item's preorder level by the specified number.
 int increasePreorderLevel(java.lang.String pId, long pNumber, java.lang.String pLocaleKey)
           
 int increaseStockLevel(java.lang.String pId, long pNumber)
          Increase an item's stock level by the specified number.
 int increaseStockLevel(java.lang.String pId, long pNumber, java.lang.String pLocaleKey)
           
 int inventoryWasUpdated(java.util.List pItemIds)
          Informs the inventory manager that the given ids are now available.
 int inventoryWasUpdated(java.util.List pItemIds, java.lang.String pLocaleKey)
           
 boolean isUseDefaultInventoryManager()
          Returns property useDefaultInventoryManager
 int preorder(java.lang.String pId, long pHowMany)
          Preorder an item.
 int preorder(java.lang.String pId, long pHowMany, java.lang.String pLocaleKey)
           
 int purchase(java.lang.String pId, long pHowMany)
          Actually purchases a product.
 int purchase(java.lang.String pId, long pHowMany, java.lang.String pLocaleKey)
           
 int purchaseOffBackorder(java.lang.String pId, long pHowMany)
          Actually purchases a product.
 int purchaseOffBackorder(java.lang.String pId, long pHowMany, java.lang.String pLocaleKey)
           
 int purchaseOffPreorder(java.lang.String pId, long pHowMany)
          Actually purchases a product.
 int purchaseOffPreorder(java.lang.String pId, long pHowMany, java.lang.String pLocaleKey)
           
 java.util.Date queryAvailabilityDate(java.lang.String pId)
          Return the availability date of an item.
 java.util.Date queryAvailabilityDate(java.lang.String pId, java.lang.String pLocaleKey)
           
 int queryAvailabilityStatus(java.lang.String pId)
          Return the availability status of a given item.
 int queryAvailabilityStatus(java.lang.String pId, java.lang.String pLocaleKey)
           
 long queryBackorderLevel(java.lang.String pId)
          Return how many of a given item can be backorder.
 long queryBackorderLevel(java.lang.String pId, java.lang.String pLocaleKey)
           
 long queryBackorderThreshold(java.lang.String pId)
          Return the threshold associated with backorderLevel
 long queryBackorderThreshold(java.lang.String pId, java.lang.String pLocaleKey)
           
 long queryPreorderLevel(java.lang.String pId)
          Return how many of a given item can be preorder.
 long queryPreorderLevel(java.lang.String pId, java.lang.String pLocaleKey)
           
 long queryPreorderThreshold(java.lang.String pId)
          Return the threshold associated with preorderLevel
 long queryPreorderThreshold(java.lang.String pId, java.lang.String pLocaleKey)
           
 long queryStockLevel(java.lang.String pId)
          Return how many of a given item are in the system.
 long queryStockLevel(java.lang.String pId, java.lang.String pLocaleKey)
           
 long queryStockThreshold(java.lang.String pId)
          Return the threshold associated with stockLevel.
 long queryStockThreshold(java.lang.String pId, java.lang.String pLocaleKey)
           
 void releaseInventoryLocks(java.util.List pItemIds)
          Release locks for the inventory items that apply to the given ids.
 void releaseInventoryLocks(java.util.List pItemIds, java.lang.String pLocaleKey)
           
 int setAvailabilityDate(java.lang.String pId, java.util.Date pDate)
          Set an item's availability date.
 int setAvailabilityDate(java.lang.String pId, java.util.Date pDate, java.lang.String pLocaleKey)
           
 int setAvailabilityStatus(java.lang.String pId, int pStatus)
          Set an item's availability status.
 int setAvailabilityStatus(java.lang.String pId, int pStatus, java.lang.String pLocaleKey)
           
 int setBackorderLevel(java.lang.String pId, long pNumber)
          Set an item's backorder level to the specified number.
 int setBackorderLevel(java.lang.String pId, long pNumber, java.lang.String pLocaleKey)
           
 int setBackorderThreshold(java.lang.String pId, long pNumber)
          Set an item's backorder level threshold.
 int setBackorderThreshold(java.lang.String pId, long pNumber, java.lang.String pLocaleKey)
           
 void setDefaultInventoryManager(InventoryManager pDefaultInventoryManager)
          Sets property InventoryManager
 void setDefaultLocaleKey(java.lang.String pDefaultLocaleKey)
          Sets property mDefaultLocalKey
 void setInventoryManagers(ServiceMap pInventoryManagers)
          Sets property InventoryManagers
 int setPreorderLevel(java.lang.String pId, long pNumber)
          Set an item's preorder level to the specified number.
 int setPreorderLevel(java.lang.String pId, long pNumber, java.lang.String pLocaleKey)
           
 int setPreorderThreshold(java.lang.String pId, long pNumber)
          Set an item's preorder level threshold.
 int setPreorderThreshold(java.lang.String pId, long pNumber, java.lang.String pLocaleKey)
           
 int setStockLevel(java.lang.String pId, long pNumber)
          Set an item's stock level to the specified number.
 int setStockLevel(java.lang.String pId, long pNumber, java.lang.String pLocaleKey)
           
 int setStockThreshold(java.lang.String pId, long pNumber)
          Set an item's stock level threshold.
 int setStockThreshold(java.lang.String pId, long pNumber, java.lang.String pLocaleKey)
           
 void setUseDefaultInventoryManager(boolean pUseDefaultInventoryManager)
          Sets property useDefaultInventoryManager.
 
Methods inherited from class atg.commerce.messaging.SourceSinkTemplate
getDelayOnSendRetry, getMessageSourceContext, getMessageSourceName, getTransactionManager, isAllowMessageSending, receiveMessage, sendCommerceMessage, sendObjectMessage, setAllowMessageSending, setDelayOnSendRetry, setMessageSourceContext, setMessageSourceName, setTransactionManager, startMessageSource, stopMessageSource
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

LocalizingInventoryManager

public LocalizingInventoryManager()
Method Detail

setDefaultLocaleKey

public void setDefaultLocaleKey(java.lang.String pDefaultLocaleKey)
Sets property mDefaultLocalKey


getDefaultLocaleKey

public java.lang.String getDefaultLocaleKey()

setDefaultInventoryManager

public void setDefaultInventoryManager(InventoryManager pDefaultInventoryManager)
Sets property InventoryManager


getDefaultInventoryManager

public InventoryManager getDefaultInventoryManager()
Returns property DefaultInventoryManager


setInventoryManagers

public void setInventoryManagers(ServiceMap pInventoryManagers)
Sets property InventoryManagers


getInventoryManagers

public ServiceMap getInventoryManagers()
Returns property InventoryManagers


setUseDefaultInventoryManager

public void setUseDefaultInventoryManager(boolean pUseDefaultInventoryManager)
Sets property useDefaultInventoryManager. Set it to true if you want the default inventory manager to be used in case the requested inventory manager is unavailable. If set to false, then requesting an unavilable alternate inventory manager will result in an error.


isUseDefaultInventoryManager

public boolean isUseDefaultInventoryManager()
Returns property useDefaultInventoryManager


getInventoryName

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

Specified by:
getInventoryName in interface InventoryManager

getInventoryName

public java.lang.String getInventoryName(java.lang.String pLocaleKey)

getInventoryManager

public InventoryManager getInventoryManager(java.lang.String pLocaleKey)
Returns an InventoryManager, localized if the localeKey parameter was passed as a parameter to the servlet bean and a map of InventoryManagers has been defined.


purchase

public 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.

Specified by:
purchase in interface InventoryManager
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.

purchase

public int purchase(java.lang.String pId,
                    long pHowMany,
                    java.lang.String pLocaleKey)
             throws InventoryException
Throws:
InventoryException

purchaseOffBackorder

public 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.

Specified by:
purchaseOffBackorder in interface InventoryManager
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

public int purchaseOffBackorder(java.lang.String pId,
                                long pHowMany,
                                java.lang.String pLocaleKey)
                         throws InventoryException
Throws:
InventoryException

purchaseOffPreorder

public 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.

Specified by:
purchaseOffPreorder in interface InventoryManager
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

public int purchaseOffPreorder(java.lang.String pId,
                               long pHowMany,
                               java.lang.String pLocaleKey)
                        throws InventoryException
Throws:
InventoryException

preorder

public 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.

Specified by:
preorder in interface InventoryManager
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

preorder

public int preorder(java.lang.String pId,
                    long pHowMany,
                    java.lang.String pLocaleKey)
             throws InventoryException
Throws:
InventoryException

backorder

public 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.

Specified by:
backorder in interface InventoryManager
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.

backorder

public int backorder(java.lang.String pId,
                     long pHowMany,
                     java.lang.String pLocaleKey)
              throws InventoryException
Throws:
InventoryException

setStockLevel

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

Specified by:
setStockLevel in interface InventoryManager
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

setStockLevel

public int setStockLevel(java.lang.String pId,
                         long pNumber,
                         java.lang.String pLocaleKey)
                  throws InventoryException
Throws:
InventoryException

setBackorderLevel

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

Specified by:
setBackorderLevel in interface InventoryManager
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

public int setBackorderLevel(java.lang.String pId,
                             long pNumber,
                             java.lang.String pLocaleKey)
                      throws InventoryException
Throws:
InventoryException

setPreorderLevel

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

Specified by:
setPreorderLevel in interface InventoryManager
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

public int setPreorderLevel(java.lang.String pId,
                            long pNumber,
                            java.lang.String pLocaleKey)
                     throws InventoryException
Throws:
InventoryException

increaseStockLevel

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

Specified by:
increaseStockLevel in interface InventoryManager
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

increaseStockLevel

public int increaseStockLevel(java.lang.String pId,
                              long pNumber,
                              java.lang.String pLocaleKey)
                       throws InventoryException
Throws:
InventoryException

decreaseStockLevel

public 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.

Specified by:
decreaseStockLevel in interface InventoryManager
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

decreaseStockLevel

public int decreaseStockLevel(java.lang.String pId,
                              long pNumber,
                              java.lang.String pLocaleKey)
                       throws InventoryException
Throws:
InventoryException

increaseBackorderLevel

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

Specified by:
increaseBackorderLevel in interface InventoryManager
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

increaseBackorderLevel

public int increaseBackorderLevel(java.lang.String pId,
                                  long pNumber,
                                  java.lang.String pLocaleKey)
                           throws InventoryException
Throws:
InventoryException

decreaseBackorderLevel

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

Specified by:
decreaseBackorderLevel in interface InventoryManager
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

decreaseBackorderLevel

public int decreaseBackorderLevel(java.lang.String pId,
                                  long pNumber,
                                  java.lang.String pLocaleKey)
                           throws InventoryException
Throws:
InventoryException

increasePreorderLevel

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

Specified by:
increasePreorderLevel in interface InventoryManager
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

increasePreorderLevel

public int increasePreorderLevel(java.lang.String pId,
                                 long pNumber,
                                 java.lang.String pLocaleKey)
                          throws InventoryException
Throws:
InventoryException

decreasePreorderLevel

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

Specified by:
decreasePreorderLevel in interface InventoryManager
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

decreasePreorderLevel

public int decreasePreorderLevel(java.lang.String pId,
                                 long pNumber,
                                 java.lang.String pLocaleKey)
                          throws InventoryException
Throws:
InventoryException

setStockThreshold

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

Specified by:
setStockThreshold in interface InventoryManager
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

setStockThreshold

public int setStockThreshold(java.lang.String pId,
                             long pNumber,
                             java.lang.String pLocaleKey)
                      throws InventoryException
Throws:
InventoryException

setBackorderThreshold

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

Specified by:
setBackorderThreshold in interface InventoryManager
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

public int setBackorderThreshold(java.lang.String pId,
                                 long pNumber,
                                 java.lang.String pLocaleKey)
                          throws InventoryException
Throws:
InventoryException

setPreorderThreshold

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

Specified by:
setPreorderThreshold in interface InventoryManager
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

public int setPreorderThreshold(java.lang.String pId,
                                long pNumber,
                                java.lang.String pLocaleKey)
                         throws InventoryException
Throws:
InventoryException

setAvailabilityStatus

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

Specified by:
setAvailabilityStatus in interface InventoryManager
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

setAvailabilityStatus

public int setAvailabilityStatus(java.lang.String pId,
                                 int pStatus,
                                 java.lang.String pLocaleKey)
                          throws InventoryException
Throws:
InventoryException

setAvailabilityDate

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

Specified by:
setAvailabilityDate in interface InventoryManager
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

setAvailabilityDate

public int setAvailabilityDate(java.lang.String pId,
                               java.util.Date pDate,
                               java.lang.String pLocaleKey)
                        throws InventoryException
Throws:
InventoryException

queryAvailabilityStatus

public 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:

Specified by:
queryAvailabilityStatus in interface InventoryManager
Returns:
AVAILABILITY_STATUS_IN_STOCK
Throws:
InventoryException - if there was a problem determining the status of the item

queryAvailabilityStatus

public int queryAvailabilityStatus(java.lang.String pId,
                                   java.lang.String pLocaleKey)
                            throws InventoryException
Throws:
InventoryException

queryStockLevel

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

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

queryStockLevel

public long queryStockLevel(java.lang.String pId,
                            java.lang.String pLocaleKey)
                     throws InventoryException
Throws:
InventoryException

queryBackorderLevel

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

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

queryBackorderLevel

public long queryBackorderLevel(java.lang.String pId,
                                java.lang.String pLocaleKey)
                         throws InventoryException
Throws:
InventoryException

queryPreorderLevel

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

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

queryPreorderLevel

public long queryPreorderLevel(java.lang.String pId,
                               java.lang.String pLocaleKey)
                        throws InventoryException
Throws:
InventoryException

queryStockThreshold

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

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

queryStockThreshold

public long queryStockThreshold(java.lang.String pId,
                                java.lang.String pLocaleKey)
                         throws InventoryException
Throws:
InventoryException

queryBackorderThreshold

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

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

queryBackorderThreshold

public long queryBackorderThreshold(java.lang.String pId,
                                    java.lang.String pLocaleKey)
                             throws InventoryException
Throws:
InventoryException

queryPreorderThreshold

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

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

queryPreorderThreshold

public long queryPreorderThreshold(java.lang.String pId,
                                   java.lang.String pLocaleKey)
                            throws InventoryException
Throws:
InventoryException

queryAvailabilityDate

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

Specified by:
queryAvailabilityDate in interface InventoryManager
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

queryAvailabilityDate

public java.util.Date queryAvailabilityDate(java.lang.String pId,
                                            java.lang.String pLocaleKey)
                                     throws InventoryException
Throws:
InventoryException

inventoryWasUpdated

public 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.

Specified by:
inventoryWasUpdated in interface InventoryManager
Parameters:
pItemIds - The items with recently added inventory
Throws:
InventoryException

inventoryWasUpdated

public int inventoryWasUpdated(java.util.List pItemIds,
                               java.lang.String pLocaleKey)
                        throws InventoryException
Throws:
InventoryException

acquireInventoryLocks

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

Specified by:
acquireInventoryLocks in interface InventoryManager
Throws:
InventoryException

acquireInventoryLocks

public void acquireInventoryLocks(java.util.List pItemIds,
                                  java.lang.String pLocaleKey)
                           throws InventoryException
Throws:
InventoryException

releaseInventoryLocks

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

Specified by:
releaseInventoryLocks in interface InventoryManager
Throws:
InventoryException

releaseInventoryLocks

public void releaseInventoryLocks(java.util.List pItemIds,
                                  java.lang.String pLocaleKey)
                           throws InventoryException
Throws:
InventoryException