com.ibm.commerce.fulfillment.commands
Class GetEligibleFulfillmentCentersCmdImpl

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

public class GetEligibleFulfillmentCentersCmdImpl
extends TaskCommandImpl
implements GetEligibleFulfillmentCentersCmd

The default implementation of the GetEligibleFulfillmentCenters task command interface. For each input item, returns a list of fulfillment centers (ordered in sequence of descending preference from first to last) that could ship that item if there was sufficient inventory. Refer to the performExecute method for a description of its behaviour.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          IBM Copyright notice field.
protected static java.lang.String istrCheckParametersFunc
          Deprecated. Will be changed to private.
protected static java.lang.String istrPerformFunc
          Deprecated. Will be changed to private.
protected static java.lang.String istrPrintFulfillmentCentersFunc
          Deprecated. Will be changed to private.
protected static java.lang.String istrThisClass
          Deprecated. Will be changed to private.
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.fulfillment.commands. GetEligibleFulfillmentCentersCmd
defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
GetEligibleFulfillmentCentersCmdImpl()
           
 
Method Summary
 java.util.Vector getAllOrderItems()
          Deprecated. This method will be changed to protected.
 java.util.Vector getFulfillmentCenters()
          Returns a list of fulfillment centers that could ship an item specified by the setOrderItem method.
 java.util.Hashtable getOrderItemFulfillmentCentersMaps()
          Gets lists of fulfillment centers which can ship items specified by the setOrderItems method.
 java.util.Vector getOrderItems()
          Deprecated. This method will be changed to protected.
 java.lang.Integer getPreferredFulfillmentCenterId()
          Deprecated. This method will be changed to protected.
 void performExecute()
          Performs the actual business logic of the command.
 void reset()
          This method should be called after a command has been executed to reset its instance variables.
 void setAllOrderItems(java.util.Vector newAllOrderItems)
          Sets all order items to be considered when determining fulfillment centers.
 void setOrderItem( Item anOrderItemData)
          Sets the item (with specified catalog entry id) for which eligible fulfillment centers are to be determined.
 void setOrderItemFulfillmentCentersMaps(java.util.Hashtable newOrderItemFulfillmentCentersMaps)
          Sets the lists of fulfillment centers which can ship items specified by the setOrderItems method.
 void setOrderItems(java.util.Vector newOrderItems)
          Sets the item (with specified catalog entry id) for which eligible fulfillment centers are to be determined.
 void setPreferredFulfillmentCenterId(java.lang.Integer newPreferredFulfillmentCenterId)
          Sets the preferred fulfillment center.
 
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 field.
See Also:
Constant Field Values

istrThisClass

protected static final java.lang.String istrThisClass
Deprecated. Will be changed to private.
See Also:
Constant Field Values

istrPerformFunc

protected static final java.lang.String istrPerformFunc
Deprecated. Will be changed to private.
See Also:
Constant Field Values

istrCheckParametersFunc

protected static final java.lang.String istrCheckParametersFunc
Deprecated. Will be changed to private.
See Also:
Constant Field Values

istrPrintFulfillmentCentersFunc

protected static final java.lang.String istrPrintFulfillmentCentersFunc
Deprecated. Will be changed to private.
See Also:
Constant Field Values
Constructor Detail

GetEligibleFulfillmentCentersCmdImpl

public GetEligibleFulfillmentCentersCmdImpl()
Method Detail

getAllOrderItems

public java.util.Vector getAllOrderItems()
Deprecated. This method will be changed to protected.
Gets all order items to be considered when determining fulfillment centers.
Returns:
a Vector of Item.

getFulfillmentCenters

public java.util.Vector getFulfillmentCenters()
Returns a list of fulfillment centers that could ship an item specified by the setOrderItem method. This method is used to obtain a list of fulfillment centers for an order item if only one order item has been passed as input if more than one order item data has been passed as input then getOrderItemFulfillmentCentersMaps should be called instead.
Specified by:
getFulfillmentCenters in interface GetEligibleFulfillmentCentersCmd
Returns:
a Vector of FulfillmentCenter identifiers (Vector of Integer).

getOrderItemFulfillmentCentersMaps

