com.ibm.commerce.fulfillment.commands
Class CheckInventoryAvailabilityBECmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.fulfillment.commands.CheckInventoryAvailabilityBECmdImpl
All Implemented Interfaces:
CheckInventoryAvailabilityCmd, ECCommand, ECTargetableCommand, TaskCommand

public class CheckInventoryAvailabilityBECmdImpl
extends TaskCommandImpl
implements CheckInventoryAvailabilityCmd

Checks that either there is sufficient existing inventory for a list of items from a backend. The backend can return schedule line items.

Behaviour

The input item(s) are updated or split with availble quantity, estimatedAvailabilityTime and shippingOffset information.

If the available inventory is not sufficient, then throws an exception.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          IBM Copyright notice
static java.lang.String ERR_CHECK_INV
          The ERR_CHECK_INV value.
static java.lang.Integer iStoreId
          The storeId on whose behalf we are searching.
protected static java.lang.String istrPerformFunc
          The performExecute() method name.
protected static java.lang.String istrThisClass
          The name of this class.
static java.lang.String PARTNUMBER
          The PARTNUMBER string.
static java.lang.String QUANTITY
          The QUANTITY string.
static java.lang.String STOREID
          The STOREID string.
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.fulfillment.commands. CheckInventoryAvailabilityCmd
defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
CheckInventoryAvailabilityBECmdImpl()
           
 
Method Summary
  Item getCatEntry()
          Gets an item to check inventory for.
 java.util.Vector getCatEntryFulfillmentCenters()
          Gets a list of fulfillment centers for an item specified by setCatEntry method.
 java.util.Hashtable getOrderItemFulfillmentCentersMaps()
          Gets the map storing lists of fulfillment centers to check for order items.
 java.util.Enumeration getOrderItems()
          Gets items to check for in inventory.
 java.lang.String getUnitOfMeasure()
          Gets the unit of measure to check inventory for an item specified by setCatEntry method.
 void performExecute()
          Contains the actual business logic of the command.
 void reset()
          This method should be called after a command has been executed to reset its states variables.
 void setCatEntry( Item newCatEntry)
          Sets an item to check in the inventory.
 void setCatEntryFulfillmentCenters(java.util.Vector avCatEntryFulfillmentCenters)
          Sets a list of fulfillment centers to check for the item specified by the setCatEntry method.
 void setOrderItemFulfillmentCentersMaps(java.util.Hashtable newOrderItemFulfillmentCentersMaps)
          Sets lists of fulfillment centers to check inventory for items specified by the setOrderItems method.
 void setOrderItems(java.util.Enumeration newOrderItems)
          Sets items to check inventory.
 void setStoreId(java.lang.Integer newStoreId)
          Sets a store id to check the inventory.
 void setUnitOfMeasure(java.lang.String astrUnitOfMeasure)
          Sets the unit of measure to check inventory for an item specified by setCatEntry method.
 
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, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
 
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
IBM Copyright notice
See Also:
Constant Field Values

istrThisClass

protected static java.lang.String istrThisClass
The name of this class.

istrPerformFunc

protected static java.lang.String istrPerformFunc
The performExecute() method name.

ERR_CHECK_INV

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

iStoreId

public static java.lang.Integer iStoreId
The storeId on whose behalf we are searching.

PARTNUMBER

public static final java.lang.String PARTNUMBER
The PARTNUMBER string.
See Also:
Constant Field Values

QUANTITY

public static final java.lang.String QUANTITY
The QUANTITY string.
See Also:
Constant Field Values

STOREID

public static final java.lang.String STOREID
The STOREID string.
See Also:
Constant Field Values
Constructor Detail

CheckInventoryAvailabilityBECmdImpl

public CheckInventoryAvailabilityBECmdImpl()
Method Detail

getCatEntry

public Item getCatEntry()
Gets an item to check inventory for.
Returns:
Item representing the catalog entry and quantity to check inventory.
See Also:
CheckInventoryAvailabilityCmdImpl.getCatEntry()

getCatEntryFulfillmentCenters

public java.util.Vector getCatEntryFulfillmentCenters()
Gets a list of fulfillment centers for an item specified by setCatEntry method.
Returns:
the vector of fulfillment centers
See Also:
CheckInventoryAvailabilityCmdImpl.getCatEntryFulfillmentCenters()

getOrderItemFulfillmentCentersMaps

public java.util.Hashtable getOrderItemFulfillmentCentersMaps()
Gets the map storing lists of fulfillment centers to check for order items.
Returns:
lists of fulfillment centers to check inventory for items specified by the setOrderItems method.
See Also:
CheckInventoryAvailabilityCmdImpl.getOrderItemFulfillmentCentersMaps()

getOrderItems

public java.util.Enumeration getOrderItems()
Gets items to check for in inventory.
Returns:
Enumeration of order items

getUnitOfMeasure

public java.lang.String getUnitOfMeasure()
Gets the unit of measure to check inventory for an item specified by setCatEntry method.
Returns:
unit of measure used to check inventory
See Also:
CheckInventoryAvailabilityCmdImpl.getUnitOfMeasure()

performExecute

public void performExecute()
                    throws ECException
Contains the actual business logic of the command. This method will iterate through the list of OrderItemAccessBean's: for each order item found, it will get the item id, quantity required, store id, then try to get a list of fulfillment centers that may have this item in stock (if none found then throw ECException). Now pass the information obtained to the checkInventoryFromBE method to actually do the work of finding out if the orders can be satisfied. Note that the ienOrderitems attribute should be set before invoking this method, using the setOrderItems() method.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - thrown if no fulfillment centers have this item id in their inventory; also thrown if any EJB exception occur during the processing of this command. Raised ECApplicationException with ERR_BAD_MISSING_CMD_PARAMETER message when the vector storing the fulfillment centers are empty. Raised with ERR_REMOTE_EXCEPTION message when it encounters a RemoteException. Raised with ERR_CREATE_EXCEPTION message when it encounters a CreateException. Raised with ERR_NAMING_EXCEPTION message when it encounters a NamingException. Raised with ERR_FINDER_EXCEPTION message when it encounters a FinderException.

reset

public void reset()
This method should be called after a command has been executed to reset its states variables.
Overrides:
reset in class AbstractECTargetableCommand
See Also:
CheckInventoryAvailabilityCmdImpl.reset()

setCatEntry

public void setCatEntry(Item newCatEntry)
Sets an item to check in the inventory.
Specified by:
setCatEntry in interface CheckInventoryAvailabilityCmd
Parameters:
newCatEntry - the store identifier, catalog entry identifier, and quantity of the Item are used.
See Also:
CheckInventoryAvailabilityCmdImpl.setCatEntry()

setCatEntryFulfillmentCenters

public void setCatEntryFulfillmentCenters(java.util.Vector avCatEntryFulfillmentCenters)
Sets a list of fulfillment centers to check for the item specified by the setCatEntry method.
Specified by:
setCatEntryFulfillmentCenters in interface CheckInventoryAvailabilityCmd
Parameters:
avCatEntryFulfillmentCenters - list of fulfillment centers.
See Also:
CheckInventoryAvailabilityCmdImpl.setCatEntryFulfillmentCenters()

setOrderItemFulfillmentCentersMaps

public void setOrderItemFulfillmentCentersMaps(java.util.Hashtable newOrderItemFulfillmentCentersMaps)
Sets lists of fulfillment centers to check inventory for items specified by the setOrderItems method.
Specified by:
setOrderItemFulfillmentCentersMaps in interface CheckInventoryAvailabilityCmd
Parameters:
newOrderItemFulfillmentCentersMaps - lists of fulfillment centers keyed by the order item id. Hashtable:
See Also:
CheckInventoryAvailabilityCmdImpl.setOrderItemFulfillmentCentersMaps()

setOrderItems

public void setOrderItems(java.util.Enumeration newOrderItems)
Sets items to check inventory. Each item has an associated prioritized list of fulfillment centers where the check should be made specified by the setOrderItemFulfillmentCentersMaps method.
Specified by:
setOrderItems in interface CheckInventoryAvailabilityCmd
Parameters:
newOrderItems - the items to be checked (Enumeration of OrderItemAccessBean).
See Also:
CheckInventoryAvailabilityCmdImpl.setOrderitems()

setStoreId

public void setStoreId(java.lang.Integer newStoreId)
Sets a store id to check the inventory.
Specified by:
setStoreId in interface CheckInventoryAvailabilityCmd
Parameters:
newStoreId - the store id to use
See Also:
CheckInventoryAvailabilityCmdImpl.setStoreId()

setUnitOfMeasure

public void setUnitOfMeasure(java.lang.String astrUnitOfMeasure)
Sets the unit of measure to check inventory for an item specified by setCatEntry method.
Specified by:
setUnitOfMeasure in interface CheckInventoryAvailabilityCmd
Parameters:
astrUnitOfMeasure - unit of measure.
See Also:
CheckInventoryAvailabilityCmdImpl.setUnitOfMeasure()