com.ibm.commerce.messaging.commands

Class SendWCSOrderCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, OrderMessagingCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class SendWCSOrderCmdImpl
    extends TaskCommandImpl
    implements OrderMessagingCmd
    Task command to create and send legacy WebSphere Commerce OrderCreateFixFormat message.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM copyright notice field.
        See Also:
        Constant Field Values
      • orderNVP

        public TypedProperty orderNVP
        Used to hold temporary name-value pairs for order information retrieved from database to use when building the message.
      • MSGTYPE

        public static final java.lang.Integer MSGTYPE
        Deprecated. This field is replaced by MSGTYPENAME.
        Message type ID for WebSphere Commerce OrderCreateFixFormat message, which is 100.
      • MSGTYPENAME

        public static final java.lang.String MSGTYPENAME
        Message type name for WebSphere Commerce OrderCreateFixFormat message.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SendWCSOrderCmdImpl

        public SendWCSOrderCmdImpl()
    • Method Detail

      • doPostProcess

        public boolean doPostProcess(TypedProperty aRequestProperty)
        This method performs additional processing after the command runs.
        Parameters:
        aRequestProperty - The request properties used by the command.
        Returns:
        true under the current implementation
      • doPreProcess

        public boolean doPreProcess(TypedProperty aRequestProperty)
        This method performs additional processing before the command runs.
        Parameters:
        aRequestProperty - The request properties used by the command.
        Returns:
        true under the current implementation
      • doProcess

        public boolean doProcess()
        This method gets the order information, builds the OrderCreateFixFormat 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)
        This method converts timestamp string to
        YYYYMMDD
        format.
        Parameters:
        str - the timestamp string
        Returns:
        the string with the date
      • getHeaderExtensionRecords

        public java.lang.String getHeaderExtensionRecords()
        Implement this method when you extend the command to do outbound message extension at order header level using the USRLST record. It should return a String object that contains a series of DATUSR records.
        Returns:
        null under the current implementation.
      • getItemExtensionRecords

        public java.lang.String getItemExtensionRecords()
        Implement this method when you extend the command to do outbound message extension at order item level using the USRLST record. It should return a String object that contains a series of DATUSR records.
        Returns:
        null under the current implementation.
      • getOrderMsg

        public java.lang.StringBuffer getOrderMsg()
        This method gets the OrderCreateFixFormat message content built by the command.
        Returns:
        the StringBuffer object containing the order message.
      • getOrderRn

        public java.lang.Long getOrderRn()
        This method 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)
        This method converts timestamp string to
        HHMMSS
        format
        Parameters:
        str - the timestamp in String format
        Returns:
        the time string
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        This method checks if the command is ready to call Execute.
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        true if the command is ready to call performExecute() method; false otherwise.
      • sendMessage

        public boolean sendMessage()
        This method sends the outbound OrderCreateFixFormat message by doing the following:

        - Sets the content of the message.

        - Sends the message using outbound messaging system sendTransacted() service.

        Returns:
        true if the message was successfully sent; false otherwise.
      • setOrderCreateBillToData

        public boolean setOrderCreateBillToData()
                                         throws ECException
        This method gets all the bill-to data for WebSphere Commerce OrderCreateFixFormat message.
        Returns:
        true if no exception was encountered; false otherwise.
        Throws:
        ECException - Raised with ERR_CREATE_EXCEPTION when javax.ejb.CreateException exception is encountered. Raised with ERR_GENERIC when javax.naming.NamingException exception is encountered. Raised with ERR_REMOTE_EXCEPTION when java.rmi.RemoteException exception is encountered. Raised with ERR_OC_SUPPLIER_ERROR when javax.ejb.FinderException exception is encountered.
      • setOrderCreateHeaderData

        public boolean setOrderCreateHeaderData()
                                         throws ECException
        This method gets all the order header values for WebSphere Commerce OrderCreateFixFormat message.
        Returns:
        true if no exception was encountered; false otherwise.
        Throws:
        ECException - Raised with ERR_CREATE_EXCEPTION when javax.ejb.CreateException exception is encountered. Raised with ERR_GENERIC when javax.naming.NamingException exception is encountered. Raised with ERR_REMOTE_EXCEPTION when java.rmi.RemoteException exception is encountered. Raised with ERR_OC_SUPPLIER_ERROR when javax.ejb.FinderException exception is encountered.
      • setOrderCreateItemData

        public boolean setOrderCreateItemData()
                                       throws ECException
        This method gets all the order header values for WebSphere Commerce OrderCreateFixFormat message.
        Returns:
        true if no exception was encountered; false otherwise.
        Throws:
        ECException - Raised with ERR_CREATE_EXCEPTION when javax.ejb.CreateException exception is encountered. Raised with ERR_GENERIC when javax.naming.NamingException exception is encountered. Raised with ERR_REMOTE_EXCEPTION when java.rmi.RemoteException exception is encountered. Raised with ERR_OC_SUPPLIER_ERROR when javax.ejb.FinderException exception is encountered.
      • setOrderCreatePurchaserData

        public boolean setOrderCreatePurchaserData()
                                            throws ECException
        This method gets all the purchaser data for WebSphere Commerce OrderCreateFixFormat message.
        Returns:
        true if no exception was encountered; false otherwise.
        Throws:
        ECException - Raised with ERR_CREATE_EXCEPTION when javax.ejb.CreateException exception is encountered. Raised with ERR_GENERIC when javax.naming.NamingException exception is encountered. Raised with ERR_REMOTE_EXCEPTION when java.rmi.RemoteException exception is encountered. Raised with ERR_OC_SUPPLIER_ERROR when javax.ejb.FinderException exception is encountered.
      • setOrderCreateStoreData

        public boolean setOrderCreateStoreData()
                                        throws ECException
        This method gets all the store data for the WebSphere Commerce OrderCreateFixFormat message.
        Returns:
        true if no exception was encountered; false otherwise.
        Throws:
        ECException - raised with: ERR_CREATE_EXCEPTION when javax.ejb.CreateException exception is encountered. ERR_GENERIC when javax.naming.NamingException exception is encountered. ERR_REMOTE_EXCEPTION when java.rmi.RemoteException exception is encountered. ERR_OC_SUPPLIER_ERROR when javax.ejb.FinderException exception is encountered.
      • setOrderNVPValues

        public boolean setOrderNVPValues()
        This method gets all the name-value pairs for the WebSphere Commerce OrderCreateFixFormat message.
        Returns:
        true if no exception was encountered; false otherwise.
      • setOrderRn

        public void setOrderRn(java.lang.Long anOrderRn)
        This method sets the order reference number used in the command.
        Specified by:
        setOrderRn in interface OrderMessagingCmd
        Parameters:
        anOrderRn - The order reference number.
      • setOrderMsg

        public void setOrderMsg(java.lang.StringBuffer anOrderMsg)
        This method sets the OrderCreateFixFormat message content.
        See Also:
        writeOrder()
      • setRequestProperties

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

        public boolean writeOrder()
        This method builds the WebSphere Commerce OrderCreateFixFormat message. This method must be overridden to call setOrderMsg(StringBuffer) if setOrderMsg(StringBuffer) is customized.
        Returns:
        true if no exception was encountered; false otherwise.
        See Also:
        setOrderMsg(StringBuffer)
      • setException

        public void setException(java.lang.Exception e)
        Sets the execution exception when it happens.
        Parameters:
        ex - The exception thrown when the logic of this class executes.