com.jthomas.mailfaces
Class Mailmsg

java.lang.Object
  |
  +--com.jthomas.mailfaces.Mailmsg

public class Mailmsg
extends java.lang.Object

Mailmsg contains the information and methods to handle a mailmsg contained in a Mailbox object. It contains the mail headers that were retrieved from the Mail server.

The mailmsg object is what is passed from component to component until it finally arrives in the queue for the display component that then displays the icon that reprecents this email message.

---------------------------------------------------------------------
  Simple Usage Example to display the subject of a message.

-  Mailmsg mailmsg = mailbox.getMailmsg(number);
-  System.out.println("Subject=" + mailmsg.getHeader("Subject");

 

Author:
John Thomas
Field Summary
protected  java.lang.String _TextContents
          Text message
static int ActionDelete
           
static int ActionDone
           
static int ActionDummy
           
static int ActionPiconDB
           
static int ActionPiconDBDefer
           
static int ActionRemove
           
static int ActionResolve
           
static int ActionResolveAfter
           
static int StatusNew
           
static int StatusOld
           
static int StatusUnknown
           
 
Constructor Summary
Mailmsg(int msgnum)
          Method: Mailmsg constructor This will just create the object.
 
Method Summary
 int getAction()
           
 java.lang.String getAudioURL()
           
 java.lang.String getCopyAddress()
           
 boolean getDeleteFlag()
           
 Face getFace()
           
 java.lang.String getHeader(java.lang.String type)
          This will return the specified Header line
 java.lang.String[] getHeaders()
          getHeaders return the complete set of Headers from the Hashtable that results from parsing the array of header lines
 java.lang.String getImageURL()
           
 java.lang.String getKey()
          returns a Key that will be used to access this mail message If the mailmsg has a _Msgid value, then it is used.
 boolean getKillCandidate()
           
 javax.mail.Message getMessage()
           
 int getMsgNum()
          getMsgNum Get the message number for this email
 java.lang.String getPiconImageURL()
           
 int getServerStatus()
           
 int getSize()
           
 boolean getSMS()
           
 boolean getSMSCopy()
           
 java.lang.String getText()
           
 boolean isBuildIcon()
           
static java.lang.String[] parseNetworkAddress(java.lang.String address)
          Static class method to parse a Network mail address and return an array containing {userid,host,fullname} 0: Userid 1: Host 2: Name (if present) Examples: John Q Public -> [jpublic] [netcom.com] [John Q.
 void putHeader(java.lang.String type, java.lang.String value)
          Method: putHeader(String type, String value) This will save the value of the specified header into a Hashtable
 void setAction(int code)
          setAction(int ActionCode) getAction() Set and query the action status of this message
 void setAudioURL(java.lang.String audioURL)
           
 void setBuildIcon(boolean setting)
          setBuildIcon isBuildIcon set/get methods for flag that controls whether we build a special icon using the From: header.
 void setCopyAddress(java.lang.String address)
           
 void setDeleteFlag(boolean flag)
           
 void setFace(Face face)
          Method: setFace Method: getFace
 void setImageURL(java.lang.String imageURL)
          setImageURL setAudioURL Set the URL for an image to associate with this mailmsg getImageURL getAudioURL Report the URL for the image or audio file
 void setKey(java.lang.String key)
          setKey Set the Key used to store this message
 void setKillCandidate(boolean flag)
          setKillCandidate Set a flag that this mail message was match by a KillSelect statement getKillCandidate Report the setting of the KillCandicate flag.
 void setMessage(javax.mail.Message jMessage)
          get/setMessage Set the reference to the JavaMail Message object This will be null if JavaMail is not used as the FaceMailbox implementation.
 void setPiconImageURL(java.lang.String imageURL)
          setPiconImageURL setAudioURL Set the URL for an image to associate with this mailmsg getPiconImageURL getAudioURL Report the URL for the image or audio file
 void setServerStatus(int code)
          setServerStatus(int ActionCode) getServerStatus() Set and query the Server Status of this message
 void setSize(int size)
          setSize getSize Set and query the size of the message in bytes
 void setSMS(boolean onOff)
          setSMS getSMS Set and query an indicator that an SMS message should be sent for this email
 void setSMSCopy(boolean onOff)
          setSMSCopy getSMSCopy Set and query an indicator that the email should be copied also.
 void setText(java.lang.String text)
          get/setText Get and set the contents of the Mail message
 java.lang.String toString()
          toString method to display the idendification of a MailMsg object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_TextContents

protected java.lang.String _TextContents
Text message


ActionDone

public static final int ActionDone
See Also:
Constant Field Values

ActionDelete

public static final int ActionDelete
See Also:
Constant Field Values

ActionRemove

public static final int ActionRemove
See Also:
Constant Field Values

ActionResolve

public static final int ActionResolve
See Also:
Constant Field Values

ActionResolveAfter

public static final int ActionResolveAfter
See Also:
Constant Field Values

ActionPiconDB

public static final int ActionPiconDB
See Also:
Constant Field Values

ActionPiconDBDefer

public static final int ActionPiconDBDefer
See Also:
Constant Field Values

ActionDummy

public static final int ActionDummy
See Also:
Constant Field Values

StatusUnknown

public static final int StatusUnknown
See Also:
Constant Field Values

StatusOld

public static final int StatusOld
See Also:
Constant Field Values

StatusNew

public static final int StatusNew
See Also:
Constant Field Values
Constructor Detail

Mailmsg

public Mailmsg(int msgnum)
Method: Mailmsg constructor This will just create the object. No work is done

Method Detail

putHeader

public void putHeader(java.lang.String type,
                      java.lang.String value)
Method: putHeader(String type, String value) This will save the value of the specified header into a Hashtable


getHeader

public java.lang.String getHeader(java.lang.String type)
This will return the specified Header line

Returns:
String HeaderLine ("" if headerline not present)

setKey

public void setKey(java.lang.String key)
setKey Set the Key used to store this message


getKey

public java.lang.String getKey()
returns a Key that will be used to access this mail message If the mailmsg has a _Msgid value, then it is used. otherwise email is checked for a "Message-ID" header and if found then it is used If neither UIDL or MessageID is present then the message number is used.

Returns:
key to use to store and access this email message

setAction

public void setAction(int code)
setAction(int ActionCode) getAction() Set and query the action status of this message


getAction

public int getAction()

setServerStatus

public void setServerStatus(int code)
setServerStatus(int ActionCode) getServerStatus() Set and query the Server Status of this message


getServerStatus

public int getServerStatus()

setSize

public void setSize(int size)
setSize getSize Set and query the size of the message in bytes


getSize

public int getSize()

setSMS

public void setSMS(boolean onOff)
setSMS getSMS Set and query an indicator that an SMS message should be sent for this email


getSMS

public boolean getSMS()

setSMSCopy

public void setSMSCopy(boolean onOff)
setSMSCopy getSMSCopy Set and query an indicator that the email should be copied also.


getSMSCopy

public boolean getSMSCopy()

getMsgNum

public int getMsgNum()
getMsgNum Get the message number for this email


setMessage

public void setMessage(javax.mail.Message jMessage)
get/setMessage Set the reference to the JavaMail Message object This will be null if JavaMail is not used as the FaceMailbox implementation.


getMessage

public javax.mail.Message getMessage()

setText

public void setText(java.lang.String text)
get/setText Get and set the contents of the Mail message


getText

public java.lang.String getText()

getHeaders

public java.lang.String[] getHeaders()
getHeaders return the complete set of Headers from the Hashtable that results from parsing the array of header lines


setCopyAddress

public void setCopyAddress(java.lang.String address)

getCopyAddress

public java.lang.String getCopyAddress()

setDeleteFlag

public void setDeleteFlag(boolean flag)

getDeleteFlag

public boolean getDeleteFlag()

setKillCandidate

public void setKillCandidate(boolean flag)
setKillCandidate Set a flag that this mail message was match by a KillSelect statement getKillCandidate Report the setting of the KillCandicate flag.


getKillCandidate

public boolean getKillCandidate()

setImageURL

public void setImageURL(java.lang.String imageURL)
setImageURL setAudioURL Set the URL for an image to associate with this mailmsg getImageURL getAudioURL Report the URL for the image or audio file


getImageURL

public java.lang.String getImageURL()

setPiconImageURL

public void setPiconImageURL(java.lang.String imageURL)
setPiconImageURL setAudioURL Set the URL for an image to associate with this mailmsg getPiconImageURL getAudioURL Report the URL for the image or audio file


getPiconImageURL

public java.lang.String getPiconImageURL()

setAudioURL

public void setAudioURL(java.lang.String audioURL)

getAudioURL

public java.lang.String getAudioURL()

setFace

public void setFace(Face face)
Method: setFace Method: getFace


getFace

public Face getFace()

setBuildIcon

public void setBuildIcon(boolean setting)
setBuildIcon isBuildIcon set/get methods for flag that controls whether we build a special icon using the From: header.


isBuildIcon

public boolean isBuildIcon()

parseNetworkAddress

public static java.lang.String[] parseNetworkAddress(java.lang.String address)
Static class method to parse a Network mail address and return an array containing {userid,host,fullname} 0: Userid 1: Host 2: Name (if present) Examples: John Q Public -> [jpublic] [netcom.com] [John Q. Public] jpublic@netcom.com (John Q Public) -> [jpublic] [netcom.com] [John Q. Public]

Returns:
It will return an array of strings.

toString

public java.lang.String toString()
toString method to display the idendification of a MailMsg object.

Overrides:
toString in class java.lang.Object
Returns:
It will return a string representing the Mailmsg.