atg.commerce.inventory
Class InventoryServices

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.inventory.InventoryServices
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class InventoryServices
extends GenericService

Helper methods to access and enhance InventoryManager services.

Inventory accessed by these helper methods is determined by the property getInventoryManager().

See Also:
SimpleInventoryInfo, InventoryManager

Field Summary
static java.lang.String CLASS_VERSION
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
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
InventoryServices()
           
 
Method Summary
protected  java.lang.String getAvailabilityStatusMsg(int pCode)
          Return a String message that should correspond to the supplied code.
 SimpleInventoryInfo[] getInventory(java.lang.String[] pSkuIds)
          This method will return a SimpleInventoryInfo object for each of the given skus.
 InventoryManager getInventoryManager()
          Returns InventoryManager component to query against
 java.lang.String[] getInventoryStatus(java.lang.String[] pSkuIds)
          This method will return an inventory status message for each of the given skus.
 void setInventoryManager(InventoryManager pInventoryManager)
          Sets InventoryManager component to query against
 void setStockLevel(java.lang.String pSkuId, long pStockLevel)
          This method will update the stock level for the given sku.
 void setStockLevels(java.lang.String[] pSkuIds, long[] pStockLevels)
          This method will update each of the given sku ids with the new given stock level.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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

InventoryServices

public InventoryServices()
Method Detail

getInventoryManager

public InventoryManager getInventoryManager()
Returns InventoryManager component to query against

Returns:
the InventoryManager

setInventoryManager

public void setInventoryManager(InventoryManager pInventoryManager)
Sets InventoryManager component to query against

Parameters:
InventoryManager -

getInventory

public SimpleInventoryInfo[] getInventory(java.lang.String[] pSkuIds)
                                   throws InventoryException
This method will return a SimpleInventoryInfo object for each of the given skus.

Parameters:
pSkuIds - The array of sku ids whose info is returned
Returns:
An array of SimpleInventoryInfo objects that is the same length as the input
Throws:
InventoryException - Thrown if any of the skus is invalid, or for some other problem.

getInventoryStatus

public java.lang.String[] getInventoryStatus(java.lang.String[] pSkuIds)
                                      throws InventoryException
This method will return an inventory status message for each of the given skus.

Parameters:
pSkuIds - The array of sku ids whose status will be return
Returns:
An array of status messages
Throws:
InventoryException
See Also:
getAvailabilityStatusMsg(int)

setStockLevels

public void setStockLevels(java.lang.String[] pSkuIds,
                           long[] pStockLevels)
                    throws InventoryException
This method will update each of the given sku ids with the new given stock level. Each entry in pStockLevels corresponds to an id in pSkuIds

Parameters:
pSkuIds - An array of sku ids being updated
pStockLevels - An array the same length as pSkuIds
Throws:
InventoryException

setStockLevel

public void setStockLevel(java.lang.String pSkuId,
                          long pStockLevel)
                   throws InventoryException
This method will update the stock level for the given sku.

Parameters:
pSkuId - The sku being updated
pStockLevel - The new stock level
Throws:
InventoryException

getAvailabilityStatusMsg

protected java.lang.String getAvailabilityStatusMsg(int pCode)
Return a String message that should correspond to the supplied code. Currently the code to String mapping is as follows: