com.ibm.commerce.inventory.commands

Class AdjustInventoryReservationCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, AdjustInventoryReservationCmd, 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 AdjustInventoryReservationCmdImpl
    extends TaskCommandImpl
    implements AdjustInventoryReservationCmd
    Default implementation of the AdjustInventoryReservationCmd interface.

    Adjusts the inventory for a given inventory reservation by the amount of the given quantity. Required arguments are inventory reservation number and adjustment quantity (which may be negative).

    Behavior:

    If quantity argument is negative it means we are releasing inventory. If this is the case, see if we have enough inventory reserved to satisfy the release amount.

    If quantity argument is positive it means we are adding inventory to the reservation. If this is the case, see if we have enough inventory to satisfy the additional reservation amount.

    Assuming the above edit checks are successful, adjust the quantity reserved by the amount of the quantity argument.

    See Also:
    Serialized Form
    • Field Detail

      • INVRESERVE_ID

        public static final java.lang.String INVRESERVE_ID
        Constant InvReserveId.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AdjustInventoryReservationCmdImpl

        public AdjustInventoryReservationCmdImpl()
        Constructor for AdjustInventoryReservationCmdImpl. Calls super().
    • Method Detail

      • getInvRsrvId

        public java.lang.Long getInvRsrvId()
        Gets the id of the inventory reservation being adjusted.
        Returns:
        Reservation identifier.
        See Also:
        setInvRsrvId(java.lang.Long)
      • getQuantity

        public java.lang.Integer getQuantity()
        Gets the number of inventory items to be adjusted in the reservation.
        Returns:
        Inventory adjustment quantity.
        See Also:
        setQuantity(java.lang.Integer)
      • isGeneric

        public boolean isGeneric()
        Checks if command can be run by a generic user.
        Returns:
        Always false. Cannot be run by a generic user.
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        Checks if command is ready to be executed (run).
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        Always true.
      • performExecute

        public void performExecute()
                            throws ECException
        Adjust the inventory reservation quantity. If itemffmctr.qtyreserved is greater than or equal to quantity and invreserve.quantity is greater than or equal to quantity then subtract the quantity from both itemffmctr.qtyreserved and invreserve.quantity.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECExecption - If there is not enough reserved to satisfy the release amount throw ECApplicationException specifying _ERR_RELEASE_QUANTITY_MORE_THAN_INVENTORY.
        • ECSystemException Naming error, _ERR_CREATE_EXCEPTION
        • ECSystemException Finder error, _ERR_FINDER_EXCEPTION
        • ECSystemException Naming error, _ERR_NAMING_EXCEPTION
        ECException
      • reset

        public void reset()
        Resets the instance variables, quantity and reservation identifier.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand