com.ibm.commerce.messaging.commands

Class SendMsgCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, SendMsgCmd, 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 SendMsgCmdImpl
    extends TaskCommandImpl
    implements SendMsgCmd
    The outbound messaging system interface implementation, a task command to use the messaging system object.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

      • SendMsgCmdImpl

        public SendMsgCmdImpl()
    • Method Detail

      • addContentPart

        public void addContentPart(byte[] aMsgContentPart)
        This method adds attachments to an e-mail message.
        Specified by:
        addContentPart in interface SendMsgCmd
        Parameters:
        aMsgContentPart - The attachment (in byte array) to be added to the message.
      • addContentPart

        public void addContentPart(byte[] aMsgContentPart,
                                   java.lang.String aMsgContentPartName,
                                   java.lang.String aMsgContentPartType)
        This method adds attachments to an e-mail message.
        Specified by:
        addContentPart in interface SendMsgCmd
        Parameters:
        aMsgContentPart - The attachment (in byte array) to be added to the message.
        aMsgContentPartName - The name to be used for this attachment.
        aMsgContentPartType - The content type of the part being sent For instance, in Mime e-mail, this could be 'text/plain'.
      • addMember

        public void addMember(java.lang.Long aMember)
        This method adds member information to get recipient data.
        Specified by:
        addMember in interface SendMsgCmd
        Parameters:
        aMember - The member ID of a recipient.
      • addMemberGroup

        public void addMemberGroup(java.lang.Long aMemberGroup)
        This method adds member group information to get recipient data. By default, this method will add all members (both implicit and explicit) to the recipient list.
        Specified by:
        addMemberGroup in interface SendMsgCmd
        Parameters:
        aMemberGroup - The member group ID.
      • addSecureMember

        public void addSecureMember(java.lang.Long aMember)
        This method adds secure member ID to get recipient data. The information used is hidden from the rest of recipients if there is any.
        Specified by:
        addSecureMember in interface SendMsgCmd
        Parameters:
        aMember - The secure member ID.
      • addStore

        public void addStore(java.lang.Integer astore_id)
        This method adds a store.
        Specified by:
        addStore in interface SendMsgCmd
        Parameters:
        astore_id - The store ID.
      • compose

        public void compose(java.lang.String aView,
                            CommandContext aCommandContext,
                            TypedProperty aParms)
        This method provides message composition services through the use of JSP templates.
        Specified by:
        compose in interface SendMsgCmd
        Parameters:
        aView - The view name used for composing the message. It can be found in VIEWREG table.
        aCommandContext - The context of this command execution.
        aParms - The parameter list used to generate the message.
      • getContent

        public byte[] getContent(java.lang.Integer transport,
                                 java.lang.String language)
                          throws ECSystemException
        This method gets content of the message by the transport ID and language ID.
        Specified by:
        getContent in interface SendMsgCmd
        Parameters:
        transport - The transport ID.
        language - The language ID of the language preference.
        Returns:
        byte[]
        Throws:
        ECSystemException
      • getMsgTypeName

        public java.lang.String getMsgTypeName()
        This method returns the name of the message type.
        Returns:
        The name of the message type.
      • getResult

        public byte[] getResult()
        This method returns the result of a sendReceive sending operation. This method should be called AFTER the execute for the command is called.
        Specified by:
        getResult in interface SendMsgCmd
        Returns:
        The byte array of the response message.
      • 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.
      • performExecute

        public void performExecute()
                            throws ECException
        The business logic for this controller command. This default implementation simply calls checkParameters. Command writers who override this method should do a super() as the first line in their method if they want checkParameters to be called. It calls all the necessary steps to execute the messaging system services.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException - Raised with ERR_CMD_BAD_PROCESS_CMD message when an exception is encountered.
      • remTransport

        public void remTransport(java.lang.Integer aRemoveTransportID)
        This method allows the user to have transport(s) removed. It calls setRemoveTransportID.
        Specified by:
        remTransport in interface SendMsgCmd
        Parameters:
        aRemoveTransportID - The unwanted transport ID.
      • sendImmediate

        public void sendImmediate()
        This method sets the sending mode to send the message immediately to the recipients.
        Specified by:
        sendImmediate in interface SendMsgCmd
      • sendReceiveImmediate

        public void sendReceiveImmediate()
        This method sets the sending mode to send the message and wait for a reply.
        Specified by:
        sendReceiveImmediate in interface SendMsgCmd
      • sendTransacted

        public void sendTransacted()
        This method sets the sending mode such that it sends the message in transacted mode. This set will store the message in the MSGSTORE table and let the scheduler batch job send the messages at predetermined time intervals. The advantage of doing so is to avoid sending the message if the caller of this command encounters an exception after calling this command.
        Specified by:
        sendTransacted in interface SendMsgCmd
      • setConfigData

        public void setConfigData(java.lang.String aKey,
                                  java.lang.String aValue)
        This method allows the user to configure the parameters of transport services used for the message.
        Specified by:
        setConfigData in interface SendMsgCmd
        Parameters:
        aKey - The name of the parameter.
        aValue - The value of the parameter.
      • setConfigNLData

        public void setConfigNLData(java.lang.String aKey,
                                    java.lang.String aLanguage,
                                    java.lang.String aValue)
        This method allows the user to configure national language specific parameters of transport services used for the message.
        Specified by:
        setConfigNLData in interface SendMsgCmd
        Parameters:
        aKey - The name of the parameter.
        aLanguage - The language ID.
        aValue - The value of the parameter.
      • setContent

        public void setContent(java.lang.Integer aTransportID,
                               java.lang.String aLanguageID,
                               byte[] aMsgContent)
        This method allows a user to set the content body of a message using byte[] format. It calls setMsgContent(byte[]).
        Specified by:
        setContent in interface SendMsgCmd
        Parameters:
        aTransportID - The transport used in this command.
        aLanguageID - The language ID of language preference of the message content.
        aMsgContent - The message content in byte array format.
      • setContent

        public void setContent(java.lang.Integer aTransportID,
                               java.lang.String aLanguageID,
                               java.lang.String aMsgContent)
                        throws ECSystemException
        This method allows a user to set the content body of a message using String format. It converts the String object to UTF-8 format and calls setMsgContent(byte[]).
        Specified by:
        setContent in interface SendMsgCmd
        Parameters:
        aTransportID - The transport used in this command.
        aLanguageID - The language ID of language preference of the message content.
        aMsgContent - The message content in String format.
        Throws:
        ECSystemException
      • setMsgType

        public void setMsgType(java.lang.Integer aMsgType)
        Deprecated. This method is replaced by setMsgType(java.lang.String).
        This method sets the message type required to initialize the messaging system.
        Specified by:
        setMsgType in interface SendMsgCmd
        Parameters:
        aMsgType - The message type identifier used for this command.
      • setMsgType

        public void setMsgType(java.lang.String aMsgType)
        This method sets the message type required to initialize the messaging system.
        Specified by:
        setMsgType in interface SendMsgCmd
        Parameters:
        aMsgType - The message type name used for this command.
      • setPartialSend

        public void setPartialSend(java.lang.Boolean aPartialSendFlag)
        This method allows partial sends when using e-mail as transport.
        Specified by:
        setPartialSend in interface SendMsgCmd
        Parameters:
        aPartialSendFlag - The boolean indicating if the e-mail can be sent to a subset of targeted recipients. If it is false, an exception will be thrown if the SendFailedException happened when the message was sent to one of the targeted recipients.
      • setPriority

        public void setPriority(java.lang.Integer aPriority)
        This method sets the priority which can be used when initializing the messaging system.
        Specified by:
        setPriority in interface SendMsgCmd
        Parameters:
        aPriority - The priority used to send the message.
      • setStoreID

        public void setStoreID(java.lang.Integer aStoreID)
        This method sets the store ID required to initialize the messaging system.
        Specified by:
        setStoreID in interface SendMsgCmd
        Parameters:
        aStoreID - The store ID used by the command.