|
||||||||||
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 |
NO_PARENT_PRODUCT_FOUND
|
static java.lang.String |
NO_SUCH_ITEM
Resource keys for error messages |
static java.lang.String |
PARAM_LOCATION_ID
|
static java.lang.String |
PARAM_SITE_ID
|
static java.lang.String |
RQL_QUERY_DUPLICATE_BACK_IN_STOCK_ITEM
RQL query for duplicating item. |
static java.lang.String |
RQL_QUERY_DUPLICATE_BACK_IN_STOCK_ITEM_WITH_LOCATION
|
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 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,
java.lang.String pLocationId)
|
protected int |
deriveAvailabilityStatus(java.lang.String pSkuId,
java.lang.String pLocationId)
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. |
java.util.Date |
getBackorderAvailabilityDate(java.lang.String pSkuId,
java.lang.String pLocationId)
|
StoreCatalogProperties |
getCatalogProperties()
|
atg.service.util.CurrentDate |
getCurrentDate()
Gets the CurrentDate component. |
long |
getDefaultThresholdLevel()
|
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,
java.lang.String pLocationId)
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 |
isBackInStockItemExists(atg.repository.MutableRepository pRepository,
java.lang.String pCatalogRefId,
java.lang.String pEmail,
java.lang.String pProductId,
java.lang.String pLocationId)
|
boolean |
isItemInStock(java.lang.String pSkuId)
Returns true if SKU is in stock. |
boolean |
isItemInStock(java.lang.String pSkuId,
java.lang.String pLocationId)
|
boolean |
isLogMissingInventoryExceptionsAsError()
Return the logMissingInventoryExceptionsAsError property. |
boolean |
logInventoryException(atg.commerce.inventory.InventoryException pException)
The method logs InventoryException. |
int |
queryAvailabilityStatus(atg.repository.RepositoryItem pProduct,
java.lang.String pSkuId)
Derive the availabilityStatus based on the properties of the product and the item. |
int |
queryAvailabilityStatus(atg.repository.RepositoryItem pProduct,
java.lang.String pSkuId,
java.lang.String pLocationId)
|
int |
queryAvailabilityStatus(java.lang.String pSkuId,
java.lang.String pLocationId)
Override base method to honor not only inventory item but product's preorderable settings when determining availability status. |
void |
setCatalogProperties(StoreCatalogProperties pCatalogProperties)
|
void |
setCurrentDate(atg.service.util.CurrentDate pCurrentDate)
Sets the CurrentDate component. |
void |
setDefaultThresholdLevel(long pDefaultThresholdLevel)
|
void |
setLogMissingInventoryExceptionsAsError(boolean pLogMissingInventoryExceptionsAsError)
Set the logMissingInventoryExceptionsAsError property. |
void |
setOrderRepository(atg.repository.Repository pOrderRepository)
|
void |
setPropertyManager(StorePropertyManager pPropertyManager)
. |
int |
setStockLevel(java.lang.String pSkuId,
long pQuantity,
java.lang.String pLocationId)
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, acquireInventoryLocks, backorder, backorder, backorderBundle, decreaseBackorderLevel, decreaseBackorderLevel, decreasePreorderLevel, decreasePreorderLevel, decreaseStockLevel, decreaseStockLevel, decrementSKULevel, decrementSKULevel, deriveAvailabilityStatus, deriveBundleAvailabilityStatus, deriveBundleAvailabilityStatus, getATPDatePropertyName, getATPInformationPropertyName, getATPQuantityPropertyName, 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, getInventoryItem, getInventoryItemForUpdate, getInventoryItemForUpdate, getInventoryName, getInventoryRowLockProperty, getInventoryRowLockSQL, getItemType, getLocationCatalogRefIdMatchQuery, getLocationInventoryRowLockSQL, getMaximumRetriesPerRowLock, getMessageIdGenerator, getMessageIdSpaceName, getMillisecondDelayBeforeLockRetry, getNextMessageId, getPreorderLevelPropertyName, getPreorderThresholdPropertyName, getRepository, getSkuLinkItemPropertyName, getSkuLinkQuantityPropertyName, getStockLevelPropertyName, getStockThresholdPropertyName, getUpdateInventoryPort, increaseBackorderLevel, increaseBackorderLevel, increasePreorderLevel, increasePreorderLevel, increaseStockLevel, inventoryWasUpdated, inventoryWasUpdated, isBundle, lock, lock, preorder, preorder, preorderBundle, preorderBundle, purchase, purchase, purchaseBundle, purchaseBundle, purchaseBundleOffBackorder, purchaseBundleOffBackorder, purchaseBundleOffPreorder, purchaseBundleOffPreorder, purchaseOffBackorder, purchaseOffBackorder, purchaseOffPreorder, purchaseOffPreorder, queryAvailabilityDate, queryAvailabilityDate, queryAvailabilityStatus, queryAvailableToPromise, queryBackorderLevel, queryBackorderLevel, queryBackorderThreshold, queryBackorderThreshold, queryBundleAvailabilityDate, queryBundleBackorderLevel, queryBundleBackorderLevel, queryBundleBackorderThreshold, queryBundlePreorderLevel, queryBundlePreorderThreshold, queryBundleStockLevel, queryBundleStockThreshold, queryInventoryInformation, queryInventoryInformation, queryInventoryInformation, queryInventoryInformation, queryPreorderLevel, queryPreorderLevel, queryPreorderThreshold, queryPreorderThreshold, queryStockLevel, queryStockLevel, queryStockThreshold, queryStockThreshold, releaseInventoryLocks, releaseInventoryLocks, setATPDatePropertyName, setATPInformationPropertyName, setATPQuantityPropertyName, setAvailabilityDate, setAvailabilityDate, setAvailabilityDatePropertyName, setAvailabilityStatus, setAvailabilityStatus, setAvailabilityStatusBackorderableValue, setAvailabilityStatusDerivedValue, setAvailabilityStatusDiscontinuedValue, setAvailabilityStatusInStockValue, setAvailabilityStatusOutOfStockValue, setAvailabilityStatusPreorderableValue, setAvailabilityStatusPropertyName, setBackorderLevel, setBackorderLevel, setBackorderLevelPropertyName, setBackorderThreshold, setBackorderThreshold, setBackorderThresholdPropertyName, setBundleLinksPropertyName, setCatalogRefIdMatchQuery, setCatalogRefIdPropertyName, setCatalogRefItemType, setCatalogRefRepository, setClientLockManager, setDefaultBackorderLevel, setDefaultPreorderLevel, setDefaultStockLevel, setInventoryEventPort, setInventoryName, setInventoryRowLockProperty, setInventoryRowLockSQL, setItemType, setLocationCatalogRefIdMatchQuery, setLocationInventoryRowLockSQL, setMaximumRetriesPerRowLock, setMessageIdGenerator, setMessageIdSpaceName, setMillisecondDelayBeforeLockRetry, setPreorderLevel, setPreorderLevel, setPreorderLevelPropertyName, setPreorderThreshold, setPreorderThreshold, setPreorderThresholdPropertyName, setRepository, setSkuLinkItemPropertyName, setSkuLinkQuantityPropertyName, setStockLevel, setStockLevelPropertyName, setStockThreshold, setStockThreshold, setStockThresholdPropertyName, setUpdateInventoryPort, thresholdHasBeenReached, thresholdHasBeenReached, unlock, 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 PARAM_LOCATION_ID
public static final java.lang.String CLASS_VERSION
public static final java.lang.String NO_SUCH_ITEM
public static final java.lang.String NO_PARENT_PRODUCT_FOUND
public static final java.lang.String RQL_QUERY_DUPLICATE_BACK_IN_STOCK_ITEM
public static final java.lang.String RQL_QUERY_DUPLICATE_BACK_IN_STOCK_ITEM_WITH_LOCATION
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 set.public void setDefaultThresholdLevel(long pDefaultThresholdLevel)
pDefaultThresholdLevel
- - the default value if the stock level of an item is not defined.public 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 void setLogMissingInventoryExceptionsAsError(boolean pLogMissingInventoryExceptionsAsError)
public boolean isLogMissingInventoryExceptionsAsError()
public int setStockLevel(java.lang.String pSkuId, long pQuantity, java.lang.String pLocationId) throws atg.commerce.inventory.InventoryException
setStockLevel
in interface atg.commerce.inventory.LocationInventoryManager
setStockLevel
in class atg.commerce.inventory.RepositoryInventoryManager
pSkuId
- - The id of the SKU whose stockLevel is being set.pQuantity
- - The amount to set the stockLevel to.
atg.commerce.inventory.InventoryException
- if there was an error while attempting to return the inventory information.public int increaseStockLevel(java.lang.String pSkuId, long pQuantity, java.lang.String pLocationId) throws atg.commerce.inventory.InventoryException
increaseStockLevel
in interface atg.commerce.inventory.LocationInventoryManager
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 information.protected int deriveAvailabilityStatus(java.lang.String pSkuId, java.lang.String pLocationId) throws atg.commerce.inventory.InventoryException
Derive the availabilityStatus based on the properties of the item. Always derives the status, does not check the current value of availabilityStatus.
Uses these rules: (a negative level indicates infinite supply)
if (stockLevel > stockThreshold) return IN_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 information.public 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 information.public boolean isItemInStock(java.lang.String pSkuId, java.lang.String pLocationId) throws atg.commerce.inventory.InventoryException
atg.commerce.inventory.InventoryException
public int queryAvailabilityStatus(atg.repository.RepositoryItem pProduct, java.lang.String pSkuId) throws atg.commerce.inventory.InventoryException
pProduct
- The product we are deriving the status for.pSkuId
- The SKU we are deriving the status for.
atg.commerce.inventory.InventoryException
- if there was an error while attempting to return the inventory information.public int queryAvailabilityStatus(atg.repository.RepositoryItem pProduct, java.lang.String pSkuId, java.lang.String pLocationId) throws atg.commerce.inventory.InventoryException
atg.commerce.inventory.InventoryException
public int queryAvailabilityStatus(java.lang.String pSkuId, java.lang.String pLocationId) throws atg.commerce.inventory.InventoryException
queryAvailabilityStatus
in interface atg.commerce.inventory.LocationInventoryManager
queryAvailabilityStatus
in class atg.commerce.inventory.RepositoryInventoryManager
atg.commerce.inventory.InventoryException
public 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 information.public java.util.Date getBackorderAvailabilityDate(java.lang.String pSkuId, java.lang.String pLocationId) throws atg.commerce.inventory.InventoryException
atg.commerce.inventory.InventoryException
protected long getInventoryLevel(atg.repository.RepositoryItem pInventory, java.lang.String pInventoryLevelPropertyName, long pDefaultLevel) throws atg.commerce.inventory.InventoryException
pInventory
- - The inventory repository Item to work with.pInventoryLevelPropertyName
- - the property name of the inventory property that denotes the level.pDefaultLevel
- a default level if the property is not set.
atg.commerce.inventory.InventoryException
- if there was an error while attempting
to return the inventory information.protected 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 from.pPropertyName
- 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 exists.pCatalogRefId
- - repository id.pEmail
- - string that represents email.pProductId
- - product id.
atg.repository.RepositoryException
- if there was an error while creating repository item.public boolean isBackInStockItemExists(atg.repository.MutableRepository pRepository, java.lang.String pCatalogRefId, java.lang.String pEmail, java.lang.String pProductId, java.lang.String pLocationId) throws atg.repository.RepositoryException
atg.repository.RepositoryException
protected 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 item.pCatalogRefId
- - repository id.pEmail
- - string that represents email.pProductId
- - product id.
atg.repository.RepositoryException
- if there was an error while creating repository item.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) throws atg.repository.RepositoryException
pRepository
- - Repository where to create item.pCatalogRefId
- - repository id.pEmail
- - string that represents email.pProductId
- - product id.pLocale
- - local.pSiteId
- - site id.
atg.repository.RepositoryException
- if there was an error while creating repository item.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, java.lang.String pLocationId) throws atg.repository.RepositoryException
atg.repository.RepositoryException
public boolean logInventoryException(atg.commerce.inventory.InventoryException pException)
logMissingInventoryExceptionsAsError
property is configured
to true.
pException
- The InventoryException to log.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |