com.ibm.commerce.inventory.commands
Class AdjustInventoryReservationCmdImpl
java.lang.Object
|
+--com.ibm.commerce.command.AbstractECCommand
|
+--com.ibm.commerce.command.TaskCommandImpl
|
+--com.ibm.commerce.inventory.commands.AdjustInventoryReservationCmdImpl
- All Implemented Interfaces:
- AdjustInventoryReservationCmd, ECCommand, TaskCommand
- public class AdjustInventoryReservationCmdImpl
- extends TaskCommandImpl
- implements AdjustInventoryReservationCmd
This task command 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.
Method Summary |
java.lang.Long |
getInvRsrvId()
method description: return the reserve_id. |
java.lang.Integer |
getQuantity()
method description: return the quantity. |
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 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. |
void |
reset()
method description: reset instance variables. |
void |
setInvRsrvId(java.lang.Long argInvRsrvId)
method description: set the reserve_id. |
void |
setQuantity(java.lang.Integer argQuantity)
method description: set the quantity. |
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 |
INVRESERVE_ID
public static final java.lang.String INVRESERVE_ID
AdjustInventoryReservationCmdImpl
public AdjustInventoryReservationCmdImpl()
- method description: this is the class constructor.
getInvRsrvId
public java.lang.Long getInvRsrvId()
- method description: return the reserve_id.
getQuantity
public java.lang.Integer getQuantity()
- method description: return the quantity.
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 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
- 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.
reset
public void reset()
- method description: reset instance variables.
- Overrides:
reset
in class AbstractECCommand
setInvRsrvId
public void setInvRsrvId(java.lang.Long argInvRsrvId)
- method description: set the reserve_id.
- Specified by:
setInvRsrvId
in interface AdjustInventoryReservationCmd
setQuantity
public void setQuantity(java.lang.Integer argQuantity)
- method description: set the quantity.
- Specified by:
setQuantity
in interface AdjustInventoryReservationCmd
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.
-