com.ibm.commerce.fulfillment.commands
Class InventoryBaseCmdImpl

java.lang.Object
  CacheableCommandImpl
      com.ibm.commerce.command.AbstractECTargetableCommand
          com.ibm.commerce.command.TaskCommandImpl
              com.ibm.commerce.fulfillment.commands.InventoryBaseCmdImpl
All Implemented Interfaces:
CheckInventoryCmd, ECCommand, ECTargetableCommand, ReverseUpdateInventoryCmd, TaskCommand, UpdateInventoryCmd
Direct Known Subclasses:
CheckInventoryCmdImpl, ResolveFulfillmentCenterCmdImpl, ReverseUpdateInventoryCmdImpl, UpdateInventoryCmdImpl, UpdateInventoryForOrderItemsCmdImpl

public class InventoryBaseCmdImpl
extends TaskCommandImpl
implements CheckInventoryCmd, UpdateInventoryCmd, ReverseUpdateInventoryCmd

This is the base class for the CheckInventory, UpdateInventory and ReverseUpdateInventory.

See Also:
Serialized Form

Field Summary
static java.lang.String CHECK_INVENTORY
static java.lang.String COPYRIGHT
static java.lang.String ERR_CHECK_INV
protected java.lang.String iAction
protected java.lang.Long iCatEntryId
protected java.lang.Integer iFulfillmentCenterId
protected OrderItemAccessBean[] iOrderItems
protected java.lang.Double iQuantity
protected java.lang.String iQuantityMeasure
protected java.lang.Integer iShipModeId
protected java.lang.Integer iStoreId
static int NO_CHECK
static int NO_RECOMMENDATION
static int NO_UPDATE
static java.lang.String REVERSE_UPDATE_INVENTORY
static java.lang.String UPDATE_INVENTORY
Fields inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
commandContext
Fields inherited from interface com.ibm.commerce.fulfillment.commands.CheckInventoryCmd
defaultCommandClassName, ERRTASK_NAME, NAME
Fields inherited from interface com.ibm.commerce.fulfillment.commands.UpdateInventoryCmd
defaultCommandClassName, ERRTASK_NAME, NAME
Fields inherited from interface com.ibm.commerce.fulfillment.commands.ReverseUpdateInventoryCmd
defaultCommandClassName, ERRTASK_NAME, NAME
Fields inherited from interface com.ibm.commerce.command.ECCommand
defaultCommandClassName
Constructor Summary
InventoryBaseCmdImpl()
Method Summary
protected boolean checkUpdateInventory(InventoryAccessBean inventoryAB, java.lang.Double askQuantity)
protected java.lang.Double convertQuantity(java.lang.Double quantity, java.lang.String quantityUnit, java.lang.String newQuantityUnit)
protected java.lang.Double convertQuantity(java.lang.Long catEntryId, java.lang.Double quantity, java.lang.String newQuantityUnit)
protected java.lang.Double convertQuantity(OrderItemAccessBean orderItemAB, java.lang.String newQuantityUnit)
protected InventoryAccessBean findByCatalogEntryAndFulfillmentCenterAndStore(java.lang.Long catalogEntryId, java.lang.Integer fulfillmentCenterId, java.lang.Integer storeId)
protected boolean flagIsSet(int flag)
protected java.lang.Long getCatEntryId()
protected java.lang.Integer getFulfillmentCenterId()
protected OrderItemAccessBean[] getOrderItem()
protected java.lang.Double getQuantity()
protected java.lang.String getQuantityMeasure()
boolean isReadyToCallExecute()
This method is called by the Targettable Command frame work before the execution of the command.
void performExecute()
The business logic for this command.
void reset()
This method should be called after a command has been executed to reset its states variables.
void setCatEntryId(java.lang.Long aCatEntryId)
Set a Catalog Entry Id.
void setFulfillmentCenterId(java.lang.Integer aFulfillmentCenterId)
Set a fulfillment center Id.
void setOrderItem(OrderItemAccessBean anOrderItem)
Set an OrderItem.
void setOrderItem(OrderItemAccessBean[] orderItems)
Set a list of OrderItems.
void setOrderItem(java.util.Vector anOrderItemList)
Set a list of OrderItems.
void setQuantity(java.lang.Double aQuantity)
Set a quantity.
void setQuantityMeasure(java.lang.String quantityMeasure)
Set a quantity measure.
void setStoreId(java.lang.Integer aStoreId)
Set a store id.
void validateParameters()
Performs parameter checking.
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

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

ERR_CHECK_INV

public static final java.lang.String ERR_CHECK_INV
See Also:
Constant Field Values

iOrderItems

protected OrderItemAccessBean[] iOrderItems

iShipModeId

protected java.lang.Integer iShipModeId

iCatEntryId

protected java.lang.Long iCatEntryId

iQuantity

protected java.lang.Double iQuantity

iQuantityMeasure

protected java.lang.String iQuantityMeasure

iFulfillmentCenterId

protected java.lang.Integer iFulfillmentCenterId

iStoreId

protected java.lang.Integer iStoreId

iAction

protected java.lang.String iAction

CHECK_INVENTORY

public static final java.lang.String CHECK_INVENTORY
See Also:
Constant Field Values

UPDATE_INVENTORY

public static final java.lang.String UPDATE_INVENTORY
See Also:
Constant Field Values

