public class AdjustInventoryReservationCmdImpl extends TaskCommandImpl implements AdjustInventoryReservationCmd
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.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INVRESERVE_ID
Constant
InvReserveId . |
defaultCommandClassName, NAME
Constructor and Description |
---|
AdjustInventoryReservationCmdImpl()
Constructor for AdjustInventoryReservationCmdImpl.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Long |
getInvRsrvId()
Gets the id of the inventory reservation being adjusted.
|
java.lang.Integer |
getQuantity()
Gets the number of inventory items to be adjusted in the reservation.
|
boolean |
isGeneric()
Checks if command can be run by a generic user.
|
boolean |
isReadyToCallExecute()
Checks if command is ready to be executed (run).
|
void |
performExecute()
Adjust the inventory reservation quantity.
|
void |
reset()
Resets the instance variables, quantity and reservation identifier.
|
void |
setInvRsrvId(java.lang.Long argInvRsrvId)
Identifies the inventory reservation to be adjusted.
|
void |
setQuantity(java.lang.Integer argQuantity)
Sets the adjustment quantity for the inventory reservation
negatively or positively.
|
void |
validateParameters()
Validates the command parameters.
|
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
public static final java.lang.String INVRESERVE_ID
InvReserveId
.public AdjustInventoryReservationCmdImpl()
super()
.public void validateParameters() throws ECException
validateParameters
in interface ECCommand
validateParameters
in class AbstractECTargetableCommand
ECException
- ECSystemException _ERR_CMD_MISSING_PARAM when one of the parameters is missing.public java.lang.Long getInvRsrvId()
setInvRsrvId(java.lang.Long)
public java.lang.Integer getQuantity()
setQuantity(java.lang.Integer)
public boolean isGeneric()
public boolean isReadyToCallExecute()
isReadyToCallExecute
in interface com.ibm.websphere.command.Command
isReadyToCallExecute
in class AbstractECTargetableCommand
public void performExecute() throws ECException
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECExecption
- If there is not enough reserved to satisfy
the release amount throw ECApplicationException specifying
_ERR_RELEASE_QUANTITY_MORE_THAN_INVENTORY.
ECException
public void reset()
reset
in interface com.ibm.websphere.command.Command
reset
in class AbstractECTargetableCommand
public void setInvRsrvId(java.lang.Long argInvRsrvId)
AdjustInventoryReservationCmd
setInvRsrvId
in interface AdjustInventoryReservationCmd
argInvRsrvId
- inventory reservation idAdjustInventoryReservationCmd.setInvRsrvId(java.lang.Long)
public void setQuantity(java.lang.Integer argQuantity)
AdjustInventoryReservationCmd
setQuantity
in interface AdjustInventoryReservationCmd
argQuantity
- quantity to adjustAdjustInventoryReservationCmd.setQuantity(java.lang.Integer)