public class RepositoryInventoryManager extends SourceSinkTemplate implements atg.commerce.inventory.LocationInventoryManager
This is a repository based implementation of InventoryManager. It implements all the methods defined by the InventoryManager API. It is a thin wrapper around a repository that contains the inventory information. This allows a maximum amount of flexibility for potential third party integrators. Integrators can simply implement a repository containing the required properties for cooperation with the RepositoryInventoryManager. The Repository InventoryManager can then be configured to extract inventory manager information from the third party repository.
This class also is a message source. It can send UpdateInventory messages if there is new inventory available for a previously unavailable item.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION |
SERVICE_INFO_KEYAVAILABILITY_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_SUCCEEDDEFAULT_LOG_TRACE_STATUSDEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS| Constructor and Description |
|---|
RepositoryInventoryManager() |
| Modifier and Type | Method and Description |
|---|---|
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 pLocationId)
For each item in the list, call
lock
The locks are acquired in sorted order. |
int |
backorder(java.lang.String pId,
long pHowMany)
Backorder an item.
|
int |
backorder(java.lang.String pId,
long pHowMany,
java.lang.String pLocationId)
decrement the item's backorder count,
If the item is a bundle backorderBundle is called.
|
protected int |
backorderBundle(java.lang.String pBundleId,
long pHowMany,
java.lang.String pLocationId)
Backorders a bundle.
|
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 pLocationId)
decrease the item's backorder level by pNumber,
If the item is a bundle, this method does nothing
and returns INVENTORY_STATUS_SUCCEED.
|
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 pLocationId)
decrease the item's preorder level by pNumber,
If the item is a bundle, this method does nothing
and returns INVENTORY_STATUS_SUCCEED.
|
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 pLocationId)
decrease the item's stock level by pNumber,
If the item is a bundle, this method does nothing
and returns INVENTORY_STATUS_SUCCEED.
|
protected int |
decrementSKULevel(MutableRepositoryItem pItem,
long pHowMany,
java.lang.String pLevelName,
java.lang.String pThresholdName)
Decrement the given level by the given amount.
|
protected int |
decrementSKULevel(MutableRepositoryItem pItem,
java.lang.String pLocationId,
long pHowMany,
java.lang.String pLevelName,
java.lang.String pThresholdName) |
protected int |
deriveAvailabilityStatus(java.lang.String pId)
Derive the availabilityStatus based on the properties of the item
Always derives the status, does not check the current value of
availabilityStatus.
|
protected int |
deriveAvailabilityStatus(java.lang.String pId,
java.lang.String pLocationId)
Derive the availabilityStatus based on the properties of the item
Always derives the status, does not check the current value of
availabilityStatus.
|
protected int |
deriveBundleAvailabilityStatus(java.lang.String pBundleId)
Derives the availability status for a bundle.
|
protected int |
deriveBundleAvailabilityStatus(java.lang.String pBundleId,
java.lang.String pLocationId)
Derives the availability status for a bundle.
|
java.lang.String |
getATPDatePropertyName()
Returns property ATPDatePropertyName
|
java.lang.String |
getATPInformationPropertyName()
Returns property ATPInformationPropertyName
|
java.lang.String |
getATPQuantityPropertyName()
Returns property ATPQuantityPropertyName
|
java.lang.String |
getAvailabilityDatePropertyName()
Returns property AvailabilityDatePropertyName
|
int |
getAvailabilityStatusBackorderableValue()
The integer value for the availabilityStatus of BACKORDERABLE
|
int |
getAvailabilityStatusDerivedValue()
The integer value for the availabilityStatus of DERIVED
|
int |
getAvailabilityStatusDiscontinuedValue()
The integer value for the availabilityStatus of DISCONTINUED
|
int |
getAvailabilityStatusInStockValue()
The integer value for the availabilityStatus of IN_STOCK
|
int |
getAvailabilityStatusOutOfStockValue()
The integer value for the availabilityStatus of OUT_OF_STOCK
|
int |
getAvailabilityStatusPreorderableValue()
The integer value for the availabilityStatus of PREORDERABLE
|
java.lang.String |
getAvailabilityStatusPropertyName()
Returns property AvailabilityStatusPropertyName
|
java.lang.String |
getBackorderLevelPropertyName()
Returns property BackorderLevelPropertyName
|
java.lang.String |
getBackorderThresholdPropertyName()
Returns property BackorderThresholdPropertyName
|
java.util.List |
getBundledIds(java.lang.String pBundleId)
Return the list of catalog ref ids contained in the bundle.
|
protected java.util.List |
getBundleLinks(RepositoryItem pBundle)
Return the List of bundle links for the given id.
|
protected java.util.List |
getBundleLinks(java.lang.String pId)
Return the List of bundle links for the given id.
|
java.lang.String |
getBundleLinksPropertyName()
The name of the property bundleLinks
|
RqlStatement |
getCatalogRefIdMatchQuery()
Returns property CatalogRefIdMatchQuery
|
java.lang.String |
getCatalogRefIdPropertyName()
Returns property CatalogRefIdPropertyName
|
protected RepositoryItem |
getCatalogRefItem(java.lang.String pId)
Return the RepositoryItem which represents the catalog ref (aka SKU)
|
java.lang.String |
getCatalogRefItemType()
Returns property CatalogRefItemType
|
Repository |
getCatalogRefRepository()
Returns property CatalogRefRepository
|
ClientLockManager |
getClientLockManager()
Deprecated.
locks are no longer used
|
long |
getDefaultBackorderLevel()
The default value if the backorder level of an item is not defined
|
long |
getDefaultPreorderLevel()
The default value if the preorder level of an item is not defined
|
long |
getDefaultStockLevel()
The default value if the stock level of an item is not defined
|
java.lang.String |
getInventoryEventPort()
The port to which all inventory scenario events are sent.
|
protected RepositoryItem |
getInventoryItem(java.lang.String pId)
Return the RepositoryItem which represents the inventory information
|
protected RepositoryItem |
getInventoryItem(java.lang.String pId,
java.lang.String pLocationId)
Return the RepositoryItem which represents the inventory information
|
protected MutableRepositoryItem |
getInventoryItemForUpdate(java.lang.String pId)
Return the MutableRepositoryItem which represents the inventory information
|
protected MutableRepositoryItem |
getInventoryItemForUpdate(java.lang.String pId,
java.lang.String pLocationId)
Return the MutableRepositoryItem which represents the inventory information
|
java.lang.String |
getInventoryName()
A displayable name for this inventory manager.
|
java.lang.String |
getInventoryRowLockProperty()
The name of the property of inventory that is used to grab a row lock
|
java.lang.String |
getInventoryRowLockSQL()
The sql command that is used to grab the row lock
|
java.lang.String |
getItemType()
Returns property ItemType
|
RqlStatement |
getLocationCatalogRefIdMatchQuery()
Returns property CatalogRefIdMatchQuery
|
java.lang.String |
getLocationInventoryRowLockSQL()
The sql command that is used to grab the row lock for a non-null inventory
location.
|
int |
getMaximumRetriesPerRowLock() |
IdGenerator |
getMessageIdGenerator()
The service that generates Ids for all messages.
|
java.lang.String |
getMessageIdSpaceName()
The name of the idspace to get our message ids from
|
int |
getMillisecondDelayBeforeLockRetry() |
java.lang.String |
getNextMessageId()
Returns the next unique Id for commerce messages.
|
java.lang.String |
getPreorderLevelPropertyName()
Returns property PreorderLevelPropertyName
|
java.lang.String |
getPreorderThresholdPropertyName()
Returns property PreorderThresholdPropertyName
|
MutableRepository |
getRepository()
Returns property Repository
|
java.lang.String |
getSkuLinkItemPropertyName()
the name of the item property in a sku link.
|
java.lang.String |
getSkuLinkQuantityPropertyName()
The name of the quantity property in a sku link
|
java.lang.String |
getStockLevelPropertyName()
Returns property StockLevelPropertyName
|
java.lang.String |
getStockThresholdPropertyName()
Returns property StockThresholdPropertyName
|
java.lang.String |
getUpdateInventoryPort()
The port to which all UpdateInventory messages are sent.
|
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 pLocationId)
increase the item's backorder level by pNumber,
If the item is a bundle, this method does nothing
and returns INVENTORY_STATUS_SUCCEED.
|
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 pLocationId)
increase the item's preorder level by pNumber,
If the item is a bundle, this method does nothing
and returns INVENTORY_STATUS_SUCCEED.
|
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 pLocationId)
increase the item's stock level by pNumber,
If the item is a bundle, this method does nothing
and returns INVENTORY_STATUS_SUCCEED.
|
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 pLocationId)
Send an UpdateInventory message out the UpdateInventoryPort.
|
protected boolean |
isBundle(java.lang.String pId)
Checks to see if the given id refers to a bundle.
|
protected void |
lock(java.lang.String pItemId)
To allow multiple instance of Dynamo to simultaneously edit inventory
items, we need to make sure the repository item we load is current.
|
protected void |
lock(java.lang.String pItemId,
java.lang.String pLocationId)
To allow multiple instance of Dynamo to simultaneously edit inventory
items, we need to make sure the repository item we load is current.
|
int |
preorder(java.lang.String pId,
long pHowMany)
Preorder an item.
|
int |
preorder(java.lang.String pId,
long pHowMany,
java.lang.String pLocationId)
decrement the item's preorder count,
If the item is a bundle preorderBundle is called.
|
protected int |
preorderBundle(java.lang.String pBundleId,
long pHowMany)
Preorders a bundle.
|
protected int |
preorderBundle(java.lang.String pBundleId,
long pHowMany,
java.lang.String pLocationId) |
int |
purchase(java.lang.String pId,
long pHowMany)
Actually purchases a product.
|
int |
purchase(java.lang.String pId,
long pHowMany,
java.lang.String pLocationId)
Check the availability status (queryAvailabilityStatus).
|
protected int |
purchaseBundle(java.lang.String pBundleId,
long pHowMany)
Purchases a bundle by purchase each of its bundle items.
|
protected int |
purchaseBundle(java.lang.String pBundleId,
long pHowMany,
java.lang.String pLocationId)
Purchases a bundle by purchase each of its bundle items.
|
protected int |
purchaseBundleOffBackorder(java.lang.String pBundleId,
long pHowMany)
Purchases the bundle then increments the backorderLevel
of each item in the bundle.
|
protected int |
purchaseBundleOffBackorder(java.lang.String pBundleId,
long pHowMany,
java.lang.String pLocationId)
Purchases the bundle then increments the backorderLevel
of each item in the bundle.
|
protected int |
purchaseBundleOffPreorder(java.lang.String pBundleId,
long pHowMany)
Purchases the bundle and increments the preorderLevel of each
item in the bundle.
|
protected int |
purchaseBundleOffPreorder(java.lang.String pBundleId,
long pHowMany,
java.lang.String pLocationId)
Purchases the bundle and increments the preorderLevel of each
item in the bundle.
|
int |
purchaseOffBackorder(java.lang.String pId,
long pHowMany)
Actually purchases a product.
|
int |
purchaseOffBackorder(java.lang.String pId,
long pHowMany,
java.lang.String pLocationId)
Check the availability status (queryAvailabilityStatus).
|
int |
purchaseOffPreorder(java.lang.String pId,
long pHowMany)
Actually purchases a product.
|
int |
purchaseOffPreorder(java.lang.String pId,
long pHowMany,
java.lang.String pLocationId)
Check the availability status (queryAvailabilityStatus).
|
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 pLocationId)
query the availability date of an item.
|
int |
queryAvailabilityStatus(java.lang.String pId)
Return the availability status of a given item.
|
int |
queryAvailabilityStatus(java.lang.String pId,
java.lang.String pLocationId)
Returns the availability status of the item.
|
atg.commerce.inventory.AvailableToPromise |
queryAvailableToPromise(java.lang.String pId,
java.lang.String pLocationId) |
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 pLocationId)
query the number of items available for backorder.
|
long |
queryBackorderThreshold(java.lang.String pId)
Return the threshold associated with backorderLevel
|
long |
queryBackorderThreshold(java.lang.String pId,
java.lang.String pLocationId)
Return the threshold associated with backorderLevel
|
java.util.Date |
queryBundleAvailabilityDate(java.lang.String pBundleId,
java.lang.String pLocationId)
Cycles through each item in a bundle and calls
queryAvailabilityDate on each.
|
protected long |
queryBundleBackorderLevel(java.lang.String pId)
Cycles through the items in a bundle and returns the greatest
quantity of bundles that could be allocated given each items
backorder level.
|
protected long |
queryBundleBackorderLevel(java.lang.String pId,
java.lang.String pLocationId)
Cycles through the items in a bundle and returns the greatest
quantity of bundles that could be allocated given each items
backorder level.
|
protected long |
queryBundleBackorderThreshold(java.lang.String pId,
java.lang.String pLocationId)
Currently all bundles have thresholds of 0.
|
protected long |
queryBundlePreorderLevel(java.lang.String pId,
java.lang.String pLocationId)
Cycles through the items in a bundle and returns the greatest
quantity of bundles that could be preordered given each items
backorder level.
|
protected long |
queryBundlePreorderThreshold(java.lang.String pId,
java.lang.String pLocationId)
Currently all bundles have thresholds of 0.
|
protected long |
queryBundleStockLevel(java.lang.String pId,
java.lang.String pLocationId)
Cycles through the items in a bundle and returns the greatest
quantity of bundles that could be allocated given each items
stock level.
|
protected long |
queryBundleStockThreshold(java.lang.String pId,
java.lang.String pLocationId)
Currently all bundles have thresholds of 0.
|
java.util.Collection<InventoryInfo> |
queryInventoryInformation(java.util.Collection<java.lang.String> pItemIds,
java.util.Collection<java.lang.String> pLocationIds) |
java.util.Collection<InventoryInfo> |
queryInventoryInformation(java.util.Collection<java.lang.String> pItemIds,
java.lang.String pLocationId) |
java.util.Collection<InventoryInfo> |
queryInventoryInformation(java.lang.String pId,
java.util.Collection<java.lang.String> pLocationIds) |
InventoryInfo |
queryInventoryInformation(java.lang.String pId,
java.lang.String pLocationId) |
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 pLocationId)
query the number of items in available in preorder.
|
long |
queryPreorderThreshold(java.lang.String pId)
Return the threshold associated with preorderLevel
|
long |
queryPreorderThreshold(java.lang.String pId,
java.lang.String pLocationId)
Return the threshold associated with preorderLevel
|
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 pLocationId)
query the number of items in stock.
|
long |
queryStockThreshold(java.lang.String pId)
Return the threshold associated with stockLevel.
|
long |
queryStockThreshold(java.lang.String pId,
java.lang.String pLocationId)
Return the threshold associated with stockLevel.
|
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 pLocationId)
Release locks for the inventory items that apply to the given
ids.
|
void |
setATPDatePropertyName(java.lang.String pATPDatePropertyName)
Sets property ATPDatePropertyName
|
void |
setATPInformationPropertyName(java.lang.String pATPInformationPropertyName)
Sets property ATPInformationPropertyName
|
void |
setATPQuantityPropertyName(java.lang.String pATPQuantityPropertyName)
Sets property ATPQuantityPropertyName
|
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 pLocationId)
Set an item's availability date.
|
void |
setAvailabilityDatePropertyName(java.lang.String pAvailabilityDatePropertyName)
Sets property AvailabilityDatePropertyName
|
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 pLocationId)
Set an item's availability status.
|
void |
setAvailabilityStatusBackorderableValue(int pAvailabilityStatusBackorderableValue) |
void |
setAvailabilityStatusDerivedValue(int pAvailabilityStatusDerivedValue) |
void |
setAvailabilityStatusDiscontinuedValue(int pAvailabilityStatusDiscontinuedValue) |
void |
setAvailabilityStatusInStockValue(int pAvailabilityStatusInStockValue) |
void |
setAvailabilityStatusOutOfStockValue(int pAvailabilityStatusOutOfStockValue) |
void |
setAvailabilityStatusPreorderableValue(int pAvailabilityStatusPreorderableValue) |
void |
setAvailabilityStatusPropertyName(java.lang.String pAvailabilityStatusPropertyName)
Sets property AvailabilityStatusPropertyName
|
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 pLocationId)
set the item's backorder level to pNumber,
If the item is a bundle, this method does nothing
and returns INVENTORY_STATUS_SUCCEED.
|
void |
setBackorderLevelPropertyName(java.lang.String pBackorderLevelPropertyName)
Sets property BackorderLevelPropertyName
|
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 pLocationId)
Set an item's backorder level threshold.
|
void |
setBackorderThresholdPropertyName(java.lang.String pBackorderThresholdPropertyName)
Sets property BackorderThresholdPropertyName
|
void |
setBundleLinksPropertyName(java.lang.String pBundleLinksPropertyName) |
void |
setCatalogRefIdMatchQuery(RqlStatement pCatalogRefIdMatchQuery)
Sets property CatalogRefIdMatchQuery
|
void |
setCatalogRefIdPropertyName(java.lang.String pCatalogRefIdPropertyName)
Sets property CatalogRefIdPropertyName
|
void |
setCatalogRefItemType(java.lang.String pCatalogRefItemType)
Sets property CatalogRefItemType
|
void |
setCatalogRefRepository(Repository pCatalogRefRepository)
Sets property CatalogRefRepository
|
void |
setClientLockManager(ClientLockManager pClientLockManager)
Deprecated.
locks are no longer used
|
void |
setDefaultBackorderLevel(long pDefaultBackorderLevel) |
void |
setDefaultPreorderLevel(long pDefaultPreorderLevel) |
void |
setDefaultStockLevel(long pDefaultStockLevel) |
void |
setInventoryEventPort(java.lang.String pInventoryEventPort) |
void |
setInventoryName(java.lang.String pInventoryName) |
void |
setInventoryRowLockProperty(java.lang.String pInventoryRowLockProperty) |
void |
setInventoryRowLockSQL(java.lang.String pInventoryRowLockSQL) |
void |
setItemType(java.lang.String pItemType)
Sets property ItemType
|
void |
setLocationCatalogRefIdMatchQuery(RqlStatement pLocationCatalogRefIdMatchQuery)
Sets property CatalogRefIdMatchQuery
|
void |
setLocationInventoryRowLockSQL(java.lang.String pLocationInventoryRowLockSQL) |
void |
setMaximumRetriesPerRowLock(int pMaximumRetriesPerRowLock) |
void |
setMessageIdGenerator(IdGenerator pMessageIdGenerator) |
void |
setMessageIdSpaceName(java.lang.String pMessageIdSpaceName) |
void |
setMillisecondDelayBeforeLockRetry(int pMillisecondDelayBeforeLockRetry) |
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 pLocationId)
set the item's preorder level to pNumber,
If the item is a bundle, this method does nothing
and returns INVENTORY_STATUS_SUCCEED.
|
void |
setPreorderLevelPropertyName(java.lang.String pPreorderLevelPropertyName)
Sets property PreorderLevelPropertyName
|
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 pLocationId)
Set an item's preorder level threshold.
|
void |
setPreorderThresholdPropertyName(java.lang.String pPreorderThresholdPropertyName)
Sets property PreorderThresholdPropertyName
|
void |
setRepository(MutableRepository pRepository)
Sets property Repository
|
void |
setSkuLinkItemPropertyName(java.lang.String pSkuLinkItemPropertyName) |
void |
setSkuLinkQuantityPropertyName(java.lang.String pSkuLinkQuantityPropertyName) |
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 pLocationId)
set the item's stock level to pNumber,
If the item is a bundle, this method does nothing
and returns INVENTORY_STATUS_SUCCEED.
|
void |
setStockLevelPropertyName(java.lang.String pStockLevelPropertyName)
Sets property StockLevelPropertyName
|
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 pLocationId)
Set an item's stock level threshold.
|
void |
setStockThresholdPropertyName(java.lang.String pStockThresholdPropertyName)
Sets property StockThresholdPropertyName
|
void |
setUpdateInventoryPort(java.lang.String pUpdateInventoryPort) |
protected void |
thresholdHasBeenReached(java.lang.String pId,
java.lang.String pLevelPropertyName,
java.lang.String pThresholdPropertyName,
long pCurrentValue,
long pThreshold)
This gets called when some level sinks below the threshold.
|
protected void |
thresholdHasBeenReached(java.lang.String pId,
java.lang.String pLocationId,
java.lang.String pLevelPropertyName,
java.lang.String pThresholdPropertyName,
long pCurrentValue,
long pThreshold)
This gets called when some level sinks below the threshold.
|
protected void |
unlock(java.lang.String pItemId)
Release the lock for the given id.
|
protected void |
unlock(java.lang.String pItemId,
java.lang.String pLocationId) |
protected void |
updateItem(MutableRepositoryItem pItem)
Update the item in the inventory
|
getDelayOnSendRetry, getMessageSourceContext, getMessageSourceName, getTransactionManager, isAllowMessageSending, receiveMessage, sendCommerceMessage, sendObjectMessage, setAllowMessageSending, setDelayOnSendRetry, setMessageSourceContext, setMessageSourceName, setTransactionManager, startMessageSource, stopMessageSourceaddLogListener, 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, stopServicevlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarningpublic static final java.lang.String CLASS_VERSION
public void setStockLevelPropertyName(java.lang.String pStockLevelPropertyName)
public java.lang.String getStockLevelPropertyName()
public void setBackorderLevelPropertyName(java.lang.String pBackorderLevelPropertyName)
public java.lang.String getBackorderLevelPropertyName()
public void setPreorderLevelPropertyName(java.lang.String pPreorderLevelPropertyName)
public java.lang.String getPreorderLevelPropertyName()
public void setStockThresholdPropertyName(java.lang.String pStockThresholdPropertyName)
public java.lang.String getStockThresholdPropertyName()
public void setBackorderThresholdPropertyName(java.lang.String pBackorderThresholdPropertyName)
public java.lang.String getBackorderThresholdPropertyName()
public void setPreorderThresholdPropertyName(java.lang.String pPreorderThresholdPropertyName)
public java.lang.String getPreorderThresholdPropertyName()
public void setAvailabilityStatusPropertyName(java.lang.String pAvailabilityStatusPropertyName)
public java.lang.String getAvailabilityStatusPropertyName()
public void setAvailabilityDatePropertyName(java.lang.String pAvailabilityDatePropertyName)
public java.lang.String getAvailabilityDatePropertyName()
public void setATPInformationPropertyName(java.lang.String pATPInformationPropertyName)
public java.lang.String getATPInformationPropertyName()
public void setATPDatePropertyName(java.lang.String pATPDatePropertyName)
public java.lang.String getATPDatePropertyName()
public void setATPQuantityPropertyName(java.lang.String pATPQuantityPropertyName)
public java.lang.String getATPQuantityPropertyName()
public void setCatalogRefIdPropertyName(java.lang.String pCatalogRefIdPropertyName)
public java.lang.String getCatalogRefIdPropertyName()
public void setBundleLinksPropertyName(java.lang.String pBundleLinksPropertyName)
public java.lang.String getBundleLinksPropertyName()
public void setSkuLinkItemPropertyName(java.lang.String pSkuLinkItemPropertyName)
public java.lang.String getSkuLinkItemPropertyName()
public void setSkuLinkQuantityPropertyName(java.lang.String pSkuLinkQuantityPropertyName)
public java.lang.String getSkuLinkQuantityPropertyName()
public void setAvailabilityStatusDerivedValue(int pAvailabilityStatusDerivedValue)
public int getAvailabilityStatusDerivedValue()
public void setAvailabilityStatusInStockValue(int pAvailabilityStatusInStockValue)
public int getAvailabilityStatusInStockValue()
public void setAvailabilityStatusBackorderableValue(int pAvailabilityStatusBackorderableValue)
public int getAvailabilityStatusBackorderableValue()
public void setAvailabilityStatusPreorderableValue(int pAvailabilityStatusPreorderableValue)
public int getAvailabilityStatusPreorderableValue()
public void setAvailabilityStatusOutOfStockValue(int pAvailabilityStatusOutOfStockValue)
public int getAvailabilityStatusOutOfStockValue()
public void setAvailabilityStatusDiscontinuedValue(int pAvailabilityStatusDiscontinuedValue)
public int getAvailabilityStatusDiscontinuedValue()
public void setDefaultStockLevel(long pDefaultStockLevel)
public long getDefaultStockLevel()
public void setDefaultBackorderLevel(long pDefaultBackorderLevel)
public long getDefaultBackorderLevel()
public void setDefaultPreorderLevel(long pDefaultPreorderLevel)
public long getDefaultPreorderLevel()
public void setMessageIdGenerator(IdGenerator pMessageIdGenerator)
public IdGenerator getMessageIdGenerator()
public void setMessageIdSpaceName(java.lang.String pMessageIdSpaceName)
public java.lang.String getMessageIdSpaceName()
public void setRepository(MutableRepository pRepository)
public MutableRepository getRepository()
public void setItemType(java.lang.String pItemType)
public java.lang.String getItemType()
public void setCatalogRefIdMatchQuery(RqlStatement pCatalogRefIdMatchQuery)
public RqlStatement getCatalogRefIdMatchQuery()
public void setLocationCatalogRefIdMatchQuery(RqlStatement pLocationCatalogRefIdMatchQuery)
public RqlStatement getLocationCatalogRefIdMatchQuery()
public void setCatalogRefRepository(Repository pCatalogRefRepository)
public Repository getCatalogRefRepository()
public void setCatalogRefItemType(java.lang.String pCatalogRefItemType)
public java.lang.String getCatalogRefItemType()
public void setClientLockManager(ClientLockManager pClientLockManager)
public ClientLockManager getClientLockManager()
public void setUpdateInventoryPort(java.lang.String pUpdateInventoryPort)
public java.lang.String getUpdateInventoryPort()
public void setInventoryEventPort(java.lang.String pInventoryEventPort)
public java.lang.String getInventoryEventPort()
protected RepositoryItem getCatalogRefItem(java.lang.String pId) throws RepositoryException
RepositoryException - if there was a problem accessing the itempublic void setMaximumRetriesPerRowLock(int pMaximumRetriesPerRowLock)
public int getMaximumRetriesPerRowLock()
public void setMillisecondDelayBeforeLockRetry(int pMillisecondDelayBeforeLockRetry)
public int getMillisecondDelayBeforeLockRetry()
public void setInventoryRowLockProperty(java.lang.String pInventoryRowLockProperty)
public java.lang.String getInventoryRowLockProperty()
public void setInventoryRowLockSQL(java.lang.String pInventoryRowLockSQL)
public java.lang.String getInventoryRowLockSQL()
public void setLocationInventoryRowLockSQL(java.lang.String pLocationInventoryRowLockSQL)
public java.lang.String getLocationInventoryRowLockSQL()
protected MutableRepositoryItem getInventoryItemForUpdate(java.lang.String pId) throws RepositoryException
RepositoryException - if there was a problem accessing the itemprotected MutableRepositoryItem getInventoryItemForUpdate(java.lang.String pId, java.lang.String pLocationId) throws RepositoryException
RepositoryException - if there was a problem accessing the itemprotected RepositoryItem getInventoryItem(java.lang.String pId) throws RepositoryException
RepositoryException - if there was a problem accessing the itemprotected RepositoryItem getInventoryItem(java.lang.String pId, java.lang.String pLocationId) throws RepositoryException
RepositoryException - if there was a problem accessing the itempublic void setInventoryName(java.lang.String pInventoryName)
public java.lang.String getInventoryName()
getInventoryName in interface InventoryManagerpublic int purchase(java.lang.String pId,
long pHowMany,
java.lang.String pLocationId)
throws InventoryException
purchase in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU being purchased.pLocation - the location id of where the SKU is being purchased from.pHowMany - The amount of the SKU being purchased.InventoryExceptionqueryAvailabilityStatus(java.lang.String, java.lang.String),
purchaseBundle(java.lang.String, long)public int purchaseOffBackorder(java.lang.String pId,
long pHowMany,
java.lang.String pLocationId)
throws InventoryException
purchaseOffBackorder in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU being purchased.pLocationId - The location of the SKU being purchased.pHowMany - The amount of the SKU being purchased.InventoryExceptionqueryAvailabilityStatus(java.lang.String, java.lang.String),
purchaseBundleOffBackorder(java.lang.String, long)public int purchaseOffPreorder(java.lang.String pId,
long pHowMany,
java.lang.String pLocationId)
throws InventoryException
purchaseOffPreorder in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU being purchased.pLocationId - the location where the SKU is being purchased from.pHowMany - The amount of the SKU being purchased.InventoryExceptionqueryAvailabilityStatus(java.lang.String, java.lang.String),
purchaseBundleOffPreorder(java.lang.String, long)public int preorder(java.lang.String pId,
long pHowMany,
java.lang.String pLocationId)
throws InventoryException
preorder in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU being preordered.pLocationId - the location of the SKU being preordered.pHowMany - The amount of the SKU being preordered.InventoryExceptionpreorderBundle(java.lang.String, long)public int backorder(java.lang.String pId,
long pHowMany,
java.lang.String pLocationId)
throws InventoryException
backorder in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU being backordered.pLocationId - the location of the sku being backordered.pHowMany - The amount of the SKU being backordered..InventoryExceptionbackorderBundle(java.lang.String, long, java.lang.String)protected int decrementSKULevel(MutableRepositoryItem pItem, long pHowMany, java.lang.String pLevelName, java.lang.String pThresholdName) throws InventoryException
pItem - The id of the SKU being changed.pHowMany - The amount the level should be decreased by.pLevelName - The name of the level that should be decreased.
(one of stockLevel, backorderLevel, preorderLevel)pThresholdName - The name of the threshold associated with pLevelNameInventoryExceptionthresholdHasBeenReached(java.lang.String, java.lang.String, java.lang.String, long, long)protected int decrementSKULevel(MutableRepositoryItem pItem, java.lang.String pLocationId, long pHowMany, java.lang.String pLevelName, java.lang.String pThresholdName) throws InventoryException
InventoryExceptionpublic int setStockLevel(java.lang.String pId,
long pNumber,
java.lang.String pLocationId)
throws InventoryException
setStockLevel in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose stockLevel is being setpNumber - The amount to set the stockLevel to.pLocationId - the location where the SKU's stock level is being set.InventoryExceptionpublic int setBackorderLevel(java.lang.String pId,
long pNumber,
java.lang.String pLocationId)
throws InventoryException
setBackorderLevel in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose backorderLevel is being setpLocationId - the location where the SKU's backorderLevel is being setpNumber - The amount to set the backorderLevel to.InventoryExceptionpublic int setPreorderLevel(java.lang.String pId,
long pNumber,
java.lang.String pLocationId)
throws InventoryException
setPreorderLevel in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose preorderLevel is being setpLocationId - The location id where the SKU's preorderLevel is being setpNumber - The amount to set the preorderLevel to.InventoryExceptionpublic int increaseStockLevel(java.lang.String pId,
long pNumber,
java.lang.String pLocationId)
throws InventoryException
increaseStockLevel in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose stockLevel is being increased.pLocationId - the Location Id where the SKU's stock level is being increased.pNumber - The amount to increase the stockLevel to.InventoryExceptionpublic int decreaseStockLevel(java.lang.String pId,
long pNumber,
java.lang.String pLocationId)
throws InventoryException
decreaseStockLevel in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose stockLevel is being decreased.pNumber - The amount to decrease the stockLevel to.pLocationId - the Location Id where the SKU's stock level is being decreased.InventoryExceptionpublic int increaseBackorderLevel(java.lang.String pId,
long pNumber,
java.lang.String pLocationId)
throws InventoryException
increaseBackorderLevel in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose backorderLevel is being increased.pLocationId - the Location Id where the SKU's backorder level is being increased.pNumber - The amount to increase the backorderLevel to.InventoryExceptionpublic int decreaseBackorderLevel(java.lang.String pId,
long pNumber,
java.lang.String pLocationId)
throws InventoryException
decreaseBackorderLevel in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose backorderLevel is being decreased.pLocationId - the Location Id where the SKU's backorderLevel is being decreased.pNumber - The amount to decrease the backorderLevel to.InventoryExceptionpublic int increasePreorderLevel(java.lang.String pId,
long pNumber,
java.lang.String pLocationId)
throws InventoryException
increasePreorderLevel in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose preorderLevel is being increased.pLocationId - the Location Id where the SKU's preorderLevel is being increased.pNumber - The amount to increase the preorderLevel to.InventoryExceptionpublic int decreasePreorderLevel(java.lang.String pId,
long pNumber,
java.lang.String pLocationId)
throws InventoryException
decreasePreorderLevel in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose preorderLevel is being decreased.pLocationId - the Location Id where the SKU's preorderLevel is being decreased.pNumber - The amount to decrease the preorderLevel to.InventoryExceptionpublic int setAvailabilityStatus(java.lang.String pId,
int pStatus,
java.lang.String pLocationId)
throws InventoryException
setAvailabilityStatus in interface atg.commerce.inventory.LocationInventoryManagerpId - the id of the item involvedpStatus - 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)pLocationId - the Location Id where the SKU's availability status is being set.InventoryExceptionpublic int setAvailabilityDate(java.lang.String pId,
java.util.Date pDate,
java.lang.String pLocationId)
throws InventoryException
setAvailabilityDate in interface atg.commerce.inventory.LocationInventoryManagerpId - the id of the item involvedpLocationId - the location of the item involved.pDate - The new availability date for the item.InventoryExceptionpublic int queryAvailabilityStatus(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
queryAvailabilityStatus in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose status is being queriedpLocationId - the location of the item involved.InventoryExceptionderiveAvailabilityStatus(java.lang.String),
deriveBundleAvailabilityStatus(java.lang.String)public long queryStockLevel(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
queryStockLevel in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose stockLevel is returnedpLocationId - the location of the item involved.InventoryExceptionqueryBundleStockLevel(java.lang.String, java.lang.String)public long queryBackorderLevel(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
queryBackorderLevel in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose backorderLevel is returnedpLocationId - the location of the item involved.InventoryExceptionqueryBundleBackorderLevel(java.lang.String)public long queryPreorderLevel(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
queryPreorderLevel in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose preorderLevel is returnedpLocationId - the location of the item involved.InventoryExceptionqueryBundlePreorderLevel(java.lang.String, java.lang.String)public java.util.Date queryAvailabilityDate(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
queryAvailabilityDate in interface atg.commerce.inventory.LocationInventoryManagerpId - The id of the SKU whose availabilityDate is returnedpLocationId - the location of the item involved.InventoryExceptionqueryBundleAvailabilityDate(java.lang.String, java.lang.String)public int inventoryWasUpdated(java.util.List pItemIds,
java.lang.String pLocationId)
throws InventoryException
inventoryWasUpdated in interface atg.commerce.inventory.LocationInventoryManagerpItemIds - The items with recently added inventorypLocationId - the location of the items involved.MissingInventoryItemException - if a given id does not exist.InventoryExceptionJMSExceptionpublic int setStockThreshold(java.lang.String pId,
long pNumber,
java.lang.String pLocationId)
throws InventoryException
setStockThreshold in interface atg.commerce.inventory.LocationInventoryManagerpId - the id of the SKU involvedpNumber - the number to set the threshold toInventoryExceptionpublic int setBackorderThreshold(java.lang.String pId,
long pNumber,
java.lang.String pLocationId)
throws InventoryException
setBackorderThreshold in interface atg.commerce.inventory.LocationInventoryManagerpId - the id of the SKU involvedpNumber - the number to set the threshold topLocationId - the location of the item involvedInventoryExceptionpublic int setPreorderThreshold(java.lang.String pId,
long pNumber,
java.lang.String pLocationId)
throws InventoryException
setPreorderThreshold in interface atg.commerce.inventory.LocationInventoryManagerpId - the id of the SKU involvedpNumber - the number to set the threshold topLocationId - the location of the item involved.InventoryExceptionpublic long queryStockThreshold(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
queryStockThreshold in interface atg.commerce.inventory.LocationInventoryManagerpId - the id of the SKU involvedpLocationId - the location of the item involved.InventoryExceptionpublic long queryBackorderThreshold(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
queryBackorderThreshold in interface atg.commerce.inventory.LocationInventoryManagerpId - the id of the SKU involvedpLocationId - the location of the item involved.InventoryExceptionpublic long queryPreorderThreshold(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
queryPreorderThreshold in interface atg.commerce.inventory.LocationInventoryManagerpId - the id of the SKU involvedpLocationId - the location of the item involved.InventoryExceptionprotected void thresholdHasBeenReached(java.lang.String pId,
java.lang.String pLevelPropertyName,
java.lang.String pThresholdPropertyName,
long pCurrentValue,
long pThreshold)
throws InventoryException
pId - The id of the SKU at a critical inventory level.pLevelPropertyName - The name of the property that is at a critical levelpThresholdPropertyName - The name of the threshold that has been reached.pCurrentValue - The current value of pLevelPropertyNamepThreshold - The vale of pThresholdPropertyNameInventoryExceptionInventoryThresholdReached,
getInventoryEventPort()protected void thresholdHasBeenReached(java.lang.String pId,
java.lang.String pLocationId,
java.lang.String pLevelPropertyName,
java.lang.String pThresholdPropertyName,
long pCurrentValue,
long pThreshold)
throws InventoryException
pId - The id of the SKU at a critical inventory level.pLocationId - The id of the location for this inventory.pLevelPropertyName - The name of the property that is at a critical levelpThresholdPropertyName - The name of the threshold that has been reached.pCurrentValue - The current value of pLevelPropertyNamepThreshold - The vale of pThresholdPropertyNameInventoryExceptionInventoryThresholdReached,
getInventoryEventPort()protected int deriveAvailabilityStatus(java.lang.String pId)
throws InventoryException
if(stockLevel != 0)
return IN_STOCK;
else if(backorderLevel != 0)
return BACKORDERABLE;
else if(preorderLevel != 0)
return PREORDERABLE;
else
return OUT_OF_STOCK;
pId - The sku we are deriving the status forInventoryExceptionprotected int deriveAvailabilityStatus(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
if(stockLevel != 0)
return IN_STOCK;
else if(backorderLevel != 0)
return BACKORDERABLE;
else if(preorderLevel != 0)
return PREORDERABLE;
else
return OUT_OF_STOCK;
pId - The sku we are deriving the status forpLocationId - The location of the inventory we are deriving the status forInventoryExceptionpublic java.lang.String getNextMessageId()
throws InventoryException
InventoryExceptionprotected void updateItem(MutableRepositoryItem pItem) throws RepositoryException
pItem - The inventory's RepositoryItemRepositoryExceptionprotected void lock(java.lang.String pItemId)
throws java.sql.SQLException
pItemId - The catalog ref id whose inventory we want to changejava.sql.SQLExceptiongetMillisecondDelayBeforeLockRetry(),
getMaximumRetriesPerRowLock(),
getInventoryRowLockProperty(),
getInventoryRowLockSQL()protected void lock(java.lang.String pItemId,
java.lang.String pLocationId)
throws java.sql.SQLException
pItemId - The catalog ref id whose inventory we want to changepLocationId - the LocationId of the inventory we want to changejava.sql.SQLExceptiongetMillisecondDelayBeforeLockRetry(),
getMaximumRetriesPerRowLock(),
getInventoryRowLockProperty(),
getInventoryRowLockSQL()protected void unlock(java.lang.String pItemId)
throws java.sql.SQLException
java.sql.SQLExceptionprotected void unlock(java.lang.String pItemId,
java.lang.String pLocationId)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void acquireInventoryLocks(java.util.List pItemIds,
java.lang.String pLocationId)
throws InventoryException
lock
The locks are acquired in sorted order. Any locks for
ids contained within a bundle are also acquired in the
correct order.
If one of the ids does not exist, it is ignored.acquireInventoryLocks in interface atg.commerce.inventory.LocationInventoryManagerpItemIds - The list of catalog ref idsInventoryExceptionpublic void releaseInventoryLocks(java.util.List pItemIds,
java.lang.String pLocationId)
throws InventoryException
releaseInventoryLocks in interface atg.commerce.inventory.LocationInventoryManagerInventoryExceptionpublic java.util.List getBundledIds(java.lang.String pBundleId)
throws InventoryException
InventoryExceptionprotected java.util.List getBundleLinks(java.lang.String pId)
throws InventoryException
pId - The id of the sku in questionInventoryExceptionprotected java.util.List getBundleLinks(RepositoryItem pBundle) throws InventoryException
pBundle - The sku.InventoryExceptionprotected boolean isBundle(java.lang.String pId)
throws InventoryException
pId - The id of the sku in questionInventoryExceptionprotected int deriveBundleAvailabilityStatus(java.lang.String pBundleId)
throws InventoryException
for each item
queryAvailabilityStatus(item)
if any items are AVAILABILITY_STATUS_OUT_OF_STOCK
return AVAILABILITY_STATUS_OUT_OF_STOCK
else if any are AVAILABILITY_STATUS_PREORDERABLE
return AVAILABILITY_STATUS_PREORDERABLE
else if any are AVAILABILITY_STATUS_BACKORDERABLE
return AVAILABILITY_STATUS_BACKORDERABLE
else
return AVAILABILITY_STATUS_IN_STOCK
pId - the id of the bundleInventoryExceptionprotected int deriveBundleAvailabilityStatus(java.lang.String pBundleId,
java.lang.String pLocationId)
throws InventoryException
for each item
queryAvailabilityStatus(item)
if any items are AVAILABILITY_STATUS_OUT_OF_STOCK
return AVAILABILITY_STATUS_OUT_OF_STOCK
else if any are AVAILABILITY_STATUS_PREORDERABLE
return AVAILABILITY_STATUS_PREORDERABLE
else if any are AVAILABILITY_STATUS_BACKORDERABLE
return AVAILABILITY_STATUS_BACKORDERABLE
else
return AVAILABILITY_STATUS_IN_STOCK
pId - the id of the bundlepLocationId - the location id of the bundleInventoryExceptionprotected int purchaseBundle(java.lang.String pBundleId,
long pHowMany)
throws InventoryException
foreach item
queryAvailabilityStatus(bundle)
if AVAILABILITY_STATUS_IN_STOCK
for each item
purchase(item, itemQuantity)
if purchase returns INVENTORY_STATUS_INSUFFICIENT_SUPPLY
for each item already purchased
increaseStockLevel
return INVENTORY_STATUS_INSUFFICIENT_SUPPLY
if purchase returns INVENTORY_STATUS_FAILED
for each item already purchased
increaseStockLevel
return INVENTORY_STATUS_FAILED
return INVENTORY_STATUS_SUCCEED
else
return INVENTORY_STATUS_FAILED
pBundleId - The id of the bundlepHowMany - the quantity of the bundle to purchaseInventoryExceptionprotected int purchaseBundle(java.lang.String pBundleId,
long pHowMany,
java.lang.String pLocationId)
throws InventoryException
foreach item
queryAvailabilityStatus(bundle)
if AVAILABILITY_STATUS_IN_STOCK
for each item
purchase(item, itemQuantity)
if purchase returns INVENTORY_STATUS_INSUFFICIENT_SUPPLY
for each item already purchased
increaseStockLevel
return INVENTORY_STATUS_INSUFFICIENT_SUPPLY
if purchase returns INVENTORY_STATUS_FAILED
for each item already purchased
increaseStockLevel
return INVENTORY_STATUS_FAILED
return INVENTORY_STATUS_SUCCEED
else
return INVENTORY_STATUS_FAILED
pBundleId - The id of the bundlepHowMany - the quantity of the bundle to purchasepLocationId - the location of the bundleInventoryExceptionprotected int backorderBundle(java.lang.String pBundleId,
long pHowMany,
java.lang.String pLocationId)
throws InventoryException
foreach item
backorder(item, itemQuantity)
if backorder returns INVENTORY_STATUS_INSUFFICIENT_SUPPLY
for each item already backordered
increaseBackorderLevel
return INVENTORY_STATUS_INSUFFICIENT_SUPPLY
if backorder returns INVENTORY_STATUS_FAILED
for each item already backordered
increaseBackorderLevel
return INVENTORY_STATUS_FAILED
return INVENTORY_STATUS_SUCCEED
else
return INVENTORY_STATUS_FAILED
pBundleId - The id of the bundle we are backorderingpHowMany - the quantity of the bundle to backorderInventoryExceptionprotected int preorderBundle(java.lang.String pBundleId,
long pHowMany)
throws InventoryException
foreach item
preorder(item, itemQuantity)
if preorder returns INVENTORY_STATUS_INSUFFICIENT_SUPPLY
for each item already preordered
increasePreorderLevel
return INVENTORY_STATUS_INSUFFICIENT_SUPPLY
if preorder returns INVENTORY_STATUS_FAILED
for each item already preordered
increasePreorderLevel
return INVENTORY_STATUS_FAILED
return INVENTORY_STATUS_SUCCEED
else
return INVENTORY_STATUS_FAILED
pBundleId - The id of the bundle we are backorderingpHowMany - the quantity of the bundle to backorderInventoryExceptionprotected int preorderBundle(java.lang.String pBundleId,
long pHowMany,
java.lang.String pLocationId)
throws InventoryException
InventoryExceptionprotected int purchaseBundleOffPreorder(java.lang.String pBundleId,
long pHowMany)
throws InventoryException
pBundleId - The id of the bundlepHowMany - the quantity of the bundle to purchaseInventoryExceptionprotected int purchaseBundleOffPreorder(java.lang.String pBundleId,
long pHowMany,
java.lang.String pLocationId)
throws InventoryException
pBundleId - The id of the bundlepHowMany - the quantity of the bundle to purchasepLocationId - the location of the bundleInventoryExceptionprotected int purchaseBundleOffBackorder(java.lang.String pBundleId,
long pHowMany)
throws InventoryException
pBundleId - The id of the bundlepHowMany - the quantity of the bundle to purchaseInventoryExceptionprotected int purchaseBundleOffBackorder(java.lang.String pBundleId,
long pHowMany,
java.lang.String pLocationId)
throws InventoryException
pBundleId - The id of the bundlepHowMany - the quantity of the bundle to purchasepLocationId - the location id of the bundleInventoryExceptionprotected long queryBundleStockLevel(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
pId - The id of the bundleInventoryExceptionprotected long queryBundleBackorderLevel(java.lang.String pId)
throws InventoryException
pId - The id of the bundleInventoryExceptionprotected long queryBundleBackorderLevel(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
pId - The id of the bundlepLocationId - the location id of the bundleInventoryExceptionprotected long queryBundlePreorderLevel(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
pId - The id of the bundleInventoryExceptionprotected long queryBundleStockThreshold(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
pId - The id of the bundleInventoryExceptionprotected long queryBundleBackorderThreshold(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
pId - The id of the bundleInventoryExceptionprotected long queryBundlePreorderThreshold(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
pId - The id of the bundleInventoryExceptionpublic java.util.Date queryBundleAvailabilityDate(java.lang.String pBundleId,
java.lang.String pLocationId)
throws InventoryException
pBundleId - The id of the bundleInventoryExceptionMissingInventoryItemExceptionqueryAvailabilityDate(java.lang.String, java.lang.String)public java.util.Collection<InventoryInfo> queryInventoryInformation(java.util.Collection<java.lang.String> pItemIds, java.lang.String pLocationId) throws InventoryException
queryInventoryInformation in interface atg.commerce.inventory.LocationInventoryManagerInventoryExceptionpublic java.util.Collection<InventoryInfo> queryInventoryInformation(java.lang.String pId, java.util.Collection<java.lang.String> pLocationIds) throws InventoryException
queryInventoryInformation in interface atg.commerce.inventory.LocationInventoryManagerInventoryExceptionpublic java.util.Collection<InventoryInfo> queryInventoryInformation(java.util.Collection<java.lang.String> pItemIds, java.util.Collection<java.lang.String> pLocationIds) throws InventoryException
queryInventoryInformation in interface atg.commerce.inventory.LocationInventoryManagerInventoryExceptionpublic InventoryInfo queryInventoryInformation(java.lang.String pId, java.lang.String pLocationId) throws InventoryException
queryInventoryInformation in interface atg.commerce.inventory.LocationInventoryManagerInventoryExceptionpublic atg.commerce.inventory.AvailableToPromise queryAvailableToPromise(java.lang.String pId,
java.lang.String pLocationId)
throws InventoryException
queryAvailableToPromise in interface atg.commerce.inventory.LocationInventoryManagerInventoryExceptionpublic int purchase(java.lang.String pId,
long pHowMany)
throws InventoryException
InventoryManagerpurchase in interface InventoryManagerpId - the id of the item involvedInventoryException - if there was a problem during the purchase process.public int purchaseOffBackorder(java.lang.String pId,
long pHowMany)
throws InventoryException
InventoryManagerpurchaseOffBackorder in interface InventoryManagerpId - the id of the item involvedInventoryException - if there was a problem during the purchase process.public int purchaseOffPreorder(java.lang.String pId,
long pHowMany)
throws InventoryException
InventoryManagerpurchaseOffPreorder in interface InventoryManagerpId - the id of the item involvedInventoryException - if there was a problem during the purchase process.public int preorder(java.lang.String pId,
long pHowMany)
throws InventoryException
InventoryManagerpreorder in interface InventoryManagerpId - the id of the item involvedInventoryException - if there was a problem in trying to preorder the itempublic int backorder(java.lang.String pId,
long pHowMany)
throws InventoryException
InventoryManagerbackorder in interface InventoryManagerpId - the id of the item involvedInventoryException - if there was a problem with the backordering process.public int setStockLevel(java.lang.String pId,
long pNumber)
throws InventoryException
InventoryManagersetStockLevel in interface InventoryManagerpId - the id of the item involvedpNumber - the number of the given item to restockInventoryException - if there was a problem trying to restockpublic int setBackorderLevel(java.lang.String pId,
long pNumber)
throws InventoryException
InventoryManagersetBackorderLevel in interface InventoryManagerpId - the id of the item involvedpNumber - the number of the given item to restockInventoryException - if there was a problem trying to restockpublic int setPreorderLevel(java.lang.String pId,
long pNumber)
throws InventoryException
InventoryManagersetPreorderLevel in interface InventoryManagerpId - the id of the item involvedpNumber - the number of the given item to restockInventoryException - if there was a problem trying to restockpublic int increaseStockLevel(java.lang.String pId,
long pNumber)
throws InventoryException
InventoryManagerincreaseStockLevel in interface InventoryManagerpId - the id of the item involvedpNumber - the number of items to add to the current stock levelInventoryException - if there was a problem trying to restockpublic int decreaseStockLevel(java.lang.String pId,
long pNumber)
throws InventoryException
InventoryManagerdecreaseStockLevel in interface InventoryManagerpId - the id of the item involvedpNumber - the number of items to decrease from the current stock levelInventoryException - if there was a problem trying to restockpublic int increaseBackorderLevel(java.lang.String pId,
long pNumber)
throws InventoryException
InventoryManagerincreaseBackorderLevel in interface InventoryManagerpId - the id of the item involvedpNumber - the number of items to add to the current stock levelInventoryException - if there was a problem trying to restockpublic int decreaseBackorderLevel(java.lang.String pId,
long pNumber)
throws InventoryException
InventoryManagerdecreaseBackorderLevel in interface InventoryManagerpId - the id of the item involvedpNumber - the number of items to decrease from the current stock levelInventoryException - if there was a problem trying to restockpublic int increasePreorderLevel(java.lang.String pId,
long pNumber)
throws InventoryException
InventoryManagerincreasePreorderLevel in interface InventoryManagerpId - the id of the item involvedpNumber - the number of items to add to the current stock levelInventoryException - if there was a problem trying to restockpublic int decreasePreorderLevel(java.lang.String pId,
long pNumber)
throws InventoryException
InventoryManagerdecreasePreorderLevel in interface InventoryManagerpId - the id of the item involvedpNumber - the number of items to decrease from the current stock levelInventoryException - if there was a problem trying to restockpublic int setStockThreshold(java.lang.String pId,
long pNumber)
throws InventoryException
InventoryManagersetStockThreshold in interface InventoryManagerpId - the id of the item involvedpNumber - the number of the given item to restockInventoryException - if there was a problem trying to restockpublic int setBackorderThreshold(java.lang.String pId,
long pNumber)
throws InventoryException
InventoryManagersetBackorderThreshold in interface InventoryManagerpId - the id of the item involvedpNumber - the number of the given item to restockInventoryException - if there was a problem trying to restockpublic int setPreorderThreshold(java.lang.String pId,
long pNumber)
throws InventoryException
InventoryManagersetPreorderThreshold in interface InventoryManagerpId - the id of the item involvedpNumber - the number of the given item to restockInventoryException - if there was a problem trying to restockpublic int setAvailabilityStatus(java.lang.String pId,
int pStatus)
throws InventoryException
InventoryManagersetAvailabilityStatus in interface InventoryManagerpId - the id of the item involvedpStatus - 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)InventoryExceptionpublic int setAvailabilityDate(java.lang.String pId,
java.util.Date pDate)
throws InventoryException
InventoryManagersetAvailabilityDate in interface InventoryManagerpId - the id of the item involvedpDate - The new availability date for the item.InventoryExceptionpublic int queryAvailabilityStatus(java.lang.String pId)
throws InventoryException
InventoryManagerqueryAvailabilityStatus in interface InventoryManagerpId - The id of the item involved.InventoryException - if there was a problem determining the status of the itempublic long queryStockLevel(java.lang.String pId)
throws InventoryException
InventoryManagerqueryStockLevel in interface InventoryManagerInventoryException - if there was a problem determining the numberpublic long queryBackorderLevel(java.lang.String pId)
throws InventoryException
InventoryManagerqueryBackorderLevel in interface InventoryManagerInventoryException - if there was a problem determining the numberpublic long queryPreorderLevel(java.lang.String pId)
throws InventoryException
InventoryManagerqueryPreorderLevel in interface InventoryManagerInventoryException - if there was a problem determining the numberpublic long queryStockThreshold(java.lang.String pId)
throws InventoryException
InventoryManagerqueryStockThreshold in interface InventoryManagerInventoryException - if there was a problem determining the numberpublic long queryBackorderThreshold(java.lang.String pId)
throws InventoryException
InventoryManagerqueryBackorderThreshold in interface InventoryManagerInventoryException - if there was a problem determining the numberpublic long queryPreorderThreshold(java.lang.String pId)
throws InventoryException
InventoryManagerqueryPreorderThreshold in interface InventoryManagerInventoryException - if there was a problem determining the numberpublic java.util.Date queryAvailabilityDate(java.lang.String pId)
throws InventoryException
InventoryManagerqueryAvailabilityDate in interface InventoryManagerInventoryException - if there was a problem determining the datepublic int inventoryWasUpdated(java.util.List pItemIds)
throws InventoryException
InventoryManagerinventoryWasUpdated in interface InventoryManagerpItemIds - The items with recently added inventoryInventoryExceptionpublic void acquireInventoryLocks(java.util.List pItemIds)
throws InventoryException
InventoryManageracquireInventoryLocks in interface InventoryManagerInventoryExceptionpublic void releaseInventoryLocks(java.util.List pItemIds)
throws InventoryException
InventoryManagerreleaseInventoryLocks in interface InventoryManagerInventoryException