|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.commerce.messaging.SourceSinkTemplate atg.commerce.inventory.RepositoryInventoryManager
public class RepositoryInventoryManager
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.
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 | |
---|---|
RepositoryInventoryManager()
|
Method Summary | |
---|---|
void |
acquireInventoryLocks(java.util.List pItemIds)
For each item in the list, call lock
The locks are acquired in sorted order. |
int |
backorder(java.lang.String pId,
long pHowMany)
decrement the item's backorder count, If the item is a bundle backorderBundle is called. |
protected int |
backorderBundle(java.lang.String pBundleId,
long pHowMany)
Backorders a bundle. |
int |
decreaseBackorderLevel(java.lang.String pId,
long pNumber)
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 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 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 |
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 |
deriveBundleAvailabilityStatus(java.lang.String pBundleId)
Derives the availability status for a bundle. |
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 MutableRepositoryItem |
getInventoryItemForUpdate(java.lang.String pId)
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 |
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 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 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 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)
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. |
int |
preorder(java.lang.String pId,
long pHowMany)
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. |
int |
purchase(java.lang.String pId,
long pHowMany)
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 |
purchaseBundleOffBackorder(java.lang.String pBundleId,
long pHowMany)
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. |
int |
purchaseOffBackorder(java.lang.String pId,
long pHowMany)
Check the availability status (queryAvailabilityStatus). |
int |
purchaseOffPreorder(java.lang.String pId,
long pHowMany)
Check the availability status (queryAvailabilityStatus). |
java.util.Date |
queryAvailabilityDate(java.lang.String pId)
query the availability date of an item. |
int |
queryAvailabilityStatus(java.lang.String pId)
Return the availability status of a given item. |
long |
queryBackorderLevel(java.lang.String pId)
query the number of items available for backorder. |
long |
queryBackorderThreshold(java.lang.String pId)
Return the threshold associated with backorderLevel |
java.util.Date |
queryBundleAvailabilityDate(java.lang.String pBundleId)
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 |
queryBundleBackorderThreshold(java.lang.String pId)
Currently all bundles have thresholds of 0. |
protected long |
queryBundlePreorderLevel(java.lang.String pId)
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)
Currently all bundles have thresholds of 0. |
protected long |
queryBundleStockLevel(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 stock level. |
protected long |
queryBundleStockThreshold(java.lang.String pId)
Currently all bundles have thresholds of 0. |
long |
queryPreorderLevel(java.lang.String pId)
query the number of items in available in preorder. |
long |
queryPreorderThreshold(java.lang.String pId)
Return the threshold associated with preorderLevel |
long |
queryStockLevel(java.lang.String pId)
query the number of items in stock. |
long |
queryStockThreshold(java.lang.String pId)
Return the threshold associated with stockLevel. |
void |
releaseInventoryLocks(java.util.List pItemIds)
Release locks for the inventory items that apply to the given ids. |
int |
setAvailabilityDate(java.lang.String pId,
java.util.Date pDate)
Set an item's availability date. |
void |
setAvailabilityDatePropertyName(java.lang.String pAvailabilityDatePropertyName)
Sets property AvailabilityDatePropertyName |
int |
setAvailabilityStatus(java.lang.String pId,
int pStatus)
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 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. |
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 |
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 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. |
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 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. |
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 |
unlock(java.lang.String pItemId)
Release the lock for the given id. |
protected void |
updateItem(MutableRepositoryItem pItem)
Update the item in the inventory |
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.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 |
---|
public static final java.lang.String CLASS_VERSION
Constructor Detail |
---|
public RepositoryInventoryManager()
Method Detail |
---|
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 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 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()
protected MutableRepositoryItem getInventoryItemForUpdate(java.lang.String pId) 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 itempublic void setInventoryName(java.lang.String pInventoryName)
public java.lang.String getInventoryName()
getInventoryName
in interface InventoryManager
public int purchase(java.lang.String pId, long pHowMany) throws InventoryException
purchase
in interface InventoryManager
pId
- The id of the SKU being purchased.pHowMany
- The amount of the SKU being purchased.
InventoryException
queryAvailabilityStatus(java.lang.String)
,
purchaseBundle(java.lang.String, long)
public int purchaseOffBackorder(java.lang.String pId, long pHowMany) throws InventoryException
purchaseOffBackorder
in interface InventoryManager
pId
- The id of the SKU being purchased.pHowMany
- The amount of the SKU being purchased.
InventoryException
queryAvailabilityStatus(java.lang.String)
,
purchaseBundleOffBackorder(java.lang.String, long)
public int purchaseOffPreorder(java.lang.String pId, long pHowMany) throws InventoryException
purchaseOffPreorder
in interface InventoryManager
pId
- The id of the SKU being purchased.pHowMany
- The amount of the SKU being purchased.
InventoryException
queryAvailabilityStatus(java.lang.String)
,
purchaseBundleOffPreorder(java.lang.String, long)
public int preorder(java.lang.String pId, long pHowMany) throws InventoryException
preorder
in interface InventoryManager
pId
- The id of the SKU being preordered.pHowMany
- The amount of the SKU being preordered.
InventoryException
preorderBundle(java.lang.String, long)
public int backorder(java.lang.String pId, long pHowMany) throws InventoryException
backorder
in interface InventoryManager
pId
- The id of the SKU being backordered.pHowMany
- The amount of the SKU being backordered..
InventoryException
backorderBundle(java.lang.String, long)
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 pLevelName
InventoryException
thresholdHasBeenReached(java.lang.String, java.lang.String, java.lang.String, long, long)
public int setStockLevel(java.lang.String pId, long pNumber) throws InventoryException
setStockLevel
in interface InventoryManager
pId
- The id of the SKU whose stockLevel is being setpNumber
- The amount to set the stockLevel to.
InventoryException
public int setBackorderLevel(java.lang.String pId, long pNumber) throws InventoryException
setBackorderLevel
in interface InventoryManager
pId
- The id of the SKU whose backorderLevel is being setpNumber
- The amount to set the backorderLevel to.
InventoryException
public int setPreorderLevel(java.lang.String pId, long pNumber) throws InventoryException
setPreorderLevel
in interface InventoryManager
pId
- The id of the SKU whose preorderLevel is being setpNumber
- The amount to set the preorderLevel to.
InventoryException
public int increaseStockLevel(java.lang.String pId, long pNumber) throws InventoryException
increaseStockLevel
in interface InventoryManager
pId
- The id of the SKU whose stockLevel is being increased.pNumber
- The amount to increase the stockLevel to.
InventoryException
public int decreaseStockLevel(java.lang.String pId, long pNumber) throws InventoryException
decreaseStockLevel
in interface InventoryManager
pId
- The id of the SKU whose stockLevel is being decreased.pNumber
- The amount to decrease the stockLevel to.
InventoryException
public int increaseBackorderLevel(java.lang.String pId, long pNumber) throws InventoryException
increaseBackorderLevel
in interface InventoryManager
pId
- The id of the SKU whose backorderLevel is being increased.pNumber
- The amount to increase the backorderLevel to.
InventoryException
public int decreaseBackorderLevel(java.lang.String pId, long pNumber) throws InventoryException
decreaseBackorderLevel
in interface InventoryManager
pId
- The id of the SKU whose backorderLevel is being decreased.pNumber
- The amount to decrease the backorderLevel to.
InventoryException
public int increasePreorderLevel(java.lang.String pId, long pNumber) throws InventoryException
increasePreorderLevel
in interface InventoryManager
pId
- The id of the SKU whose preorderLevel is being increased.pNumber
- The amount to increase the preorderLevel to.
InventoryException
public int decreasePreorderLevel(java.lang.String pId, long pNumber) throws InventoryException
decreasePreorderLevel
in interface InventoryManager
pId
- The id of the SKU whose preorderLevel is being decreased.pNumber
- The amount to decrease the preorderLevel to.
InventoryException
public int setAvailabilityStatus(java.lang.String pId, int pStatus) throws InventoryException
setAvailabilityStatus
in interface InventoryManager
pId
- 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)
InventoryException
public int setAvailabilityDate(java.lang.String pId, java.util.Date pDate) throws InventoryException
setAvailabilityDate
in interface InventoryManager
pId
- the id of the item involvedpDate
- The new availability date for the item.
InventoryException
public int queryAvailabilityStatus(java.lang.String pId) throws InventoryException
InventoryManager
queryAvailabilityStatus
in interface InventoryManager
InventoryException
- if there was a problem determining the status of the itempublic long queryStockLevel(java.lang.String pId) throws InventoryException
queryStockLevel
in interface InventoryManager
pId
- The id of the SKU whose stockLevel is returned
InventoryException
queryBundleStockLevel(java.lang.String)
public long queryBackorderLevel(java.lang.String pId) throws InventoryException
queryBackorderLevel
in interface InventoryManager
pId
- The id of the SKU whose backorderLevel is returned
InventoryException
queryBundleBackorderLevel(java.lang.String)
public long queryPreorderLevel(java.lang.String pId) throws InventoryException
queryPreorderLevel
in interface InventoryManager
pId
- The id of the SKU whose preorderLevel is returned
InventoryException
queryBundlePreorderLevel(java.lang.String)
public java.util.Date queryAvailabilityDate(java.lang.String pId) throws InventoryException
queryAvailabilityDate
in interface InventoryManager
pId
- The id of the SKU whose availabilityDate is returned
InventoryException
queryBundleAvailabilityDate(java.lang.String)
public int inventoryWasUpdated(java.util.List pItemIds) throws InventoryException
inventoryWasUpdated
in interface InventoryManager
pItemIds
- The items with recently added inventory
MissingInventoryItemException
- if a given id does not exist.
InventoryException
JMSException
public int setStockThreshold(java.lang.String pId, long pNumber) throws InventoryException
setStockThreshold
in interface InventoryManager
pId
- the id of the SKU involvedpNumber
- the number to set the threshold to
InventoryException
public int setBackorderThreshold(java.lang.String pId, long pNumber) throws InventoryException
setBackorderThreshold
in interface InventoryManager
pId
- the id of the SKU involvedpNumber
- the number to set the threshold to
InventoryException
public int setPreorderThreshold(java.lang.String pId, long pNumber) throws InventoryException
setPreorderThreshold
in interface InventoryManager
pId
- the id of the SKU involvedpNumber
- the number to set the threshold to
InventoryException
public long queryStockThreshold(java.lang.String pId) throws InventoryException
queryStockThreshold
in interface InventoryManager
pId
- the id of the SKU involved
InventoryException
public long queryBackorderThreshold(java.lang.String pId) throws InventoryException
queryBackorderThreshold
in interface InventoryManager
pId
- the id of the SKU involved
InventoryException
public long queryPreorderThreshold(java.lang.String pId) throws InventoryException
queryPreorderThreshold
in interface InventoryManager
pId
- the id of the SKU involved
InventoryException
protected 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 pThresholdPropertyName
InventoryException
InventoryThresholdReached
,
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 for
InventoryException
public java.lang.String getNextMessageId() throws InventoryException
InventoryException
protected void updateItem(MutableRepositoryItem pItem) throws RepositoryException
pItem
- The inventory's RepositoryItem
RepositoryException
protected void lock(java.lang.String pItemId) throws java.sql.SQLException
pItemId
- The catalog ref id whose inventory we want to change
java.sql.SQLException
getMillisecondDelayBeforeLockRetry()
,
getMaximumRetriesPerRowLock()
,
getInventoryRowLockProperty()
,
getInventoryRowLockSQL()
protected void unlock(java.lang.String pItemId) throws java.sql.SQLException
java.sql.SQLException
public void acquireInventoryLocks(java.util.List pItemIds) 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 InventoryManager
pItemIds
- The list of catalog ref ids
InventoryException
public void releaseInventoryLocks(java.util.List pItemIds) throws InventoryException
releaseInventoryLocks
in interface InventoryManager
InventoryException
public java.util.List getBundledIds(java.lang.String pBundleId) throws InventoryException
InventoryException
protected java.util.List getBundleLinks(java.lang.String pId) throws InventoryException
pId
- The id of the sku in question
InventoryException
protected java.util.List getBundleLinks(RepositoryItem pBundle) throws InventoryException
pBundle
- The sku.
InventoryException
protected boolean isBundle(java.lang.String pId) throws InventoryException
pId
- The id of the sku in question
InventoryException
protected 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 bundle
InventoryException
protected 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 purchase
InventoryException
protected int backorderBundle(java.lang.String pBundleId, long pHowMany) 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 backorder
InventoryException
protected 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 backorder
InventoryException
protected int purchaseBundleOffPreorder(java.lang.String pBundleId, long pHowMany) throws InventoryException
pBundleId
- The id of the bundlepHowMany
- the quantity of the bundle to purchase
InventoryException
protected int purchaseBundleOffBackorder(java.lang.String pBundleId, long pHowMany) throws InventoryException
pBundleId
- The id of the bundlepHowMany
- the quantity of the bundle to purchase
InventoryException
protected long queryBundleStockLevel(java.lang.String pId) throws InventoryException
pId
- The id of the bundle
InventoryException
protected long queryBundleBackorderLevel(java.lang.String pId) throws InventoryException
pId
- The id of the bundle
InventoryException
protected long queryBundlePreorderLevel(java.lang.String pId) throws InventoryException
pId
- The id of the bundle
InventoryException
protected long queryBundleStockThreshold(java.lang.String pId) throws InventoryException
pId
- The id of the bundle
InventoryException
protected long queryBundleBackorderThreshold(java.lang.String pId) throws InventoryException
pId
- The id of the bundle
InventoryException
protected long queryBundlePreorderThreshold(java.lang.String pId) throws InventoryException
pId
- The id of the bundle
InventoryException
public java.util.Date queryBundleAvailabilityDate(java.lang.String pBundleId) throws InventoryException
pBundleId
- The id of the bundle
InventoryException
MissingInventoryItemException
queryAvailabilityDate(java.lang.String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |