com.ibm.commerce.inventory.facade.server.commands

Class ProcessInventoryRequirementDecrementCacheActionCmdImpl

  • All Implemented Interfaces:
    AbstractProcessNounActionCmd, ProcessInventoryRequirementActionCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class ProcessInventoryRequirementDecrementCacheActionCmdImpl
    extends AbstractProcessInventoryRequirementActionCmdImpl
    The process command is the task command for process InvnetoryRequirement service with action code DecrementCache to decrement the inventory cache. When using the DOM invnetory systems, the inventory data from out DOM inventory system can be cached in commerce local memory or DB. This cache can help to improve the performance if the out DOM inventory system performs poor. After the inventory has been reserved by out DOM inventory system, process InvnetoryRequirement service with action code DecrementCache should be invoked to decrement the inventory of the local memory or DB cache in order to keep sync with out DOM inventory system.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProcessInventoryRequirementDecrementCacheActionCmdImpl

        public ProcessInventoryRequirementDecrementCacheActionCmdImpl()
    • Method Detail

      • setInventoryStatusToDecrementCache

        public void setInventoryStatusToDecrementCache(java.lang.String inventoryStatusToDecrementCache)
        Sets the inventory status(es) to decrement cache.
        Parameters:
        inventoryStatusToDecrementCache - A comma-separated list of inventory statuses.
      • performExecute

        public void performExecute()
                            throws java.lang.Exception
        This method performs the main business flow to decrement the inventory cache.

        When an order item in InventoryRequirementType contans catalog entry in an online store or catalog entry in a physical store, and if the order item's inventory status is Allocated. The memory or DB inventory cache of them will be decremented by the quantity ordered.

        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractProcessInventoryRequirementActionCmdImpl
        Throws:
        java.lang.Exception
        See Also:
        decrementCache(String, String, String, OrderItemType)
      • decrementCache

        public void decrementCache(java.lang.String catEntryId,
                                   java.lang.String onlineStoreId,
                                   java.lang.String physicalStoreId,
                                   OrderItemType orderItem)
                            throws AbstractApplicationException
        This method performs the operatins to decrement cache.

        First, for the combination of catalog entry/online store or catalog entry/physical store, the configuration for them will be first read. If the inventory cache is in the memory, memory cache will be decremented; if the inventory cache is in the DB, DB cahce will be decremented.

        Parameters:
        catEntryId - The catalog entry ID of the product in the order item.
        onlineStoreId - The online store ID where the product purchased. When this parameter is set, physicalStoreId should be null.
        physicalStoreId - The physical store ID where the product purchased. When this parameter is set, onlineStoreId should be null.
        orderItem - The order item which contains the catalog entry id.
        Throws:
        AbstractApplicationException