com.ibm.commerce.messaging.commands
Class SendXMLOrderCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.messaging.commands.SendXMLOrderCmdImpl
All Implemented Interfaces:
ECCommand, ECTargetableCommand, OrderMessagingCmd, TaskCommand

public class SendXMLOrderCmdImpl
extends TaskCommandImpl
implements OrderMessagingCmd

Task command to create and send XML Order Create message.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          The IBM copyright notice field.
static java.lang.Integer MSGTYPE
          Message type id for XML Order Create message, which is 101.
protected  TypedProperty ocProp
           
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.order.commands. OrderMessagingCmd
defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
SendXMLOrderCmdImpl()
           
 
Method Summary
 boolean composeOrder()
          Build the XML Order Create message using the outbound messaging system composition services and OrderCreateXML.jsp template.
 boolean doPostProcess( TypedProperty aRequestProperty)
          Performs additional processing after the command executes.
 boolean doPreProcess( TypedProperty aRequestProperty)
          Performs additional processing before the command executes.
 boolean doProcess()
          Gets the order information, builds the order create message and sends the message.
 java.lang.String getDate(java.lang.String str)
          Converts timestamp string to YYYYMMDD format.
 java.lang.String getHeaderExtensionRecords()
          Implements this method when you extend the command to do outbound message extension at order header level using the UserData XML element and should return a String object that contains a series of UserDataField elements.
 java.lang.String getItemExtensionRecords()
          Implements this method when you extend the command to do outbound message extension at order item level using the UserData XML element and should return a String object that contains a series of UserDataField elements.
 java.lang.Long getOrderRn()
          Gets the order reference number passed to this command.
 java.lang.String getTime(java.lang.String str)
          Converts timestamp string to HHMMSS format
 boolean isReadyToCallExecute()
          Checks if the command is ready to call Execute.
 void performExecute()
          Executes the command by calling doPreProcess, doProcess and doPostProcess
 boolean sendMessage()
          Sends the outbound XML order create message using outbound messaging system sendTransacted() service.
 void setOrderRn(java.lang.Long OrderRn)
          Sets the order reference number used in the command.
 void setRequestProperties( TypedProperty aRequestProperties)
          Sets the request properties as input for the command.
 
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, reset, 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
The IBM copyright notice field.
See Also:
Constant Field Values

ocProp

protected TypedProperty ocProp

MSGTYPE

public static final java.lang.Integer MSGTYPE
Message type id for XML Order Create message, which is 101.
Constructor Detail

SendXMLOrderCmdImpl

public SendXMLOrderCmdImpl()
Method Detail

composeOrder

public boolean composeOrder()
                     throws ECException
Build the XML Order Create message using the outbound messaging system composition services and OrderCreateXML.jsp template.
Returns:
true if no exception was encountered; false otherwise.
Throws:
ECException

doPostProcess

public boolean doPostProcess(TypedProperty aRequestProperty)
Performs additional processing after the command executes.
Parameters:
aRequestProperty - com.ibm.commerce.datatype.TypedProperty
Returns:
true under the current implementation.

doPreProcess

public boolean doPreProcess(TypedProperty aRequestProperty)
Performs additional processing before the command executes.
Parameters:
aRequestProperty - com.ibm.commerce.datatype.TypedProperty
Returns:
true under the current implementation.

doProcess

public boolean doProcess()
Gets the order information, builds the order create message and sends the message.
Returns:
true when there is no exception encountered; false otherwise.

getDate

public java.lang.String getDate(java.lang.String str)
Converts timestamp string to YYYYMMDD format.
Parameters:
str - the timestamp string
Returns:
the string with the date

getHeaderExtensionRecords

public java.lang.String getHeaderExtensionRecords()
Implements this method when you extend the command to do outbound message extension at order header level using the UserData XML element and should return a String object that contains a series of UserDataField elements.
Returns:
null under the current implementation.

getItemExtensionRecords

public java.lang.String getItemExtensionRecords()
Implements this method when you extend the command to do outbound message extension at order item level using the UserData XML element and should return a String object that contains a series of UserDataField elements.
Returns:
null under the current implementation.

getOrderRn

public java.lang.Long getOrderRn()
Gets the order reference number passed to this command.
Specified by:
getOrderRn in interface OrderMessagingCmd
Returns:
the order reference number

getTime

public java.lang.String getTime(java.lang.String str)
Converts timestamp string to HHMMSS format
Parameters:
str - the timestamp in String format
Returns:
the time string

isReadyToCallExecute

public boolean isReadyToCallExecute()
Checks if the command is ready to call Execute.
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Returns:
true if the command is ready to call performExecute() method; false otherwise.

performExecute

public void performExecute()
                    throws ECException
Executes the command by calling doPreProcess, doProcess and doPostProcess
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException

sendMessage

public boolean sendMessage()
                    throws ECException
Sends the outbound XML order create message using outbound messaging system sendTransacted() service.
Returns:
true when there is no exception encountered; false otherwise.
Throws:
ECException

setOrderRn

public void setOrderRn(java.lang.Long OrderRn)
Sets the order reference number used in the command.
Specified by:
setOrderRn in interface OrderMessagingCmd
Parameters:
OrderRn - order id.

setRequestProperties

public void setRequestProperties(TypedProperty aRequestProperties)
                          throws ECApplicationException
Sets the request properties as input for the command.
Parameters:
aRequestProperties - The request properties object of the command.
Throws:
ECApplicationException