com.ibm.commerce.inventory.commands
Class MakeReceiptAvailableCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.inventory.commands.MakeReceiptAvailableCmdImpl
All Implemented Interfaces:
ECCommand, ECTargetableCommand, MakeReceiptAvailableCmd, TaskCommand

public class MakeReceiptAvailableCmdImpl
extends TaskCommandImpl
implements MakeReceiptAvailableCmd

Default implementation of the MakeReceiptAvailableCmd interface. Makes a receipt available to the distribution arrangement.

Uses the following access beans:

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          The internal copyright field.
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.inventory.commands. MakeReceiptAvailableCmd
defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
MakeReceiptAvailableCmdImpl()
           
 
Method Summary
 java.lang.Long getDistArrangId()
          Returns distribution arrangement identifier.
 java.lang.Long getItemspcId()
          Return item identifier.
 java.lang.Long getRcptAvailId()
          Return available receipt identifier.
 java.lang.Long getReceiptId()
          Return the receipt identifier.
 boolean isReadyToCallExecute()
          Identifies whether this command is ready to be executed.
 void performExecute()
          Makes a receipt available to the distribution arrangement.
 void reset()
          Resets the command local variable.
 void setDistArrangId(java.lang.Long newDistArrangId)
          Set distribution arrangement identifier.
 void setItemspcId(java.lang.Long newItemspcId)
          Set item identifier.
 void setRcptAvailId(java.lang.Long newRcptAvailId)
          Set available receipt identifier.
 void setReceiptId(java.lang.Long newReceiptId)
          Set the receipt identifier.
 void setRequestProperties( TypedProperty newRequestProperties)
          Set request properties.
 void validateParameters()
          Checks the information needed for making a receipt available.
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
The internal copyright field.
See Also:
Constant Field Values
Constructor Detail

MakeReceiptAvailableCmdImpl

public MakeReceiptAvailableCmdImpl()
Method Detail

getDistArrangId

public java.lang.Long getDistArrangId()
Description copied from interface: MakeReceiptAvailableCmd
Returns distribution arrangement identifier.
Specified by:
getDistArrangId in interface MakeReceiptAvailableCmd
Returns:
Distribution arrangement identifire.
See Also:
MakeReceiptAvailableCmd.getDistArrangId(), setDistArrangId(java.lang.Long)

getItemspcId

public java.lang.Long getItemspcId()
Description copied from interface: MakeReceiptAvailableCmd
Return item identifier.
Specified by:
getItemspcId in interface MakeReceiptAvailableCmd
Returns:
Item specified identifier.
See Also:
MakeReceiptAvailableCmd.getItemspcId(), setItemspcId(java.lang.Long)

getRcptAvailId

public java.lang.Long getRcptAvailId()
Description copied from interface: MakeReceiptAvailableCmd
Return available receipt identifier.
Specified by:
getRcptAvailId in interface MakeReceiptAvailableCmd
Returns:
Available receipt identifier.
See Also:
MakeReceiptAvailableCmd.getRcptAvailId(), setRcptAvailId(java.lang.Long)

getReceiptId

public java.lang.Long getReceiptId()
Description copied from interface: MakeReceiptAvailableCmd
Return the receipt identifier.
Specified by:
getReceiptId in interface MakeReceiptAvailableCmd
Returns:
Receipt identifier.
See Also:
MakeReceiptAvailableCmd.getReceiptId(), setReceiptId(java.lang.Long)

setDistArrangId

public void setDistArrangId(java.lang.Long newDistArrangId)
Description copied from interface: MakeReceiptAvailableCmd
Set distribution arrangement identifier.
Specified by:
setDistArrangId in interface MakeReceiptAvailableCmd
Parameters:
newDistArrangId - distribution arrangement identifier
See Also:
MakeReceiptAvailableCmd.setDistArrangId(java.lang.Long), getDistArrangId()

setItemspcId

public void setItemspcId(java.lang.Long newItemspcId)
Description copied from interface: MakeReceiptAvailableCmd
Set item identifier.
Specified by:
setItemspcId in interface MakeReceiptAvailableCmd
Parameters:
newItemspcId - item identifier
See Also:
MakeReceiptAvailableCmd.setItemspcId(java.lang.Long), getItemspcId()

setRcptAvailId

public void setRcptAvailId(java.lang.Long newRcptAvailId)
Description copied from interface: MakeReceiptAvailableCmd
Set available receipt identifier.
Specified by:
setRcptAvailId in interface MakeReceiptAvailableCmd
Parameters:
newRcptAvailId - available receipt identifier
See Also:
MakeReceiptAvailableCmd.setRcptAvailId(java.lang.Long), getRcptAvailId()

setReceiptId

public void setReceiptId(java.lang.Long newReceiptId)
Description copied from interface: MakeReceiptAvailableCmd
Set the receipt identifier.
Specified by:
setReceiptId in interface MakeReceiptAvailableCmd
Parameters:
newReceiptId - receipt identifier
See Also:
MakeReceiptAvailableCmd.setReceiptId(java.lang.Long), getReceiptId()

setRequestProperties

public void setRequestProperties(TypedProperty newRequestProperties)
                          throws ECApplicationException
Set request properties.
Specified by:
setRequestProperties in interface MakeReceiptAvailableCmd
Parameters:
newRequestProperties - request properties
ECApplicationException

isReadyToCallExecute

public boolean isReadyToCallExecute()
Identifies whether this command is ready to be executed.
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Returns:
Always true.

validateParameters

public void validateParameters()
                        throws ECException
Checks the information needed for making a receipt available.

Parameters:

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECApplicationException - If mandatory parameters are not passed in, specify _ERR_BAD_MISSING_CMD_PARAMETER
ECException

performExecute

public void performExecute()
                    throws ECException
Makes a receipt available to the distribution arrangement.

This is done by inserting a row into RCPTAVAIL table associating the receipt with the distribution arrangement.

The distribution arrangement will have a picking method of either LIFO or FIFO. If the picking method of the distribution arrangment is FIFO, the precedence of the rcptavail row will be MAX(precedence)+1. If the picking method of the distribution arrangment is LIFO, the precedence of the rcptavail row will be MIN(precedence)-1. If there are no rows in the rcptavail table, the precedence of the rcptavail row will be 1.

If distribution arrangement parameter is null, uses ItemSpecificationAccessBean and DistributionArrangementAccessBean to retrieve the base item id from the item specified id. Or if there is still no distribution arrangement, create one. This behavior allows a store to always allocate from inventory that it owns.

Uses InventoryJDBCHelperAccessBean().findAvailableReceiptMaxAndMinPrecedence to get the next precedence to use for new RCPTAVAIL row. Uses AvailableReceiptAccessBean to create and populate the row.

Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException -
  • ECSystemException Naming error, _ERR_CREATE_EXCEPTION
  • ECSystemException Finder error, _ERR_FINDER_EXCEPTION
  • ECSystemException Naming error, _ERR_NAMING_EXCEPTION
  • ECSystemException Remote error, _ERR_REMOTE_EXCEPTION

reset

public void reset()
Resets the command local variable.
Overrides:
reset in class AbstractECTargetableCommand