com.ibm.commerce.fulfillment.commands
Class InventoryBaseCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.fulfillment.commands.InventoryBaseCmdImpl
All Implemented Interfaces:
CheckInventoryCmd, ECCommand, 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.


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.AbstractECCommand
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
 
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(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()
          isReadyToCallExecute method is called by the Targetable Command frame work This is where client side parameter checking is performed before the execution of the command.
 void performExecute()
          Contains the actual business logic of the command It should be implemented by all the command writer.
 void reset()
          This method is 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 server side parameter checking.
 
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

CHECK_INVENTORY

public static final java.lang.String CHECK_INVENTORY

COPYRIGHT

public static final java.lang.String COPYRIGHT

ERR_CHECK_INV

public static final java.lang.String ERR_CHECK_INV

iAction

protected java.lang.String iAction

iCatEntryId

protected java.lang.Long iCatEntryId

iFulfillmentCenterId

protected java.lang.Integer iFulfillmentCenterId

iOrderItems

protected OrderItemAccessBean[] iOrderItems

iQuantity

protected java.lang.Double iQuantity

iQuantityMeasure

protected java.lang.String iQuantityMeasure

iShipModeId

protected java.lang.Integer iShipModeId

iStoreId

protected java.lang.Integer iStoreId

NO_CHECK

public static final int NO_CHECK

NO_RECOMMENDATION

public static final int NO_RECOMMENDATION

NO_UPDATE

public static final int NO_UPDATE

REVERSE_UPDATE_INVENTORY

public static final java.lang.String REVERSE_UPDATE_INVENTORY

UPDATE_INVENTORY

public static final java.lang.String UPDATE_INVENTORY
Constructor Detail

InventoryBaseCmdImpl

public InventoryBaseCmdImpl()
Method Detail

checkUpdateInventory

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

convertQuantity

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

convertQuantity

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

findByCatalogEntryAndFulfillmentCenterAndStore

protected InventoryAccessBean findByCatalogEntryAndFulfillmentCenterAndStore(java.lang.Long catalogEntryId,
                                                                             java.lang.Integer fulfillmentCenterId,
                                                                             java.lang.Integer storeId)
                                                                      throws java.rmi.RemoteException,
                                                                             javax.ejb.CreateException,
                                                                             javax.naming.NamingException,
                                                                             javax.ejb.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: AbstractECCommand
isReadyToCallExecute method is called by the Targetable Command frame work This is where client side parameter checking is performed before the execution of the command. The default implementation is to return true.

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
Description copied from interface: ECCommand
Contains the actual business logic of the command It should be implemented by all the command writer.
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()
Description copied from class: AbstractECCommand
This method is 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 AbstractECCommand

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 anOrderItem)
Set an OrderItem.
Specified by:
setOrderItem in interface CheckInventoryCmd

setOrderItem

public void setOrderItem(OrderItemAccessBean[] orderItems)
Set a list of OrderItems.
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 interface: ECCommand
Performs server side parameter checking. This method replaces the checkParameters() method in a previous version of the code.

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -