com.ibm.commerce.messaging.outboundservice
Class Messaging

java.lang.Object
  |
  +--com.ibm.commerce.messaging.outboundservice.Messaging
All Implemented Interfaces:
java.io.Serializable

public class Messaging
extends java.lang.Object
implements java.io.Serializable

The object that is responsible to creating the messages and sending the messages using CCF transports based on the specified configuration for the message types.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
           
 
Constructor Summary
Messaging(java.lang.Integer msgty, java.lang.Integer store)
          Messaging constructor.
Messaging(java.lang.Integer msgty, java.lang.Integer store, java.lang.Integer priority)
          Messaging constructor.
 
Method Summary
 void addContentPart(byte[] part)
          This method adds a content part to the message content
 void addContentPart(byte[] part, java.lang.String name, java.lang.String type)
          This method adds a content part to the message content
 void addMember(java.lang.Long memb)
          This method sets the internal member vector with the single parameter.
 int addMemberGroup(java.lang.Long mbrgrp)
          This method sets the internal member vector with the member group parameter.
 void addSecureMember(java.lang.Long memb)
          This method sets the internal securemember vector with the single parameter.
 void addStore(java.lang.Integer astore_id)
          Add a store to send the message on behalf of.
 void clearMember()
          Removes all members from our internal recipient list.
 void compose(java.lang.String view, CommandContext comContext, TypedProperty inparms)
          This method will interface with the JSP's for each transport and return the message content to the content field.
 java.lang.String getConfigData(java.lang.String name)
          This method will return the first value found for given key.
 byte[] getContent(java.lang.Integer transport, java.lang.String language)
          This method is used by external users to get the content of a message from a particular transport.
 java.util.Vector getTransports()
          Gets the transports property (java.util.Vector) value.
 java.lang.String getUserData(java.lang.Integer transport, java.lang.String name)
          Returns the User Data attribute of the specified transport and attribute name.
static Messaging load(byte[] ser)
          This public method can be used by users of the Messaging System to deserialize a serialized Messaging Object
 int remTransport(java.lang.Integer transport)
          Removes the transport so the message will not be using the
 int sendImmediate()
          Sends the message immediately.
 byte[] sendReceiveImmediate()
          Sends the message immediately and waits for a response.
 long sendTransacted()
          Saves the message to the MSGSTORE table.
 int setConfigData(java.lang.String name, java.lang.String value)
          This method will insert a nvp into the configuration data of ALL transports that have the name as a key in their hashtable.
 int setContent(java.lang.Integer transport, java.lang.String language, byte[] content)
          This method will insert the content of a message directly for a particular transport
 void setPartialSend(java.lang.Boolean newPartialSend)
          Set the partial send flag.
 int setUserData(java.lang.Integer transport, java.lang.String name, java.lang.String value)
          Sets the User Data for the specified transport.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Constructor Detail

Messaging

public Messaging(java.lang.Integer msgty,
                 java.lang.Integer store)
          throws ECSystemException,
                 java.lang.NullPointerException
Messaging constructor. For the given key parameters, the constructor will access the messaging system tables and retrieve required information (based on the given priority level Information gathered : NVP's for CS, IS, misc , valid transports for key.
Parameters:
Integer - msgty - Message Type, part of the key used to access Admin information
Integer - store - Store, part of the key used to access Admin information

Messaging

public Messaging(java.lang.Integer msgty,
                 java.lang.Integer store,
                 java.lang.Integer priority)
          throws ECSystemException,
                 java.lang.NullPointerException
Messaging constructor. For the given key parameters, the constructor will access the messaging system tables and retrieve required information (based on the given priority level Information gathered : NVP's for CS, IS, misc , valid transports for key.
Parameters:
Integer - msgty - Message Type, part of the key used to access Admin information
Integer - store - Store, part of the key used to access Admin information
Integer - priority - Priority, used to filter table access
Method Detail

addContentPart

public void addContentPart(byte[] part)
This method adds a content part to the message content
Parameters:
The - content part to be added

addContentPart

public void addContentPart(byte[] part,
                           java.lang.String name,
                           java.lang.String type)
This method adds a content part to the message content
Parameters:
part: - The content part to be added
name: - The name of the part to be added (example filename)
type: - The type of the part (for example in javamail the mime type (text/plain)

addMember

public void addMember(java.lang.Long memb)
               throws ECSystemException
This method sets the internal member vector with the single parameter. It adds to any previous members.
Parameters:
mbrgrp - java.lang.Long The member group.

addMemberGroup

public int addMemberGroup(java.lang.Long mbrgrp)
                   throws ECSystemException
This method sets the internal member vector with the member group parameter. Because the members in a member group can be member groups themselves, this method must perform a thorough explosion of the members. It adds to any previous members.
Parameters:
mbrgrp - java.lang.Long The member group.
Returns:
int The return code.

addSecureMember

public void addSecureMember(java.lang.Long memb)
                     throws ECSystemException
This method sets the internal securemember vector with the single parameter. It adds to any previous members.
Parameters:
mbrgrp - java.lang.Long The member group. Creation date: (25/09/01 4:35:47 PM)
memid - long
Throws:
ECSystemException - The exception description.

addStore

public void addStore(java.lang.Integer astore_id)
              throws ECSystemException
Add a store to send the message on behalf of.
Parameters:
astore_id - java.lang.Long
Throws:
ECSystemException - The exception description.

clearMember

public void clearMember()
Removes all members from our internal recipient list.

compose

public void compose(java.lang.String view,
                    CommandContext comContext,
                    TypedProperty inparms)
             throws ECSystemException
This method will interface with the JSP's for each transport and return the message content to the content field.
Parameters:
view - java.lang.String
commandContext - com.ibm.commerce.command.CommandContext
requestProperties - com.ibm.commerce.datatype.TypedProperty.

getConfigData

public java.lang.String getConfigData(java.lang.String name)
                               throws ECSystemException
This method will return the first value found for given key. It searches through the hash tables of all transports
Parameters:
name - java.lang.String The attribute name.
Returns:
java.lang.String The attribute value

getContent

public byte[] getContent(java.lang.Integer transport,
                         java.lang.String language)
                  throws ECSystemException
This method is used by external users to get the content of a message from a particular transport.
Parameters:
transport - java.lang.Integer The transport.
language - java.lang.String The language.
Returns:
byte[] The content of the message.

getTransports

public java.util.Vector getTransports()
Gets the transports property (java.util.Vector) value.
Returns:
The transports property value.
See Also:
#setTransports

getUserData

public java.lang.String getUserData(java.lang.Integer transport,
                                    java.lang.String name)
                             throws ECSystemException
Returns the User Data attribute of the specified transport and attribute name.
Parameters:
transport - java.lang.Integer The transport.
name - java.lang.String The attribute name.
Returns:
java.lang.String The attribute value.

load

public static Messaging load(byte[] ser)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException
This public method can be used by users of the Messaging System to deserialize a serialized Messaging Object
Parameters:
serString - - a String representing

remTransport

public int remTransport(java.lang.Integer transport)
Removes the transport so the message will not be using the
Parameters:
transport - java.lang.Integer The transport to remove.
Returns:
int The return code.

sendImmediate

public int sendImmediate()
                  throws ECSystemException
Sends the message immediately.
Returns:
int The return code.

sendReceiveImmediate

public byte[] sendReceiveImmediate()
                            throws ECSystemException
Sends the message immediately and waits for a response.
Returns:
byte[] The response in bytes.

sendTransacted

public long sendTransacted()
                    throws ECSystemException
Saves the message to the MSGSTORE table.
Returns:
long The number of bytes saved.

setConfigData

public int setConfigData(java.lang.String name,
                         java.lang.String value)
                  throws ECSystemException
This method will insert a nvp into the configuration data of ALL transports that have the name as a key in their hashtable. The name must already exist or an exception will be returned.
Parameters:
name - java.lang.String The attribute name.
value - java.lang.String The attribute value.
Returns:
int The return code.

setContent

public int setContent(java.lang.Integer transport,
                      java.lang.String language,
                      byte[] content)
This method will insert the content of a message directly for a particular transport
Parameters:
transport - java.lang.Integer The Transport.
language - java.lang.String The language.
content - byte[] The content.
Returns:
int The return code of the method.

setPartialSend

public void setPartialSend(java.lang.Boolean newPartialSend)
Set the partial send flag.
Parameters:
newSendPartial - boolean

setUserData

public int setUserData(java.lang.Integer transport,
                       java.lang.String name,
                       java.lang.String value)
                throws ECSystemException
Sets the User Data for the specified transport.
Parameters:
transport - java.lang.Integer The transport.
name - java.lang.String The attribute name.
value - java.lang.String The attribute value.
Returns:
int Return code whether the method executed successfully.