public class ComposeDOMInventoryAvailabilityCmdImpl extends AbstractComposeInventoryAvailabilityCmdImpl
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM Copyright notice field.
|
protected boolean | isCacheValid
used to indicate whether the cache is expired immediately.
|
protected static java.util.Hashtable | lockTable
used to store the lock objects for each catentry.
|
Constructor and Description |
---|
ComposeDOMInventoryAvailabilityCmdImpl() |
Modifier and Type | Method and Description |
---|---|
protected java.util.List | callGetInventoryAvailabilityService(GetInventoryAvailabilityType getInventoryAvailability)
Call the outbound service to get the inventoryAvailbility information
|
protected InventoryAvailabilityIdentifierType | composeInventoryAvailabilityIdentifier(java.lang.String catentryId, java.lang.String onlineStoreId, java.lang.String physicalStoreId)
This method builds the InventoryAvailabilityIdentifier object.
|
protected java.util.List | composeInventoryAvailabilityWithFallbackData(java.lang.String catentryId, java.lang.String onlineStoreId, java.lang.String physicalStoreId, Invcnf inventoryConfiguration)
This method builds the InventoryAvailability noun with the fallback data.
|
void | execute()
This method performs the main business logic to compose InventoryAvailabilityType from DOM inventory system.
|
protected java.util.List | fetchDOMInventoryAvailabilityNouns(java.lang.String catentryId, java.lang.String onlineStoreId, java.lang.String physicalStoreId)
This method fetches the inventory availability of the given catalog entry and location combination.
|
protected BusinessContextType | getBusinessContext()
Returns a business context with a standard set of context data.
|
protected java.util.List | getInventoryAvailabilityFromDOM(java.lang.String catalogEntryId)
This method gets the inventory availability from external Order Management System.
|
protected int | getPhysicalStoreIndex(java.lang.String astrIdentifierOrId)
Gets the index of a physical store identifier or ID.
|
protected java.lang.Double | getStopCheckingDOMThreshold(java.lang.String onlineStoreId)
This method returns the value of stop checking DOM threshold.
|
java.util.List | getUncachedOnlineStoreIds()
This method returns the list of the online store ID that are not cached.
|
java.util.List | getUncachedPhysicalStoreIds()
This method returns the list of the physical store ID that are not cached.
|
protected boolean | isCheckMemoryCacheExpiryEnabled()
Read whether to check memory expiry from configuration file.
|
protected boolean | isDatabaseCacheExpired(InventoryAvailabilityType aInventoryAvailability, Invcnf aInventoryConfiguration)
This method checks if an InventoryAvailability record in database cache has expired.
|
protected boolean | isMemoryCacheExpired(InventoryAvailabilityType aInventoryAvailability, Invcnf aInventoryConfiguration)
This method checks if an InventoryAvailability record in memory cache has expired.
|
boolean | isReadyToCallExecute() |
protected boolean | isValidStopCheckingDOMThreshold(java.lang.Double stopCheckingDOMThreshold, Invcnf configuration)
Check the value of stop checking DOM threshold valid or not.
|
protected Invcnf | readInventoryConfigurationByCatentryIdAndOnlineStoreId(java.lang.String catentryId, java.lang.String onlineStoreId)
This method reads the inventory configuration for the give catalog entry and location combination.
|
protected Invcnf | readInventoryConfigurationByCatentryIdAndPhysicalStoreId(java.lang.String catentryId, java.lang.String physicalStoreId)
This method reads the inventory configuration for the give catalog entry and location combination.
|
protected java.util.List | refineDOMResults(java.util.List alistNouns)
The results retrieved from the DOM usually contains only external identifiers.
|
void | reset() |
protected void | updateCache(java.util.List nounList)
Updates the memory cache and/or the DB cache with the nouns specified.
|
protected void | updateMemoryCache(InventoryAvailabilityType noun, Invcnf configuration)
Update the memory cache.
|
public static final java.lang.String COPYRIGHT
protected boolean isCacheValid
protected static java.util.Hashtable lockTable
public ComposeDOMInventoryAvailabilityCmdImpl()
public java.util.List getUncachedOnlineStoreIds()
public java.util.List getUncachedPhysicalStoreIds()
protected java.util.List fetchDOMInventoryAvailabilityNouns(java.lang.String catentryId, java.lang.String onlineStoreId, java.lang.String physicalStoreId) throws AbstractApplicationException
protected java.lang.Double getStopCheckingDOMThreshold(java.lang.String onlineStoreId)
protected boolean isValidStopCheckingDOMThreshold(java.lang.Double stopCheckingDOMThreshold, Invcnf configuration)
protected void updateMemoryCache(InventoryAvailabilityType noun, Invcnf configuration)
protected java.util.List getInventoryAvailabilityFromDOM(java.lang.String catalogEntryId)
protected java.util.List callGetInventoryAvailabilityService(GetInventoryAvailabilityType getInventoryAvailability)
protected java.util.List refineDOMResults(java.util.List alistNouns)
protected int getPhysicalStoreIndex(java.lang.String astrIdentifierOrId)
protected void updateCache(java.util.List nounList) throws AbstractApplicationException
protected java.util.List composeInventoryAvailabilityWithFallbackData(java.lang.String catentryId, java.lang.String onlineStoreId, java.lang.String physicalStoreId, Invcnf inventoryConfiguration)
protected Invcnf readInventoryConfigurationByCatentryIdAndOnlineStoreId(java.lang.String catentryId, java.lang.String onlineStoreId) throws AbstractApplicationException
protected Invcnf readInventoryConfigurationByCatentryIdAndPhysicalStoreId(java.lang.String catentryId, java.lang.String physicalStoreId) throws AbstractApplicationException
protected InventoryAvailabilityIdentifierType composeInventoryAvailabilityIdentifier(java.lang.String catentryId, java.lang.String onlineStoreId, java.lang.String physicalStoreId)
protected boolean isDatabaseCacheExpired(InventoryAvailabilityType aInventoryAvailability, Invcnf aInventoryConfiguration)
public boolean isReadyToCallExecute()
public void execute() throws com.ibm.websphere.command.CommandException
For each combination of catalog entry/online store of catalog entry/physical store, the configuration of them will be first read. Based on the flags, InventoryAvailabilityType will be built from the DOM inventory memory cache or from the database cache.
If memory cache and database cache are all expired or not found, InventoryAvailabilityType will be retrieved from the DOM (Distributed Order Management) system (if the bit flags for DOM has been set).
If retrieving from DOM still failed, the InventoryAvailabilityType list will be built from the fallback data, which should be configured in the invcnf database table.
The cache items in memory or data base will be updated in below conditions: 1. InventoryAvailabilityType was built from DOM; 2. Memory cache or data base cache is expired; and 3. Bit flags of configuration for update cache have been set.
public void reset()
protected BusinessContextType getBusinessContext()
protected boolean isMemoryCacheExpired(InventoryAvailabilityType aInventoryAvailability, Invcnf aInventoryConfiguration)
protected boolean isCheckMemoryCacheExpiryEnabled()