com.ibm.commerce.inventory.commands
Class ReserveInventoryCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.inventory.commands.ReserveInventoryCmdImpl
All Implemented Interfaces:
ECCommand, ReserveInventoryCmd, TaskCommand

public class ReserveInventoryCmdImpl
extends TaskCommandImpl
implements ReserveInventoryCmd

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 arguments are: requested quantity itemspec id fulfillment center id store id reservation type description (reservation instance)

Behavior


Field Summary
static java.lang.String FFC_ID
           
static java.lang.String ITEMSPC_ID
           
static java.lang.String RESERVATION_INSTANCE
           
static java.lang.String RESERVATION_TYPE
           
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.inventory.commands.ReserveInventoryCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Constructor Summary
ReserveInventoryCmdImpl()
          method description: this is the class constructor method.
 
Method Summary
 java.lang.Integer getFFCId()
          method description: return the fulfillment center id.
 java.lang.Long getItemSpcId()
          method description: return the itemspec_id.
 java.lang.Integer getQuantity()
          method description: return the quantity.
 java.lang.String getReservationInstance()
          method description: return the reservation description.
 java.lang.Long getReservationType()
          method description: return the reservation type.
 java.lang.Long getReserveId()
          method description: return the reserve_id.
 boolean isGeneric()
          method description: return false to indicate that this command can't be run by a generic user.
 boolean isReadyToCallExecute()
          method description: return true to indicate that this command is ready to be executed.
 void performExecute()
          method description: 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.
 boolean performSecurityCheck()
          method description: return true.
 void reset()
          method description: reset instance variables.
 void setFFCId(java.lang.Integer argFFCId)
          method description: set the fulfillment center id.
 void setItemSpcId(java.lang.Long argItemSpcId)
          method description: set the itemspec_id.
 void setQuantity(java.lang.Integer argQuantity)
          method description: set the quantity.
 void setReservationInstance(java.lang.String argReservationInstance)
          method description: set the reservation description.
 void setReservationType(java.lang.Long argReservationType)
          method description: set the reservation type.
 void validateParameters()
          method description: validate the command parameters.
 
Methods inherited from class com.ibm.commerce.command.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 

Field Detail

FFC_ID

public static final java.lang.String FFC_ID

ITEMSPC_ID

public static final java.lang.String ITEMSPC_ID

RESERVATION_INSTANCE

public static final java.lang.String RESERVATION_INSTANCE

RESERVATION_TYPE

public static final java.lang.String RESERVATION_TYPE
Constructor Detail

ReserveInventoryCmdImpl

public ReserveInventoryCmdImpl()
method description: this is the class constructor method.
Method Detail

getFFCId

public java.lang.Integer getFFCId()
method description: return the fulfillment center id.

getItemSpcId

public java.lang.Long getItemSpcId()
method description: return the itemspec_id.

getQuantity

public java.lang.Integer getQuantity()
method description: return the quantity.

getReservationInstance

public java.lang.String getReservationInstance()
method description: return the reservation description.

getReservationType

public java.lang.Long getReservationType()
method description: return the reservation type.

getReserveId

public java.lang.Long getReserveId()
method description: return the reserve_id.
Specified by:
getReserveId in interface ReserveInventoryCmd

isGeneric

public boolean isGeneric()
method description: return false to indicate that this command can't be run by a generic user.

isReadyToCallExecute

public boolean isReadyToCallExecute()
method description: return true to indicate that this command is ready to be executed.
Overrides:
isReadyToCallExecute in class AbstractECCommand
Following copied from class: com.ibm.commerce.command.AbstractECCommand
Returns:
boolean - true if we can execute the command false if we canot execute the command

performExecute

public void performExecute()
                    throws ECException
method description: 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.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

performSecurityCheck

public boolean performSecurityCheck()
method description: return true.

reset

public void reset()
method description: reset instance variables.
Overrides:
reset in class AbstractECCommand

setFFCId

public void setFFCId(java.lang.Integer argFFCId)
method description: set the fulfillment center id.
Specified by:
setFFCId in interface ReserveInventoryCmd

setItemSpcId

public void setItemSpcId(java.lang.Long argItemSpcId)
method description: set the itemspec_id.
Specified by:
setItemSpcId in interface ReserveInventoryCmd

setQuantity

public void setQuantity(java.lang.Integer argQuantity)
method description: set the quantity.
Specified by:
setQuantity in interface ReserveInventoryCmd

setReservationInstance

public void setReservationInstance(java.lang.String argReservationInstance)
method description: set the reservation description.
Specified by:
setReservationInstance in interface ReserveInventoryCmd

setReservationType

public void setReservationType(java.lang.Long argReservationType)
method description: set the reservation type.
Specified by:
setReservationType in interface ReserveInventoryCmd

validateParameters

public void validateParameters()
                        throws ECException
method description: validate the command parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -