com.ibm.commerce.rfq.commands
Class RFQToOrderCreateCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.rfq.commands.RFQToOrderCreateCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, RFQToOrderCreateCmd

public class RFQToOrderCreateCmdImpl
extends ControllerCommandImpl
implements RFQToOrderCreateCmd

This is the default implementation of the RFQToOrderCreateCmd. This command calls the following TaskCommands:

This command uses the following AccessBeans:
See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field
 
Fields inherited from class com.ibm.commerce.command. ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.rfq.commands. RFQToOrderCreateCmd
defaultCommandClassName, NAME
 
Constructor Summary
RFQToOrderCreateCmdImpl()
           
 
Method Summary
 void createOrders()
          Creates an order for each winning response.
 java.lang.String getBillTo()
          Gets the billTo
 java.util.Hashtable getPayment()
          Gets the payment
 java.lang.Long getResId()
          Gets the resId
  AccessVector getResources()           Gets the access vector accessed by this command.
 java.lang.Long getRfqId()
          Returns the RFQ identifier.
 java.lang.Long getRfqOwner()
          Returns the RFQ owner's member Id.
 void performExecute()           Completes the RFQ by creating a contract or an order for each winning response. This method does the following:
Calls createOrders() if there is no more winning responses: 1) Sets the state of the RFQ to "Complete". 2) Sets the completion time for the RFQ. 3) Raises a UBF event to change the state of all the non-winning responses that are in evaluation for this RFQ
 void reset()
          Reset the command
 void setBillTo(java.lang.String billTo)
          Sets the billTo
 void setPayment(java.util.Hashtable payment)
          Sets the payment
 void setRequestProperties( TypedProperty requestProperties)           Get the rfqId, resId, billTo parameters from the request.
 void setResId(java.lang.Long resId)
          Sets the resId
 void setRfqId(java.lang.Long newRfqId)
          Assigns the incoming RFQ identifier to a member variable.
 void setRfqOwner(java.lang.Long newRfqOwner)
          Assigns the incoming member identifier of the RFQ owner to a member variable.
 void validateParameters()           Validates the incoming parameters for this command. This method expects the following parameters : offering_id , the reference number of the RFQ that is to be completed This method does the following:
Checks if a RFQ Id has been specified. Checks if the specified RFQ Id is valid. Checks if the RFQ is in the appropriate state. Calls checkContractParamters, if the endresult of this RFQ is a contract. Calls checkOrderParamters, if the endresult of this RFQ is an order. Throws an INVALID OFFERING ID Excepion if the endresult is neither.
 
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, 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. ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command. AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command. ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 

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

RFQToOrderCreateCmdImpl

public RFQToOrderCreateCmdImpl()
Method Detail

reset

public void reset()
Reset the command
Overrides:
reset in class AbstractECTargetableCommand

getResources

public AccessVector getResources()
                          throws ECException
Gets the access vector accessed by this command.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
AccessVector - a vector of resource action pairs
Throws:
ECException
See Also:
ECCommand#getResources()

createOrders

public void createOrders()
                  throws ECException
Creates an order for each winning response. This method does the following:
  1. Retrieves the list of winning responses for the incoming RFQ.
  2. For each response, performs the following steps.
  3. Calls the AdminOrderItemUpdateCmd for each item in the response. The outcome is a single order with one or more order items.
  4. Calls the OrderPrepareCmd that allocates inventory and performs Fulfillment Center related checks.
  5. Calls the OrderProcessCmd that handles payment processing.
Throws:
ECException

getRfqId

public java.lang.Long getRfqId()
Returns the RFQ identifier.
Returns:
The RFQ Id.

getRfqOwner

public java.lang.Long getRfqOwner()
Returns the RFQ owner's member Id.
Returns:
The member Id of the RFQ owner.

performExecute

public void performExecute()
                    throws ECException
Completes the RFQ by creating a contract or an order for each winning response. This method does the following:
  1. Calls createOrders()
  2. if there is no more winning responses:
  3. 1) Sets the state of the RFQ to "Complete".
  4. 2) Sets the completion time for the RFQ.
  5. 3) Raises a UBF event to change the state of all the non-winning responses that are in evaluation for this RFQ
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException
See Also:
ECCommand#performExecute()

setRequestProperties

public void setRequestProperties(TypedProperty requestProperties)
                          throws ECApplicationException,
ECException
Get the rfqId, resId, billTo parameters from the request.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ControllerCommandImpl
Parameters:
requestProperties - TypedProperty containing the input parameters
Throws:
\ECApplicationException
ECException
ECApplicationException
See Also:
ControllerCmd#setRequestProperties(TypedProperty)

setRfqId

public void setRfqId(java.lang.Long newRfqId)
Assigns the incoming RFQ identifier to a member variable.
Parameters:
newRfqId - The RFQ identifier.

setRfqOwner

public void setRfqOwner(java.lang.Long newRfqOwner)
Assigns the incoming member identifier of the RFQ owner to a member variable.
Parameters:
newRfqOwner - The member Id of the RFQ owner.

validateParameters

public void validateParameters()
                        throws ECException
Validates the incoming parameters for this command. This method expects the following parameters : offering_id , the reference number of the RFQ that is to be completed This method does the following:
  1. Checks if a RFQ Id has been specified.
  2. Checks if the specified RFQ Id is valid.
  3. Checks if the RFQ is in the appropriate state.
  4. Calls checkContractParamters, if the endresult of this RFQ is a contract.
  5. Calls checkOrderParamters, if the endresult of this RFQ is an order.
  6. Throws an INVALID OFFERING ID Excepion if the endresult is neither.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException
See Also:
ECCommand#validateParameters()

getPayment

public java.util.Hashtable getPayment()
Gets the payment
Returns:
Returns a Hashtable

setPayment

public void setPayment(java.util.Hashtable payment)
Sets the payment
Parameters:
payment - The payment to set

getBillTo

public java.lang.String getBillTo()
Gets the billTo
Returns:
Returns a String

setBillTo

public void setBillTo(java.lang.String billTo)
Sets the billTo
Parameters:
billTo - The billTo to set

getResId

public java.lang.Long getResId()
Gets the resId
Returns:
Returns a java.lang.Long

setResId

public void setResId(java.lang.Long resId)
Sets the resId
Parameters:
resId - The resId to set