public java.util.Hashtable getOrderItemFulfillmentCentersMaps()
Gets lists of fulfillment centers which can ship items specified by the setOrderItems method.
Specified by:
getOrderItemFulfillmentCentersMaps in interface GetEligibleFulfillmentCentersCmd
Returns:
HashTable:
  • key - (Long) The OrderItem identifier, if known. Otherwise, a negative number.
  • value - (Object[2]) Object[0] is the com.ibm.commerce.order.calculation.Item. Object[1] is a Vector of Integer fulfillment center identifiers.

getOrderItems

public java.util.Vector getOrderItems()
Deprecated. This method will be changed to protected.
Gets the order items for which eligible fulfillment centers are to be determined.
Returns:
a Vector of com.ibm.commerce.order.calculation.Item.

getPreferredFulfillmentCenterId

public java.lang.Integer getPreferredFulfillmentCenterId()
Deprecated. This method will be changed to protected.
Gets the preferred fulfillment center.
Returns:
Integer the identifier of the preferred fulfillment center.

performExecute

public void performExecute()
                    throws ECException
Performs the actual business logic of the command. Behaviour The default implementation behaves as follows: For each distinct store, shipping address and shipping mode combination in those input order items in whose fulfillment centers are not overridden in their PREPAREFLAGS attributes: The result is a list of eligible fulfillment centers for each distinct shipping address and shipping mode combination. For each order item:
  1. If the fulfillment center has been overridden in the PREPAREFLAGS attribute of the order item, return only that fulfillment center, regardless of the order item's trading agreement.
  2. Otherwise, if the order status of the order item is "B" and the order item already has a fulfillment center, then:
    1. If STORE.FFMCSELECTIONFLAGS specifies preferCurrent then if the order item's current fulfillment center is in the list of eligible fulfillment centers for its shipping address and shipping mode combination, return a copy of the list, but with that fulfillment center moved to the first position, removing any fulfillment centers not allowed by the order item's trading agreement.
    2. If STORE.FFMCSELECTIONFLAGS specifies noChange then return only that fulfillment center, or an empty list if that fulfillment center is not allowed by the order item's trading agreement.
  3. If the above steps did not determine the result, return the list of eligible fulfillment centers for the order item's shipping address and shipping mode combination, removing any fulfillment centers not allowed by the order item's trading agreement.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException

reset

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

setAllOrderItems

public void setAllOrderItems(java.util.Vector newAllOrderItems)
Sets all order items to be considered when determining fulfillment centers. Normally this is all the order items in an order. If setAllOrderItems is not called, this command behaves as if it was called with the same OrderItems specified by setOrderItem or setOrderItems.
Specified by:
setAllOrderItems in interface GetEligibleFulfillmentCentersCmd
Parameters:
newAllOrderItems - a Vector of com.ibm.commerce.order.calculation.Item.

setOrderItem

public void setOrderItem(Item anOrderItemData)
Sets the item (with specified catalog entry id) for which eligible fulfillment centers are to be determined. If both setOrderItem and SetOrderItems are called, only the last call has effect.
Specified by:
setOrderItem in interface GetEligibleFulfillmentCentersCmd
Parameters:
anOrderItemData - the order item.

setOrderItemFulfillmentCentersMaps

public void setOrderItemFulfillmentCentersMaps(java.util.Hashtable newOrderItemFulfillmentCentersMaps)
Sets the lists of fulfillment centers which can ship items specified by the setOrderItems method.
Parameters:
newOrderItemFulfillmentCentersMaps - Hashtable:
  • key - (Long) The OrderItem identifier, if known. Otherwise, a negative number.
  • value - (Object[2]) Object[0] is the com.ibm.commerce.order.calculation.Item. Object[1] is a Vector of Integer fulfillment center identifiers.

setOrderItems

public void setOrderItems(java.util.Vector newOrderItems)
Sets the item (with specified catalog entry id) for which eligible fulfillment centers are to be determined. If both setOrderItem and SetOrderItems are called, only the last call has effect.
Specified by:
setOrderItems in interface GetEligibleFulfillmentCentersCmd
Parameters:
newOrderItems - a Vector of Item.

setPreferredFulfillmentCenterId

public void setPreferredFulfillmentCenterId(java.lang.Integer newPreferredFulfillmentCenterId)
Sets the preferred fulfillment center.
Specified by:
setPreferredFulfillmentCenterId in interface GetEligibleFulfillmentCentersCmd
Parameters:
newPreferredFulfillmentCenterId - the identifier of the preferred fulfillment center.