REVERSE_UPDATE_INVENTORY

public static final java.lang.String REVERSE_UPDATE_INVENTORY
See Also:
Constant Field Values

NO_UPDATE

public static final int NO_UPDATE
See Also:
Constant Field Values

NO_CHECK

public static final int NO_CHECK
See Also:
Constant Field Values

NO_RECOMMENDATION

public static final int NO_RECOMMENDATION
See Also:
Constant Field Values
Constructor Detail

InventoryBaseCmdImpl

public InventoryBaseCmdImpl()
Method Detail

checkUpdateInventory

protected boolean checkUpdateInventory(InventoryAccessBean inventoryAB,
                                       java.lang.Double askQuantity)
                                throws ECException
Throws:
ECException

convertQuantity

protected java.lang.Double convertQuantity(OrderItemAccessBean orderItemAB,
                                           java.lang.String newQuantityUnit)
                                    throws java.rmi.RemoteException,
                                           CreateException,
                                           javax.naming.NamingException,
                                           FinderException,
                                           ECException
Throws:
java.rmi.RemoteException
CreateException
javax.naming.NamingException
FinderException
ECException

convertQuantity

protected java.lang.Double convertQuantity(java.lang.Double quantity,
                                           java.lang.String quantityUnit,
                                           java.lang.String newQuantityUnit)
                                    throws ECException
Throws:
ECException

findByCatalogEntryAndFulfillmentCenterAndStore

protected InventoryAccessBean findByCatalogEntryAndFulfillmentCenterAndStore(java.lang.Long catalogEntryId,
                                                                             java.lang.Integer fulfillmentCenterId,
                                                                             java.lang.Integer storeId)
                                                                      throws java.rmi.RemoteException,
                                                                             CreateException,
                                                                             javax.naming.NamingException,
                                                                             FinderException,
                                                                             ECException
Throws:
java.rmi.RemoteException
CreateException
javax.naming.NamingException
FinderException
ECException

flagIsSet

protected boolean flagIsSet(int flag)

getCatEntryId

protected java.lang.Long getCatEntryId()

getFulfillmentCenterId

protected java.lang.Integer getFulfillmentCenterId()

getOrderItem

protected OrderItemAccessBean[] getOrderItem()

getQuantity

protected java.lang.Double getQuantity()

getQuantityMeasure

protected java.lang.String getQuantityMeasure()

isReadyToCallExecute

public boolean isReadyToCallExecute()
Description copied from class: AbstractECTargetableCommand
This method is called by the Targettable Command frame work before the execution of the command. The default implementation is to return true.
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Returns:
true if we can execute the command false if we canot execute the command

performExecute

public void performExecute()
                    throws ECException
Description copied from class: AbstractECTargetableCommand
The business logic for this command. This method should be overwritten by all command writers. Command writers should call super.performExecute() as the first line in their method.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException

reset

public void reset()
Description copied from class: AbstractECTargetableCommand
This method should be called after a command has been executed to reset its states variables. After the call to reset, we should be able to execute the command again.
Overrides:
reset in class AbstractECTargetableCommand

setCatEntryId

public void setCatEntryId(java.lang.Long aCatEntryId)
Set a Catalog Entry Id.
Specified by:
setCatEntryId in interface CheckInventoryCmd

setFulfillmentCenterId

public void setFulfillmentCenterId(java.lang.Integer aFulfillmentCenterId)
Set a fulfillment center Id.
Specified by:
setFulfillmentCenterId in interface CheckInventoryCmd

setOrderItem

public void setOrderItem(OrderItemAccessBean[] orderItems)
Set a list of OrderItems.
Specified by:
setOrderItem in interface CheckInventoryCmd

setOrderItem

public void setOrderItem(OrderItemAccessBean anOrderItem)
Set an OrderItem.
Specified by:
setOrderItem in interface CheckInventoryCmd

setOrderItem

public void setOrderItem(java.util.Vector anOrderItemList)
Set a list of OrderItems.
Specified by:
setOrderItem in interface CheckInventoryCmd

setQuantity

public void setQuantity(java.lang.Double aQuantity)
Set a quantity.
Specified by:
setQuantity in interface CheckInventoryCmd

setQuantityMeasure

public void setQuantityMeasure(java.lang.String quantityMeasure)
Set a quantity measure.
Specified by:
setQuantityMeasure in interface CheckInventoryCmd

setStoreId

public void setStoreId(java.lang.Integer aStoreId)
Set a store id.
Specified by:
setStoreId in interface CheckInventoryCmd

validateParameters

public void validateParameters()
                        throws ECException
Description copied from class: AbstractECTargetableCommand
Performs parameter checking. This method replaces checkParameters() in 5.1. The default implementation of validateParameters() is a no op. It is the responsibility of the command writers to implements this method if they want to perform server side parameter checking.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException

convertQuantity

protected java.lang.Double convertQuantity(java.lang.Long catEntryId,
                                           java.lang.Double quantity,
                                           java.lang.String newQuantityUnit)
                                    throws java.rmi.RemoteException,
                                           CreateException,
                                           javax.naming.NamingException,
                                           FinderException,
                                           ECException
Throws:
java.rmi.RemoteException
CreateException
javax.naming.NamingException
FinderException
ECException

Feedback