Sun Adapter for e-Mail API

com.stc.connector.emailadapter.appconn
Class EmailMessage

java.lang.Object
  extended by com.stc.connector.emailadapter.appconn.EmailMessage
All Implemented Interfaces:
com.stc.connector.persistence.bpel.PersistableData

public class EmailMessage
extends java.lang.Object
implements com.stc.connector.persistence.bpel.PersistableData

Email message class which encapsulates the message for sending and receiving email message(s).

Version:
$Version$
Author:
$Author: chuang $

Field Summary
protected  java.util.ArrayList _AttachmentFile
           
protected  java.util.ArrayList _Bcc
           
protected  java.util.ArrayList _Cc
           
protected  java.lang.String _CharSet
           
protected  EmailAddress _From
           
protected  java.lang.String _MsgHTML
           
protected  java.lang.String _MsgText
           
protected  EmailAddress _ReplyTo
           
protected  java.lang.String _Subject
           
protected  java.util.ArrayList _To
           
 
Constructor Summary
EmailMessage()
          Creates new EmailMessage
 
Method Summary
 void addAttachment(EmailAttachment value)
          Adds an EmailAttachment to the EmailAttachment collection.
 void addAttachment(int index, EmailAttachment value)
          Adds an EmailAttachment to the EmailAttachment collection at index i.
 void addBcc(EmailAddress value)
          Adds an EmailAddress to the BCC EmailAddress collection.
 void addBcc(int index, EmailAddress value)
          Adds an EmailAddress to the BCC EmailAddress collection at index i.
 void addCc(EmailAddress value)
          Adds an EmailAddress to the CC EmailAddress collection.
 void addCc(int index, EmailAddress value)
          Adds an EmailAddress to the CC EmailAddress collection at index i.
 void addTo(EmailAddress value)
          Adds an EmailAddress to the To EmailAddress collection.
 void addTo(int index, EmailAddress value)
          Adds an EmailAddress to the To EmailAddress collection at index i.
 void clearAttachment()
          Clears the EmailAttachment collection.
 void clearBcc()
          Clears the BCC EmailAddress collection.
 void clearCc()
          Clears the CC EmailAddress collection.
 void clearTo()
          Clears the To EmailAddress collection.
 int countAttachment()
          Return the size of the EmailAttachment collection.
 int countBcc()
          Return the size of BCC EmailAddress collection.
 int countCc()
          Return the size of CC EmailAddress collection.
 int countTo()
          Return the size of To EmailAddress collection.
 EmailAttachment[] getAttachment()
          Get the EmailAttachment collection as an array of EmailAttachment.
 EmailAttachment getAttachment(int i)
          Get the EmailAttachment at index i.
 EmailAddress[] getBcc()
          Get the BCC EmailAddress collection as an array of EmailAddress.
 EmailAddress getBcc(int i)
          Get the BCC EmailAddress at index i.
 EmailAddress[] getCc()
          Get the CC EmailAddress collection as an array of EmailAddress.
 EmailAddress getCc(int i)
          Get the CC EmailAddress at index i.
 java.lang.String getCharSet()
          Deprecated. This method has been deprecated and exception will be thrown; Set the encoding in the configuration.
 EmailAddress getFrom()
          Gets the EmailAddress of the sender.
 java.lang.String getMsgHTML()
          Gets the html message of the email message body.
 java.lang.String getMsgText()
          Gets the text message of the email message body.
 EmailAddress getReplyTo()
          Gets the EmailAddress of the ReplyTo.
 java.lang.String getSubject()
          Gets the subject of the email message.
 EmailAddress[] getTo()
          Get the To EmailAddress collection as an array of EmailAddress.
 EmailAddress getTo(int i)
          Get the To EmailAddress at index i.
protected  void initialize()
          Initialize the internal state of the message.
 void persist(com.stc.connector.persistence.bpel.DataOutput dout)
          Persists (serialize) this message.
 void removeAttachment(int index)
          Removes the EmailAttachment at index i.
 void removeBcc(int index)
          Removes the BCC EmailAddress at index i.
 void removeCc(int index)
          Removes the CC EmailAddress at index i.
 void removeTo(int index)
          Removes the To EmailAddress at index i.
protected  void reset()
           
 void restore(com.stc.connector.persistence.bpel.DataInput din)
          Restore (deserialize) this message.
 void setAttachment(EmailAttachment[] val)
          Sets the EmailAttachment collection.
 void setAttachment(int i, EmailAttachment val)
          Sets the EmailAttachment at index i in the collection.
 void setBcc(EmailAddress[] val)
          Sets the BCC EmailAddress collection.
 void setBcc(int i, EmailAddress val)
          Sets the BCC EmailAddress at index i in the collection.
 void setCc(EmailAddress[] val)
          Sets the CC EmailAddress collection.
 void setCc(int i, EmailAddress val)
          Sets the CC EmailAddress at index i in the collection.
 void setCharSet(java.lang.String val)
          Deprecated. This method has been deprecated and exception will be thrown; Set the encoding in the configuration.
 void setMsgHTML(java.lang.String val)
          Sets the html message of the email message body.
 void setMsgText(java.lang.String val)
          Sets the text message of the email message body.
 void setSubject(java.lang.String val)
          Sets the subject of the email message.
 void setTo(EmailAddress[] val)
          Sets the To EmailAddress collection.
 void setTo(int i, EmailAddress val)
          Sets the To EmailAddress at index i in the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_To

protected java.util.ArrayList _To

_Cc

protected java.util.ArrayList _Cc

_Bcc

protected java.util.ArrayList _Bcc

_From

protected EmailAddress _From

_ReplyTo

protected EmailAddress _ReplyTo

_Subject

protected java.lang.String _Subject

_MsgText

protected java.lang.String _MsgText

_MsgHTML

protected java.lang.String _MsgHTML

_CharSet

protected java.lang.String _CharSet

_AttachmentFile

protected java.util.ArrayList _AttachmentFile
Constructor Detail

EmailMessage

public EmailMessage()
Creates new EmailMessage

Method Detail

initialize

protected void initialize()
Initialize the internal state of the message.


reset

protected void reset()

getTo

public EmailAddress getTo(int i)
Get the To EmailAddress at index i.

Parameters:
i - Index.
Returns:
The To EmailAddress instance at index i.

getTo

public EmailAddress[] getTo()
Get the To EmailAddress collection as an array of EmailAddress.

Returns:
An array of EmailAddress.

countTo

public int countTo()
Return the size of To EmailAddress collection.

Returns:
The size of the To EmailAddress collection.

setTo

public void setTo(int i,
                  EmailAddress val)
Sets the To EmailAddress at index i in the collection.

Parameters:
i - Index.
val - The EmailAddress to set.

setTo

public void setTo(EmailAddress[] val)
Sets the To EmailAddress collection.

Parameters:
val - An array of EmailAddress.

removeTo

public void removeTo(int index)
Removes the To EmailAddress at index i.

Parameters:
i - Index.

addTo

public void addTo(EmailAddress value)
Adds an EmailAddress to the To EmailAddress collection.

Parameters:
value - The EmailAddress to add.

addTo

public void addTo(int index,
                  EmailAddress value)
Adds an EmailAddress to the To EmailAddress collection at index i.

Parameters:
i - The index.
value - The EmailAddress to add.

clearTo

public void clearTo()
Clears the To EmailAddress collection.


getCc

public EmailAddress getCc(int i)
Get the CC EmailAddress at index i.

Parameters:
i - Index.
Returns:
The CC EmailAddress instance at index i.

getCc

public EmailAddress[] getCc()
Get the CC EmailAddress collection as an array of EmailAddress.

Returns:
An array of EmailAddress.

countCc

public int countCc()
Return the size of CC EmailAddress collection.

Returns:
The size of the CC EmailAddress collection.

setCc

public void setCc(int i,
                  EmailAddress val)
Sets the CC EmailAddress at index i in the collection.

Parameters:
i - Index.
val - The EmailAddress to set.

setCc

public void setCc(EmailAddress[] val)
Sets the CC EmailAddress collection.

Parameters:
val - An array of EmailAddress.

removeCc

public void removeCc(int index)
Removes the CC EmailAddress at index i.

Parameters:
i - Index.

addCc

public void addCc(EmailAddress value)
Adds an EmailAddress to the CC EmailAddress collection.

Parameters:
value - The EmailAddress to add.

addCc

public void addCc(int index,
                  EmailAddress value)
Adds an EmailAddress to the CC EmailAddress collection at index i.

Parameters:
i - The index.
value - The EmailAddress to add.

clearCc

public void clearCc()
Clears the CC EmailAddress collection.


getBcc

public EmailAddress getBcc(int i)
Get the BCC EmailAddress at index i.

Parameters:
i - Index.
Returns:
The CC EmailAddress instance at index i.

getBcc

public EmailAddress[] getBcc()
Get the BCC EmailAddress collection as an array of EmailAddress.

Returns:
An array of EmailAddress.

countBcc

public int countBcc()
Return the size of BCC EmailAddress collection.

Returns:
The size of the BCC EmailAddress collection.

setBcc

