|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.commerce.messaging.SourceSinkTemplate
atg.commerce.inventory.RepositoryInventoryManager
atg.projects.store.inventory.StoreInventoryManager
public class StoreInventoryManager
This class is an extension of the RepositoryInventoryManager. It will be responsible for writing to the inventory repository. This should only happen from the fulfillment server.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string. |
static long |
DEFAULT_THRESHOLD_LEVEL
Default threshold level constant. |
static java.lang.String |
PARAM_SITE_ID
|
static java.lang.String |
RQL_QUERY_DUPLICATE_BACK_IN_STOCK_ITEM
RQL query for duplicating item. |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.commerce.inventory.InventoryManager |
---|
AVAILABILITY_STATUS_BACKORDERABLE, AVAILABILITY_STATUS_DERIVED, AVAILABILITY_STATUS_DISCONTINUED, AVAILABILITY_STATUS_IN_STOCK, AVAILABILITY_STATUS_OUT_OF_STOCK, AVAILABILITY_STATUS_PREORDERABLE, INVENTORY_STATUS_FAIL, INVENTORY_STATUS_INSUFFICIENT_SUPPLY, INVENTORY_STATUS_ITEM_NOT_FOUND, INVENTORY_STATUS_SUCCEED |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
StoreInventoryManager()
|
Method Summary | |
---|---|
protected void |
createBackInStockNotifyItem(atg.repository.MutableRepository pRepository,
java.lang.String pCatalogRefId,
java.lang.String pEmail,
java.lang.String pProductId)
Creates the required item in the repository. |
protected void |
createBackInStockNotifyItem(atg.repository.MutableRepository pRepository,
java.lang.String pCatalogRefId,
java.lang.String pEmail,
java.lang.String pProductId,
java.lang.String pLocale,
java.lang.String pSiteId)
Creates the required item in the repository. |
protected int |
deriveAvailabilityStatus(java.lang.String pSkuId)
Derive the availabilityStatus based on the properties of the item. |
java.util.Date |
getBackorderAvailabilityDate(java.lang.String pSkuId)
Get the availabilityDate from the inventory data for a sku item. |
StoreCatalogProperties |
getCatalogProperties()
|
atg.service.util.CurrentDate |
getCurrentDate()
Gets the CurrentDate component. |
long |
getDefaultThresholdLevel()
The default value if the stock level of an item is not defined. |
protected long |
getInventoryLevel(atg.repository.RepositoryItem pInventory,
java.lang.String pInventoryLevelPropertyName,
long pDefaultLevel)
Given the inventory item of note get the inventory level for the particular property. |
atg.repository.Repository |
getOrderRepository()
|
java.util.Date |
getPreorderAvailabilityDate(atg.repository.RepositoryItem pProduct)
Get the availabilityDate for a product. |
StorePropertyManager |
getPropertyManager()
|
protected java.lang.Object |
getPropertyValue(atg.repository.RepositoryItem pItem,
java.lang.String pPropertyName)
Returns the object associated with the given property name. |
int |
increaseStockLevel(java.lang.String pSkuId,
long pQuantity)
This method will send an "UpdateInventory" message if the item changes from Out of stock to In stock with this method. |
boolean |
isBackInStockItemExists(atg.repository.MutableRepository pRepository,
java.lang.String pCatalogRefId,
java.lang.String pEmail,
java.lang.String pProductId)
Check to see if backInStoreNotifyItem already exists for this combination of CatalogRefId and email. |
boolean |
isItemInStock(java.lang.String pSkuId)
Returns true if SKU is in stock |
int |
queryAvailabilityStatus(atg.repository.RepositoryItem pProduct,
java.lang.String pSkuId)
Derive the availabilityStatus based on the properties of the product and the item. |
void |
setCatalogProperties(StoreCatalogProperties pCatalogProperties)
|
void |
setCurrentDate(atg.service.util.CurrentDate pCurrentDate)
Sets the CurrentDate component. |
void |
setDefaultThresholdLevel(long pDefaultThresholdLevel)
Default value if the stock level of an item is not defined. |
void |
setOrderRepository(atg.repository.Repository pOrderRepository)
|
void |
setPropertyManager(StorePropertyManager pPropertyManager)
|
int |
setStockLevel(java.lang.String pSkuId,
long pQuantity)
This method will send an "UpdateInventory" message if the item changes from Out of stock to In stock with this method. |
Methods inherited from class atg.commerce.inventory.RepositoryInventoryManager |
---|
acquireInventoryLocks, backorder, backorderBundle, decreaseBackorderLevel, decreasePreorderLevel, decreaseStockLevel, decrementSKULevel, deriveBundleAvailabilityStatus, getAvailabilityDatePropertyName, getAvailabilityStatusBackorderableValue, getAvailabilityStatusDerivedValue, getAvailabilityStatusDiscontinuedValue, getAvailabilityStatusInStockValue, getAvailabilityStatusOutOfStockValue, getAvailabilityStatusPreorderableValue, getAvailabilityStatusPropertyName, getBackorderLevelPropertyName, getBackorderThresholdPropertyName, getBundledIds, getBundleLinks, getBundleLinks, getBundleLinksPropertyName, getCatalogRefIdMatchQuery, getCatalogRefIdPropertyName, getCatalogRefItem, getCatalogRefItemType, getCatalogRefRepository, getClientLockManager, getDefaultBackorderLevel, getDefaultPreorderLevel, getDefaultStockLevel, getInventoryEventPort, getInventoryItem, getInventoryItemForUpdate, getInventoryName, getInventoryRowLockProperty, getInventoryRowLockSQL, getItemType, getMaximumRetriesPerRowLock, getMessageIdGenerator, getMessageIdSpaceName, getMillisecondDelayBeforeLockRetry, getNextMessageId, getPreorderLevelPropertyName, getPreorderThresholdPropertyName, getRepository, getSkuLinkItemPropertyName, getSkuLinkQuantityPropertyName, getStockLevelPropertyName, getStockThresholdPropertyName, getUpdateInventoryPort, increaseBackorderLevel, increasePreorderLevel, inventoryWasUpdated, isBundle, lock, preorder, preorderBundle, purchase, purchaseBundle, purchaseBundleOffBackorder, purchaseBundleOffPreorder, purchaseOffBackorder, purchaseOffPreorder, queryAvailabilityDate, queryAvailabilityStatus, queryBackorderLevel, queryBackorderThreshold, queryBundleAvailabilityDate, queryBundleBackorderLevel, queryBundleBackorderThreshold, queryBundlePreorderLevel, queryBundlePreorderThreshold, queryBundleStockLevel, queryBundleStockThreshold, queryPreorderLevel, queryPreorderThreshold, queryStockLevel, queryStockThreshold, releaseInventoryLocks, setAvailabilityDate, setAvailabilityDatePropertyName, setAvailabilityStatus, setAvailabilityStatusBackorderableValue, setAvailabilityStatusDerivedValue, setAvailabilityStatusDiscontinuedValue, setAvailabilityStatusInStockValue, setAvailabilityStatusOutOfStockValue, setAvailabilityStatusPreorderableValue, setAvailabilityStatusPropertyName, setBackorderLevel, setBackorderLevelPropertyName, setBackorderThreshold, setBackorderThresholdPropertyName, setBundleLinksPropertyName, setCatalogRefIdMatchQuery, setCatalogRefIdPropertyName, setCatalogRefItemType, setCatalogRefRepository, setClientLockManager, setDefaultBackorderLevel, setDefaultPreorderLevel, setDefaultStockLevel, setInventoryEventPort, setInventoryName, setInventoryRowLockProperty, setInventoryRowLockSQL, setItemType, setMaximumRetriesPerRowLock, setMessageIdGenerator, setMessageIdSpaceName, setMillisecondDelayBeforeLockRetry, setPreorderLevel, setPreorderLevelPropertyName, setPreorderThreshold, setPreorderThresholdPropertyName, setRepository, setSkuLinkItemPropertyName, setSkuLinkQuantityPropertyName, setStockLevelPropertyName, setStockThreshold, setStockThresholdPropertyName, setUpdateInventoryPort, thresholdHasBeenReached, unlock, updateItem |
Methods inherited from class atg.commerce.messaging.SourceSinkTemplate |
---|
getDelayOnSendRetry, getMessageSourceContext, getMessageSourceName, getTransactionManager, isAllowMessageSending, receiveMessage, sendCommerceMessage, sendObjectMessage, setAllowMessageSending, setDelayOnSendRetry, setMessageSourceContext, setMessageSourceName, setTransactionManager, startMessageSource, stopMessageSource |
Methods inherited from class atg.nucleus.GenericService |
---|
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PARAM_SITE_ID
public static final java.lang.String CLASS_VERSION
public static final java.lang.String RQL_QUERY_DUPLICATE_BACK_IN_STOCK_ITEM
public static final long DEFAULT_THRESHOLD_LEVEL
Constructor Detail |
---|
public StoreInventoryManager()
Method Detail |
---|
public StorePropertyManager getPropertyManager()
public void setPropertyManager(StorePropertyManager pPropertyManager)
pPropertyManager
- the StorePropertyManager to setpublic void setDefaultThresholdLevel(long pDefaultThresholdLevel)
pDefaultThresholdLevel
- default threshold levelpublic long getDefaultThresholdLevel()
public atg.repository.Repository getOrderRepository()
public void setOrderRepository(atg.repository.Repository pOrderRepository)
pOrderRepository
- - order repository.public StoreCatalogProperties getCatalogProperties()
public void setCatalogProperties(StoreCatalogProperties pCatalogProperties)
pCatalogProperties
- - catalog properties to set.public void setCurrentDate(atg.service.util.CurrentDate pCurrentDate)
public atg.service.util.CurrentDate getCurrentDate()
public int setStockLevel(java.lang.String pSkuId, long pQuantity) throws atg.commerce.inventory.InventoryException
setStockLevel
in interface atg.commerce.inventory.InventoryManager
setStockLevel
in class atg.commerce.inventory.RepositoryInventoryManager
pSkuId
- The id of the SKU whose stockLevel is being setpQuantity
- The amount to set the stockLevel to.
atg.commerce.inventory.InventoryException
- if there was an error while attempting to return
the inventory informationpublic int increaseStockLevel(java.lang.String pSkuId, long pQuantity) throws atg.commerce.inventory.InventoryException
increaseStockLevel
in interface atg.commerce.inventory.InventoryManager
increaseStockLevel
in class atg.commerce.inventory.RepositoryInventoryManager
pSkuId
- The id of the SKU whose stockLevel is being increased.pQuantity
- The amount to increase the stockLevel to.
atg.commerce.inventory.InventoryException
- if there was an error while attempting to return
the inventory informationprotected int deriveAvailabilityStatus(java.lang.String pSkuId) throws atg.commerce.inventory.InventoryException
if (stockLevel > stockThreshold) return IN_STOCK;
else if (backorderLevel > backorderThreshold) return BACKORDERABLE;
else if (preorderLevel > preorderThreshold) return PREORDERABLE;
else return OUT_OF_STOCK;
deriveAvailabilityStatus
in class atg.commerce.inventory.RepositoryInventoryManager
pSkuId
- The sku we are deriving the status for
atg.commerce.inventory.InventoryException
- if there was an error while attempting to return
the inventory informationpublic boolean isItemInStock(java.lang.String pSkuId) throws atg.commerce.inventory.InventoryException
pSkuId
- SKU ID
atg.commerce.inventory.InventoryException
- if there was an error while attempting to return
the inventory informationpublic int queryAvailabilityStatus(atg.repository.RepositoryItem pProduct, java.lang.String pSkuId) throws atg.commerce.inventory.InventoryException
pProduct
- The product we are deriving the status forpSkuId
- The sku we are deriving the status for
atg.commerce.inventory.InventoryException
- if there was an error while attempting to return
the inventory informationpublic java.util.Date getPreorderAvailabilityDate(atg.repository.RepositoryItem pProduct)
pProduct
- The product we are getting the availability date for
public java.util.Date getBackorderAvailabilityDate(java.lang.String pSkuId) throws atg.commerce.inventory.InventoryException
pSkuId
- The sku we are getting the availability date for
atg.commerce.inventory.InventoryException
- if there was an error while attempting to return
the inventory informationprotected long getInventoryLevel(atg.repository.RepositoryItem pInventory, java.lang.String pInventoryLevelPropertyName, long pDefaultLevel) throws atg.commerce.inventory.InventoryException
pInventory
- - The inventory repository Item to work withpInventoryLevelPropertyName
- - the property name of the inventory property that denotes the levelpDefaultLevel
- a default level if the property is unset
atg.commerce.inventory.InventoryException
- if there was an error while attempting
to return the inventory informationprotected java.lang.Object getPropertyValue(atg.repository.RepositoryItem pItem, java.lang.String pPropertyName) throws atg.commerce.inventory.InventoryException
pItem
- the repository item to fetch the value frompPropertyName
- the property value to return
atg.commerce.inventory.InventoryException
- if there was an error while attempting to return the inventory information. An
error can occur if no item can be found with the given id; if the value from the named property is
null, or a general RepositoryException occurs.public boolean isBackInStockItemExists(atg.repository.MutableRepository pRepository, java.lang.String pCatalogRefId, java.lang.String pEmail, java.lang.String pProductId) throws atg.repository.RepositoryException
pRepository
- Repository where to check if item existspCatalogRefId
- repository idpEmail
- string that represents emailpProductId
- product id
atg.repository.RepositoryException
- if there was an error while creating repository itemprotected void createBackInStockNotifyItem(atg.repository.MutableRepository pRepository, java.lang.String pCatalogRefId, java.lang.String pEmail, java.lang.String pProductId) throws atg.repository.RepositoryException
pRepository
- Repository where to create itempCatalogRefId
- repository idpEmail
- string that represents emailpProductId
- product id
atg.repository.RepositoryException
- if there was an error while creating repository itemprotected void createBackInStockNotifyItem(atg.repository.MutableRepository pRepository, java.lang.String pCatalogRefId, java.lang.String pEmail, java.lang.String pProductId, java.lang.String pLocale, java.lang.String pSiteId) throws atg.repository.RepositoryException
pRepository
- Repository where to create itempCatalogRefId
- repository idpEmail
- string that represents emailpProductId
- product idpLocale
- localpSiteId
- site id
atg.repository.RepositoryException
- if there was an error while creating repository item
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |