com.ibm.commerce.order.commands
Class OrderProcessCmdImpl

com.ibm.commerce.command.AbstractECTargetableCommand
  |
  +--com.ibm.commerce.command.ControllerCommandImpl
        |
        +--com.ibm.commerce.order.commands.OrderProcessCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, OrderProcessCmd, Protectable

public class OrderProcessCmdImpl
extends ControllerCommandImpl
implements OrderProcessCmd

This command submits an order. The order must have been locked by OrderPrepare. Once the OrderProcess command begins running, the order cannot be cancelled with OrderCancel.

Behaviour

OrderProcess command


Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.Short VAL_NOTIFY_NO
           
static java.lang.Short VAL_NOTIFY_YES
           
 
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.order.commands.OrderProcessCmd
DEFAULT_MAX_AVAILABILITY_CHANGE, defaultCommandClassName, NAME
 
Constructor Summary
OrderProcessCmdImpl()
           
 
Method Summary
static void checkInventory(java.lang.Long anOrderRn, java.lang.Integer anStoreId, CommandContext aProcessingContext)
          This helper method which calls the default implementation of the CheckInventoryCmd task command This method is deprecated.
static void checkInventory(java.lang.Long anOrderRn, java.lang.Integer anStoreId, CommandContext aProcessingContext, java.lang.String astrTaskName)
          This is a helper method that calls a specified implementation of the CheckInventoryCmd task command This method is deprecated.
static void extendOrderProcess(java.lang.Long anOrderRn, java.lang.Integer anStoreId, CommandContext aProcessingContext, TypedProperty ahshRequestProperties)
          This is a helper method that calls the ExtOrderProcessCmd task command
 java.lang.String getAvailabilityChangeURL()
          Gets the URL to redirect to when the estimated availability time plus the shipping offset for any order item moves into the future (as a result of allocating or backordering inventory) by more than the time interval specified by the setMaxAvailabilityChange method.
 java.lang.Long getBillToRn()
          Gets the reference number of the address to bill.
 java.lang.Integer getField1()
          Gets merchant-customizable field one.
 java.math.BigDecimal getField2()
          Gets merchant-customizable field two.
 java.lang.String getField3()
          Gets merchant-customizable field three.
 java.lang.Long getMaxAvailabilityChange()
          Gets the time interval, in seconds, used with the url set by the setAvailabilityChangeURL method.
 java.lang.String getNoInventoryURL()
          Gets the URL to redirect to if any of the order items in the order cannot be allocated or backordered.
 java.lang.Short getNotifyMerchant()
          Determines whether the store should be notified when the order processing is complete.
 java.lang.Short getNotifyOrderSubmitted()
          Determines whether the customer should be notified when the order is successfully submitted for processing.
 java.lang.Short getNotifyShopper()
          Determines whether the customer should be notified when the order processing is complete.
 java.lang.Long getOrderRn()
          Gets the order reference number.
 java.lang.String getQuoteExpiredURL()
          Gets the URL to redirect to if the order total expired in agreement with the expiry policy set by the setQuoteExpiryPolicy method.
 java.lang.String getQuoteExpiryPolicy()
          Gets the policy which determines the command behaviour if the order total expires or an order item's fulfillment center changes during inventory allocation.
 AccessVector getResources()
          Gets the access vector accessed by this command.
static void invokeOrderMessaging(java.lang.Long anOrderRn, java.lang.Integer anStoreId, CommandContext aProcessingContext, TypedProperty ahshRequestProperties)
          This is a helper method that calls the OrderMessagingCmd task command
 boolean isReadyToCallExecute()
          Checks the validity of the parameters
 void performExecute()
          Main business logic
 void reset()
          This method should be called after a command has been executed to reset its states variables.
static void reverseUpdateInventory(java.lang.Long anOrderRn, java.lang.Integer anStoreId, CommandContext aProcessingContext)
          A helper method that calls the default implementation of the ReverseUpdateInventoryCmd task command
static void reverseUpdateInventory(java.lang.Long orderId, java.lang.Integer anStoreId, CommandContext aProcessingContext, java.lang.String astrTaskName)
          A helper method that calls a specified implementation of ReverseUpdateInventoryCmd
 void setAvailabilityChangeURL(java.lang.String newAvailabilityChangeURL)
          Sets the URL to redirect to when the estimated availability time plus the shipping offset for any order item moves into the future (as a result of allocating or backordering inventory) by more than the time interval specified by the setMaxAvailabilityChange method.
 void setBillToRn(java.lang.Long anBillToRn)
          Sets the reference number of the address to bill.
 void setField1(java.lang.Integer anField1)
          Sets merchant-customizable field one.
 void setField2(java.math.BigDecimal adField2)
          Sets merchant-customizable field two.
 void setField3(java.lang.String astrField3)
          Sets merchant-customizable field three.
 void setMaxAvailabilityChange(java.lang.Long newMaxAvailabilityChange)
          Sets the time interval, in seconds, used with the url set by the setAvailabilityChangeURL method.
 void setNoInventoryURL(java.lang.String newNoInventoryURL)
          Sets the URL to redirect to if any of the order items in the order cannot be allocated or backordered.
 void setNotifyMerchant(java.lang.Short newNotifyMerchant)
          Specifies whether the store should be notified when the order processing is complete.
 void setNotifyOrderSubmitted(java.lang.Short newNotifyOrderSubmitted)
          Specifies whether the customer should be notified when the order is successfully submitted for processing.
 void setNotifyShopper(java.lang.Short newNotifyShopper)
          Specifies whether the customer should be notified when the order processing is complete.
 void setOrderRn(java.lang.Long anOrderRn)
          Sets the order reference number.
 void setQuoteExpiredURL(java.lang.String newQuoteExpiredURL)
          Sets the URL to redirect to if the order total expired in agreement with the expiry policy set by the setQuoteExpiryPolicy method.
 void setQuoteExpiryPolicy(java.lang.String newQuoteExpiryPolicy)
          Sets the behavior of the command if the order total expires or an order item's fulfillment center changes during inventory allocation.
 void setRequestProperties(TypedProperty reqParms)
          The WebController calls the setRequestProperties method before invoking the execute method in this command.
static void updateInventory(java.lang.Long anOrderRn, java.lang.Integer anStoreId, CommandContext aProcessingContext)
          A helper method that calls the default implementation of the UpdateInventoryCmd task command
static void updateInventory(java.lang.Long orderId, java.lang.Integer anStoreId, CommandContext aProcessingContext, java.lang.String astrTaskName)
          A helper method that calls a specified implementation of UpdateInventoryCmd
 void validateParameters()
          Performs server side parameter checking.
 
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
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, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT

VAL_NOTIFY_NO

public static final java.lang.Short VAL_NOTIFY_NO

VAL_NOTIFY_YES

public static final java.lang.Short VAL_NOTIFY_YES
Constructor Detail

OrderProcessCmdImpl

public OrderProcessCmdImpl()
Method Detail

checkInventory

public static void checkInventory(java.lang.Long anOrderRn,
                                  java.lang.Integer anStoreId,
                                  CommandContext aProcessingContext)
                           throws ECException,
                                  javax.ejb.FinderException,
                                  java.rmi.RemoteException,
                                  javax.naming.NamingException,
                                  javax.ejb.CreateException
This helper method which calls the default implementation of the CheckInventoryCmd task command This method is deprecated. It can only be used when ATP is disabled.
Parameters:
anOrderRn - Order reference number
anStoreId - Store reference number
aProcessingContext - Command context

checkInventory

public static void checkInventory(java.lang.Long anOrderRn,
                                  java.lang.Integer anStoreId,
                                  CommandContext aProcessingContext,
                                  java.lang.String astrTaskName)
                           throws ECException,
                                  javax.ejb.FinderException,
                                  java.rmi.RemoteException,
                                  javax.naming.NamingException,
                                  javax.ejb.CreateException
This is a helper method that calls a specified implementation of the CheckInventoryCmd task command This method is deprecated. It can only be used when ATP is disabled.
Parameters:
anOrderRn - Order reference number
anStoreId - Store reference number
aProcessingContext - Command context
astrTaskName - Name of the task command to use to checkInventory

extendOrderProcess

public static void extendOrderProcess(java.lang.Long anOrderRn,
                                      java.lang.Integer anStoreId,
                                      CommandContext aProcessingContext,
                                      TypedProperty ahshRequestProperties)
                               throws ECException
This is a helper method that calls the ExtOrderProcessCmd task command
Parameters:
anOrderRn - Order reference number to do extended processing on
anStoreId - Store reference number
aProcessingContext - Command context
ahshRequestProperties - Name value pairs

getAvailabilityChangeURL

public java.lang.String getAvailabilityChangeURL()
Gets the URL to redirect to when the estimated availability time plus the shipping offset for any order item moves into the future (as a result of allocating or backordering inventory) by more than the time interval specified by the setMaxAvailabilityChange method.

getBillToRn

public java.lang.Long getBillToRn()
Gets the reference number of the address to bill.

getField1

public java.lang.Integer getField1()
Gets merchant-customizable field one.

getField2

public java.math.BigDecimal getField2()
Gets merchant-customizable field two.

getField3

public java.lang.String getField3()
Gets merchant-customizable field three.

getMaxAvailabilityChange

public java.lang.Long getMaxAvailabilityChange()
Gets the time interval, in seconds, used with the url set by the setAvailabilityChangeURL method.

getNoInventoryURL

public java.lang.String getNoInventoryURL()
Gets the URL to redirect to if any of the order items in the order cannot be allocated or backordered.

getNotifyMerchant

public java.lang.Short getNotifyMerchant()
Determines whether the store should be notified when the order processing is complete.

getNotifyOrderSubmitted

public java.lang.Short getNotifyOrderSubmitted()
Determines whether the customer should be notified when the order is successfully submitted for processing.

getNotifyShopper

public java.lang.Short getNotifyShopper()
Determines whether the customer should be notified when the order processing is complete.

getOrderRn

public java.lang.Long getOrderRn()
Gets the order reference number.

getQuoteExpiredURL

public java.lang.String getQuoteExpiredURL()
Gets the URL to redirect to if the order total expired in agreement with the expiry policy set by the setQuoteExpiryPolicy method.

getQuoteExpiryPolicy

public java.lang.String getQuoteExpiryPolicy()
Gets the policy which determines the command behaviour if the order total expires or an order item's fulfillment center changes during inventory allocation.

getResources

public AccessVector getResources()
                          throws ECException
Description copied from interface: ECCommand
Gets the access vector accessed by this command. The default implementation returns null indicating that no protectable resource is accessed by this command. It is the responsibilities of the command writer to return the protectable primary resource(s) and the corresponding actions accessed by this command.

Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Returns:
AccessVector - a vector of resource action pairs

invokeOrderMessaging

public static void invokeOrderMessaging(java.lang.Long anOrderRn,
                                        java.lang.Integer anStoreId,
                                        CommandContext aProcessingContext,
                                        TypedProperty ahshRequestProperties)
                                 throws ECException
This is a helper method that calls the OrderMessagingCmd task command
Parameters:
anOrderRn - Order reference number to do extended processing on
anStoreId - Store reference number
aProcessingContext - Command context
ahshRequestProperties - Name value pairs

isReadyToCallExecute

public boolean isReadyToCallExecute()
Checks the validity of the parameters
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Following copied from class: com.ibm.commerce.command.AbstractECTargetableCommand
Returns:
boolean - true if we can execute the command false if we canot execute the command

performExecute

public void performExecute()
                    throws ECException
Main business logic
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

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

reverseUpdateInventory

public static void reverseUpdateInventory(java.lang.Long anOrderRn,
                                          java.lang.Integer anStoreId,
                                          CommandContext aProcessingContext)
                                   throws ECException
A helper method that calls the default implementation of the ReverseUpdateInventoryCmd task command
Parameters:
anOrderRn - Order reference number
anStoreId - Store reference number
aProcessingContext - Command context

reverseUpdateInventory

public static void reverseUpdateInventory(java.lang.Long orderId,
                                          java.lang.Integer anStoreId,
                                          CommandContext aProcessingContext,
                                          java.lang.String astrTaskName)
                                   throws ECException
A helper method that calls a specified implementation of ReverseUpdateInventoryCmd
Parameters:
anOrderRn - Order reference number
anStoreId - Store reference number
aProcessingContext - Command context
astrTaskName - Name of the task command to use to Reverse Update Inventory

setAvailabilityChangeURL

public void setAvailabilityChangeURL(java.lang.String newAvailabilityChangeURL)
Sets the URL to redirect to when the estimated availability time plus the shipping offset for any order item moves into the future (as a result of allocating or backordering inventory) by more than the time interval specified by the setMaxAvailabilityChange method. This parameter is ignored if ATP inventory allocation is not enabled.
Specified by:
setAvailabilityChangeURL in interface OrderProcessCmd

setBillToRn

public void setBillToRn(java.lang.Long anBillToRn)
Sets the reference number of the address to bill.
Specified by:
setBillToRn in interface OrderProcessCmd

setField1

public void setField1(java.lang.Integer anField1)
Sets merchant-customizable field one.
Specified by:
setField1 in interface OrderProcessCmd

setField2

public void setField2(java.math.BigDecimal adField2)
Sets merchant-customizable field two.
Specified by:
setField2 in interface OrderProcessCmd

setField3

public void setField3(java.lang.String astrField3)
Sets merchant-customizable field three.
Specified by:
setField3 in interface OrderProcessCmd

setMaxAvailabilityChange

public void setMaxAvailabilityChange(java.lang.Long newMaxAvailabilityChange)
Sets the time interval, in seconds, used with the url set by the setAvailabilityChangeURL method. The default value is 3600 (one hour). This parameter is ignored if the availabilityChangeURL is not specified, or if ATP inventory allocation is not enabled.
Specified by:
setMaxAvailabilityChange in interface OrderProcessCmd

setNoInventoryURL

public void setNoInventoryURL(java.lang.String newNoInventoryURL)
Sets the URL to redirect to if any of the order items in the order cannot be allocated or backordered. This parameter is ignored if ATP inventory allocation is not enabled.
Specified by:
setNoInventoryURL in interface OrderProcessCmd

setNotifyMerchant

public void setNotifyMerchant(java.lang.Short newNotifyMerchant)
Specifies whether the store should be notified when the order processing is complete. Valid values include :

1=Yes

0=No

Specified by:
setNotifyMerchant in interface OrderProcessCmd

setNotifyOrderSubmitted

public void setNotifyOrderSubmitted(java.lang.Short newNotifyOrderSubmitted)
Specifies whether the customer should be notified when the order is successfully submitted for processing. Valid values include :

1=Yes

0=No (default)

Specified by:
setNotifyOrderSubmitted in interface OrderProcessCmd

setNotifyShopper

public void setNotifyShopper(java.lang.Short newNotifyShopper)
Specifies whether the customer should be notified when the order processing is complete. Valid values include :

1=Yes

0=No

Specified by:
setNotifyShopper in interface OrderProcessCmd

setOrderRn

public void setOrderRn(java.lang.Long anOrderRn)
Sets the order reference number.
Specified by:
setOrderRn in interface OrderProcessCmd

setQuoteExpiredURL

public void setQuoteExpiredURL(java.lang.String newQuoteExpiredURL)
Sets the URL to redirect to if the order total expired in agreement with the expiry policy set by the setQuoteExpiryPolicy method.
Specified by:
setQuoteExpiredURL in interface OrderProcessCmd

setQuoteExpiryPolicy

public void setQuoteExpiryPolicy(java.lang.String newQuoteExpiryPolicy)
Sets the behavior of the command if the order total expires or an order item's fulfillment center changes during inventory allocation. Order total expires if the current time is greater than or equal to the order last update timestamp plus the number of seconds specified in the QUOTEGOODFOR column of the STORE table. This parameter may have three values:

  1. alwaysProceed - always proceed with processing the order after recalculating order total.
  2. stopOnBiggerTotal - proceed with processing the order if the recalculated order total is unchanged or less than the previous order total. Otherwise, redirect to a URL set by the setQuoteExpiredUrl method.
  3. neverProceed - always redirect to the URL specified by the set by the setQuoteExpiredUrl method.
Specified by:
setQuoteExpiryPolicy in interface OrderProcessCmd

setRequestProperties

public void setRequestProperties(TypedProperty reqParms)
                          throws ECApplicationException
The WebController calls the setRequestProperties method before invoking the execute method in this command.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ControllerCommandImpl
Following copied from interface: com.ibm.commerce.command.ControllerCommand
Parameters:
requestProperties - com.ibm.commerce.datatype.TypedProperty
Throws:
com.ibm.commerce.exception.ECException. -  

updateInventory

public static void updateInventory(java.lang.Long anOrderRn,
                                   java.lang.Integer anStoreId,
                                   CommandContext aProcessingContext)
                            throws ECException
A helper method that calls the default implementation of the UpdateInventoryCmd task command
Parameters:
anOrderRn - Order reference number
anStoreId - Store reference number
aProcessingContext - Command context

updateInventory

public static void updateInventory(java.lang.Long orderId,
                                   java.lang.Integer anStoreId,
                                   CommandContext aProcessingContext,
                                   java.lang.String astrTaskName)
                            throws ECException
A helper method that calls a specified implementation of UpdateInventoryCmd
Parameters:
anOrderRn - Order reference number
anStoreId - Store reference number
aProcessingContext - Command context
astrTaskName - Name of the task command to use to Update Inventory

validateParameters

public void validateParameters()
                        throws ECException
Performs server side parameter checking.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -