com.ibm.commerce.inventory.commands

Class ReserveInventoryCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, ReserveInventoryCmd, 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 ReserveInventoryCmdImpl
    extends TaskCommandImpl
    implements ReserveInventoryCmd
    Default implementation of the ReserveInventoryCmd interface. This task command creates a reservation of a requested quantity of inventory of a given item from a given fulfillment center for a given store. Following a successful reservation, the reservation number may be obtained by calling the getReserveId() method.

    Required parameters are:

    • requested quantity
    • itemspec id
    • fulfillment center id
    • store id
    • reservation type
    • description (reservation instance)

    Behavior

    • Get the quantity available for the requested item, store, and fulfillment center.
    • Check to make sure that the quantity available is greater or equal to the quantity requested.
    • If the above edit is successful,
      • obtain the ITEMFFMCTR row and increment the itemffmctr.qtyreserved by the requested quantity,
      • then insert a new row into the INVRESERVE table.
    Utilizes these access beans:
    See Also:
    Serialized Form
    • Field Detail

      • FFC_ID

        public static final java.lang.String FFC_ID
        Fulfillment center identifier field for this command is FFCId.
        See Also:
        Constant Field Values
      • ITEMSPC_ID

        public static final java.lang.String ITEMSPC_ID
        Item specified identifier field for this command is ItemSpcId.
        See Also:
        Constant Field Values
      • RESERVATION_INSTANCE

        public static final java.lang.String RESERVATION_INSTANCE
        Reservation instance description field for this command is ReservationInstance.
        See Also:
        Constant Field Values
      • RESERVATION_TYPE

        public static final java.lang.String RESERVATION_TYPE
        Reservation type field for this command is ReservationId.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ReserveInventoryCmdImpl

        public ReserveInventoryCmdImpl()
        Constructor. Calls super.
    • Method Detail

      • getFFCId

        public java.lang.Integer getFFCId()
        Gets the fulfillment center identifier set local for this command.
        Returns:
        Fulfillment center id.
      • getItemSpcId

        public java.lang.Long getItemSpcId()
        Gets the item specified id set local for this command.
        Returns:
        Item specified id.
      • getQuantity

        public java.lang.Integer getQuantity()
        Gets the reserve quantity set local for this command.
        Returns:
        Quantity specified for reserve.
      • getReservationInstance

        public java.lang.String getReservationInstance()
        Gets the reservation instance description set local for this command.
        Returns:
        Reservation Description.
      • getReservationType

        public java.lang.Long getReservationType()
        Gets the reservation type set local for this command.
        Returns:
        Reservation type.
      • getReserveId

        public java.lang.Long getReserveId()
        Gets the reserve identifier created from this command.
        Specified by:
        getReserveId in interface ReserveInventoryCmd
        Returns:
        Reserve identifier.
      • isGeneric

        public boolean isGeneric()
        Tells whether this command can be run by a generic user.
        Returns:
        Always false.
      • isReadyToCallExecute

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

        public void performExecute()
                            throws ECException
        If quantity available is greater than or equal to quantity requested. Then increment itemffmctr.qtyreserved by the requested quantity amount and insert a row into the INVRESERVE table for the requested amount.

        Utilizes these access beans:

        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException -
        • ECSystemException Create error, _ERR_CREATE_EXCEPTION
        • ECSystemException Finder error, _ERR_FINDER_EXCEPTION
        • ECSystemException Naming error, _ERR_GENERIC
        • ECSystemException Remote error, _ERR_REMOTE_EXCEPTION
        • ECSystemException Sql error, _ERR_SQL_EXCEPTION
        • ECApplicationException, _ERR_RESERVE_QUANTITY_MORE_THAN_INVENTORY
      • performSecurityCheck

        public boolean performSecurityCheck()
        Performs security check. Not enabled.
        Returns:
        Always true.
      • reset

        public void reset()
        Resets instance variables.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • setFFCId

        public void setFFCId(java.lang.Integer argFFCId)
        Description copied from interface: ReserveInventoryCmd
        Sets the fulfillment center identifier.
        Specified by:
        setFFCId in interface ReserveInventoryCmd
        Parameters:
        argFFCId - fulfillment center id
      • setItemSpcId

        public void setItemSpcId(java.lang.Long argItemSpcId)
        Description copied from interface: ReserveInventoryCmd
        Sets the item specified for reservation.
        Specified by:
        setItemSpcId in interface ReserveInventoryCmd
        Parameters:
        argItemSpcId - item id
      • setQuantity

        public void setQuantity(java.lang.Integer argQuantity)
        Description copied from interface: ReserveInventoryCmd
        Sets the quantity of the reservation.
        Specified by:
        setQuantity in interface ReserveInventoryCmd
        Parameters:
        argQuantity - reservation quantity
      • setReservationInstance

        public void setReservationInstance(java.lang.String argReservationInstance)
        Description copied from interface: ReserveInventoryCmd
        Sets the reservation description identifying the instance.
        Specified by:
        setReservationInstance in interface ReserveInventoryCmd
        Parameters:
        argReservationInstance - reservation description
      • setReservationType

        public void setReservationType(java.lang.Long argReservationType)
        Description copied from interface: ReserveInventoryCmd
        Sets the reservation type. The type or purpose of the reservation, such as an auction. The types are user defined and are in the INVRSRVTYP table.
        Specified by:
        setReservationType in interface ReserveInventoryCmd
        Parameters:
        argReservationType - reservation type