public void setBcc(int i,
                   EmailAddress val)
Sets the BCC EmailAddress at index i in the collection.

Parameters:
i - Index.
val - The EmailAddress to set.

setBcc

public void setBcc(EmailAddress[] val)
Sets the BCC EmailAddress collection.

Parameters:
val - An array of EmailAddress.

removeBcc

public void removeBcc(int index)
Removes the BCC EmailAddress at index i.

Parameters:
i - Index.

addBcc

public void addBcc(EmailAddress value)
Adds an EmailAddress to the BCC EmailAddress collection.

Parameters:
value - The EmailAddress to add.

addBcc

public void addBcc(int index,
                   EmailAddress value)
Adds an EmailAddress to the BCC EmailAddress collection at index i.

Parameters:
i - The index.
value - The EmailAddress to add.

clearBcc

public void clearBcc()
Clears the BCC EmailAddress collection.


getFrom

public EmailAddress getFrom()
Gets the EmailAddress of the sender.

Returns:
The EmailAddress of the sender.

getReplyTo

public EmailAddress getReplyTo()
Gets the EmailAddress of the ReplyTo.

Returns:
The EmailAddress of the ReplyTo.

getSubject

public java.lang.String getSubject()
Gets the subject of the email message.

Returns:
The subject of the email message.

setSubject

public void setSubject(java.lang.String val)
Sets the subject of the email message.

Parameters:
val - The subject of the email message.

getMsgText

public java.lang.String getMsgText()
Gets the text message of the email message body.

Returns:
The text message of the email message body.

setMsgText

public void setMsgText(java.lang.String val)
Sets the text message of the email message body.

Parameters:
val - The text message of the email message body.

getMsgHTML

public java.lang.String getMsgHTML()
Gets the html message of the email message body.

Returns:
The html message of the email message body.

setMsgHTML

public void setMsgHTML(java.lang.String val)
Sets the html message of the email message body.

Parameters:
val - The html message of the email message body.

getCharSet

public java.lang.String getCharSet()
                            throws java.lang.Exception
Deprecated. This method has been deprecated and exception will be thrown; Set the encoding in the configuration.

Gets the character set encoding.

Returns:
The character set encoding.
Throws:
java.lang.Exception

setCharSet

public void setCharSet(java.lang.String val)
                throws java.lang.Exception
Deprecated. This method has been deprecated and exception will be thrown; Set the encoding in the configuration.

Sets the character set encoding.

Parameters:
val - The character set encoding.
Throws:
java.lang.Exception

getAttachment

public EmailAttachment getAttachment(int i)
Get the EmailAttachment at index i.

Parameters:
i - Index.
Returns:
The attachment at index i.

getAttachment

public EmailAttachment[] getAttachment()
Get the EmailAttachment collection as an array of EmailAttachment.

Returns:
An array of EmailAttachment.

countAttachment

public int countAttachment()
Return the size of the EmailAttachment collection.

Returns:
The size of the attachment collection.

setAttachment

public void setAttachment(int i,
                          EmailAttachment val)
Sets the EmailAttachment at index i in the collection.

Parameters:
i - Index.
val - The EmailAttachment to set.

setAttachment

public void setAttachment(EmailAttachment[] val)
Sets the EmailAttachment collection.

Parameters:
val - An array of EmailAttachment.

removeAttachment

public void removeAttachment(int index)
Removes the EmailAttachment at index i.

Parameters:
i - Index.

addAttachment

public void addAttachment(EmailAttachment value)
Adds an EmailAttachment to the EmailAttachment collection.

Parameters:
value - The EmailAttachment to add.

addAttachment

public void addAttachment(int index,
                          EmailAttachment value)
Adds an EmailAttachment to the EmailAttachment collection at index i.

Parameters:
i - The index.
value - The EmailAttachment to add.

clearAttachment

public void clearAttachment()
Clears the EmailAttachment collection.


persist

public void persist(com.stc.connector.persistence.bpel.DataOutput dout)
             throws java.lang.Exception
Persists (serialize) this message.

Specified by:
persist in interface com.stc.connector.persistence.bpel.PersistableData
Parameters:
dout - The DataOutput to which the Java Bean message is persisted.
Throws:
java.lang.Exception - upon error.

restore

public void restore(com.stc.connector.persistence.bpel.DataInput din)
             throws java.lang.Exception
Restore (deserialize) this message.

Specified by:
restore in interface com.stc.connector.persistence.bpel.PersistableData
Parameters:
dis - The DataInput from which the Java Bean message is restored.
Throws:
java.lang.Exception - upon error.

Sun Adapter for e-Mail API