|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.commerce.inventory.CachingInventoryManager
public class CachingInventoryManager
This class is configured with a datasource repository and a cache, and caches SKU items so that data may be fetched quickly and easily. Purchase requests are amassed and committed all at once.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
static int |
UNCACHED_INVENTORY_MANAGER_NOT_SET
return code when uncachedInventoryManger is not set |
Constructor Summary | |
---|---|
CachingInventoryManager()
|
Method Summary | |
---|---|
void |
acquireInventoryLocks(java.util.List pItemIds)
Acquires locks for the inventory items that apply to the given ids. |
int |
backorder(java.lang.String pId,
long pHowMany)
Backorder an item. |
int |
decreaseBackorderLevel(java.lang.String pId,
long pNumber)
Decrease an item's backorder level by the specified amount. |
int |
decreasePreorderLevel(java.lang.String pId,
long pNumber)
Decrease an item's preorder level by the specified amount. |
int |
decreaseStockLevel(java.lang.String pId,
long pNumber)
Decrease an item's stock level by the specified amount. |
void |
flushCache()
Invalidate all the entries in the cache. |
void |
flushCache(java.util.List pItemIds)
Invalidates the cache entries for the given ids. |
Cache |
getInventoryCache()
Returns property InventoryCache |
java.lang.String |
getInventoryName()
A displayable name for thie inventory manager. |
InventoryManager |
getUncachedInventoryManager()
Returns property UncachedInventoryManager |
int |
increaseBackorderLevel(java.lang.String pId,
long pNumber)
Increase an item's backorder level by the specified number. |
int |
increasePreorderLevel(java.lang.String pId,
long pNumber)
Increase an item's preorder level by the specified number. |
int |
increaseStockLevel(java.lang.String pId,
long pNumber)
Increase an item's stock level by the specified number. |
int |
inventoryWasUpdated(java.util.List pItemIds)
Informs the inventory manager that the given ids are now available. |
int |
preorder(java.lang.String pId,
long pHowMany)
Preorder an item. |
int |
purchase(java.lang.String pId,
long pHowMany)
Actually purchases a product. |
int |
purchaseOffBackorder(java.lang.String pId,
long pHowMany)
Actually purchases a product. |
int |
purchaseOffPreorder(java.lang.String pId,
long pHowMany)
Actually purchases a product. |
java.util.Date |
queryAvailabilityDate(java.lang.String pId)
Return 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)
Return how many of a given item are available for backorder. |
long |
queryBackorderThreshold(java.lang.String pId)
Return the threshold associated with backorderLevel |
long |
queryPreorderLevel(java.lang.String pId)
Return how many of a given item are available for preorder. |
long |
queryPreorderThreshold(java.lang.String pId)
Return the threshold associated with preorderLevel |
long |
queryStockLevel(java.lang.String pId)
Return how many of a given item are in the system. |
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. |
int |
setAvailabilityStatus(java.lang.String pId,
int pStatus)
Set an item's availability status. |
int |
setBackorderLevel(java.lang.String pId,
long pNumber)
Set an item's backorder level to the specified number. |
int |
setBackorderThreshold(java.lang.String pId,
long pNumber)
Set an item's backorder level threshold. |
void |
setInventoryCache(Cache pInventoryCache)
Sets property InventoryCache |
void |
setInventoryName(java.lang.String pInventoryName)
|
int |
setPreorderLevel(java.lang.String pId,
long pNumber)
Set an item's preorder level to the specified number. |
int |
setPreorderThreshold(java.lang.String pId,
long pNumber)
Set an item's preorder level threshold. |
int |
setStockLevel(java.lang.String pId,
long pNumber)
Set an item's stock level to the specified number. |
int |
setStockThreshold(java.lang.String pId,
long pNumber)
Set an item's stock level threshold. |
void |
setUncachedInventoryManager(InventoryManager pUncachedInventoryManager)
Sets property UncachedInventoryManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
public static final int UNCACHED_INVENTORY_MANAGER_NOT_SET
Constructor Detail |
---|
public CachingInventoryManager()
Method Detail |
---|
public void setInventoryCache(Cache pInventoryCache)
public Cache getInventoryCache()
public void setUncachedInventoryManager(InventoryManager pUncachedInventoryManager)
public InventoryManager getUncachedInventoryManager()
public 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 item involved
InventoryException
- if there was a problem during the purchase process.public int purchaseOffBackorder(java.lang.String pId, long pHowMany) throws InventoryException
purchaseOffBackorder
in interface InventoryManager
pId
- the id of the item involved
InventoryException
- if there was a problem during the purchase process.public int purchaseOffPreorder(java.lang.String pId, long pHowMany) throws InventoryException
purchaseOffPreorder
in interface InventoryManager
pId
- the id of the item involved
InventoryException
- if there was a problem during the purchase process.public int preorder(java.lang.String pId, long pHowMany) throws InventoryException
preorder
in interface InventoryManager
pId
- the id of the item involved
InventoryException
- if there was a problem in trying to preorder the itempublic int backorder(java.lang.String pId, long pHowMany) throws InventoryException
backorder
in interface InventoryManager
pId
- the id of the item involved
InventoryException
- if there was a problem with the backordering process.public int setStockLevel(java.lang.String pId, long pNumber) throws InventoryException
setStockLevel
in interface InventoryManager
pId
- the id of the item involvedpNumber
- the number of the given item to restock
InventoryException
- if there was a problem trying to restockpublic int setBackorderLevel(java.lang.String pId, long pNumber) throws InventoryException
setBackorderLevel
in interface InventoryManager
pId
- the id of the item involvedpNumber
- the number of the given item to restock
InventoryException
- if there was a problem trying to restockpublic int setPreorderLevel(java.lang.String pId, long pNumber) throws InventoryException
setPreorderLevel
in interface InventoryManager
pId
- the id of the item involvedpNumber
- the number of the given item to restock
InventoryException
- if there was a problem trying to restockpublic int increaseStockLevel(java.lang.String pId, long pNumber) throws InventoryException
increaseStockLevel
in interface InventoryManager
pId
- the id of the item involvedpNumber
- the number of items to add to the current stock level
InventoryException
- if there was a problem trying to restockpublic int decreaseStockLevel(java.lang.String pId, long pNumber) throws InventoryException
decreaseStockLevel
in interface InventoryManager
pId
- the id of the item involvedpNumber
- the number of items to decrease from the current stock level
InventoryException
- if there was a problem trying to restockpublic int increaseBackorderLevel(java.lang.String pId, long pNumber) throws InventoryException
increaseBackorderLevel
in interface InventoryManager
pId
- the id of the item involvedpNumber
- the number of items to add to the current stock level
InventoryException
- if there was a problem trying to restockpublic int decreaseBackorderLevel(java.lang.String pId, long pNumber) throws InventoryException
decreaseBackorderLevel
in interface InventoryManager
pId
- the id of the item involvedpNumber
- the number of items to decrease from the current stock level
InventoryException
- if there was a problem trying to restockpublic int increasePreorderLevel(java.lang.String pId, long pNumber) throws InventoryException
increasePreorderLevel
in interface InventoryManager
pId
- the id of the item involvedpNumber
- the number of items to add to the current stock level
InventoryException
- if there was a problem trying to restockpublic int decreasePreorderLevel(java.lang.String pId, long pNumber) throws InventoryException
decreasePreorderLevel
in interface InventoryManager
pId
- the id of the item involvedpNumber
- the number of items to decrease from the current stock level
InventoryException
- if there was a problem trying to restockpublic int setStockThreshold(java.lang.String pId, long pNumber) throws InventoryException
setStockThreshold
in interface InventoryManager
pId
- the id of the item involvedpNumber
- the number of the given item to restock
InventoryException
- if there was a problem trying to restockpublic int setBackorderThreshold(java.lang.String pId, long pNumber) throws InventoryException
setBackorderThreshold
in interface InventoryManager
pId
- the id of the item involvedpNumber
- the number of the given item to restock
InventoryException
- if there was a problem trying to restockpublic int setPreorderThreshold(java.lang.String pId, long pNumber) throws InventoryException
setPreorderThreshold
in interface InventoryManager
pId
- the id of the item involvedpNumber
- the number of the given item to restock
InventoryException
- if there was a problem trying to restockpublic 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 long queryStockThreshold(java.lang.String pId) throws InventoryException
queryStockThreshold
in interface InventoryManager
InventoryException
- if there was a problem determining the numberpublic long queryBackorderThreshold(java.lang.String pId) throws InventoryException
queryBackorderThreshold
in interface InventoryManager
InventoryException
- if there was a problem determining the numberpublic long queryPreorderThreshold(java.lang.String pId) throws InventoryException
queryPreorderThreshold
in interface InventoryManager
InventoryException
- if there was a problem determining the numberpublic long queryStockLevel(java.lang.String pId) throws InventoryException
queryStockLevel
in interface InventoryManager
InventoryException
- if there was a problem determining the numberpublic long queryPreorderLevel(java.lang.String pId) throws InventoryException
queryPreorderLevel
in interface InventoryManager
InventoryException
- if there was a problem determining the numberpublic long queryBackorderLevel(java.lang.String pId) throws InventoryException
queryBackorderLevel
in interface InventoryManager
InventoryException
- if there was a problem determining the numberpublic int queryAvailabilityStatus(java.lang.String pId) throws InventoryException
queryAvailabilityStatus
in interface InventoryManager
InventoryException
- if there was a problem determining the status of the itempublic java.util.Date queryAvailabilityDate(java.lang.String pId) throws InventoryException
queryAvailabilityDate
in interface InventoryManager
InventoryException
- if there was a problem determining the datepublic int inventoryWasUpdated(java.util.List pItemIds) throws InventoryException
inventoryWasUpdated
in interface InventoryManager
pItemIds
- The items with recently added inventory
InventoryException
public void acquireInventoryLocks(java.util.List pItemIds) throws InventoryException
acquireInventoryLocks
in interface InventoryManager
InventoryException
public void releaseInventoryLocks(java.util.List pItemIds) throws InventoryException
releaseInventoryLocks
in interface InventoryManager
InventoryException
public void flushCache()
public void flushCache(java.util.List pItemIds)
pItemIds
- The list of ids whose entries should be invalidated
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |