net.sourceforge.mflow.api
Interface Msg

All Known Implementing Classes:
MsgImpl

public interface Msg

This class models a generic message. Msg contains a set of attributes and a "content".

Version:
$Revision: 1.4 $
Author:
David Carr

Method Summary
 void addContentHandler(ContentHandler ch)
          Adds a new ContentHandler
 void addRecipient(ContactMethod cm)
          Add this recipient ContactMethod to the existing ones.
 void addRecipients(ContactMethod[] cms)
          Add these recipient ContactMethods to the existing ones.
 void addReplyTo(ContactMethod cm)
          Add this ContactMethod to be replied to
 ContentHandler[] getContentHandlers()
          Return the ContentHandlers for the content
 Contact[] getFrom()
          Get the sender(s).
 java.util.Date getReceivedDate()
          Get the Date this Msg was received.
 ContactMethod[] getRecipients()
          Get all the recipient ContactMethods for the Msg.
 ContactMethod[] getReplyTo()
          Get the ContactMethods to which replies should be directed.
 java.util.Date getSentDate()
          Get the Date this Msg was sent.
 java.lang.String getSubject()
          Get the subject of this Msg
 java.lang.String getText()
          Convenience method to get the content of the Msg as a String
 boolean isNew()
          Accessor for the "new" state
 boolean isUnread()
          Accessor for the unread state
 Msg reply(boolean replyToAll)
          Get a new Msg suitable for a reply to this message.
 void setContentHandler(ContentHandler ch)
          Sets a new ContentHandler
 void setContentHandlers(ContentHandler[] chs)
          Sets the content of the Msg
 void setFrom(Contact c)
          Set the "from" Contact for this Msg.
 void setFrom(Contact[] cs)
          Set the "from" Contact(s) for this Msg.
 void setNew(boolean isNew)
          Mutator for the "new" state
 void setReceivedDate(java.util.Date d)
          Set the received Date
 void setRecipient(ContactMethod cm)
          Set the recipient ContactMethod.
 void setRecipients(ContactMethod[] cms)
          Set these recipient ContactMethods.
 void setReplyTo(ContactMethod cm)
          Set the address to which replies should be directed.
 void setReplyTo(ContactMethod[] cms)
          Set the addresses to which replies should be directed.
 void setSentDate(java.util.Date d)
          Set the sent Date
 void setSubject(java.lang.String s)
          Set the subject
 void setText(java.lang.String body)
          Convenience method to set the content of the Msg to a String
 void setUnread(boolean isUnread)
          Mutator for the unread state
 

Method Detail

addRecipient

void addRecipient(ContactMethod cm)
Add this recipient ContactMethod to the existing ones.

Parameters:
cm - the recipient

addRecipients

void addRecipients(ContactMethod[] cms)
Add these recipient ContactMethods to the existing ones.

Parameters:
cms - the recipients

addReplyTo

void addReplyTo(ContactMethod cm)
Add this ContactMethod to be replied to

Parameters:
cm - the reply ContactMethod

getRecipients

ContactMethod[] getRecipients()
Get all the recipient ContactMethods for the Msg.

Returns:
an array of the recipients for this Msg

getContentHandlers

ContentHandler[] getContentHandlers()
Return the ContentHandlers for the content

Returns:
the ContentHandlers for the content

getFrom

Contact[] getFrom()
Get the sender(s).

Returns:
the sender(s) of this Msg.

getReceivedDate

java.util.Date getReceivedDate()
Get the Date this Msg was received.

Returns:
the Date this Msg was received, or null if it wasn't received

getReplyTo

ContactMethod[] getReplyTo()
Get the ContactMethods to which replies should be directed. This will usually be the sender of the message, but some messages may direct replies to a different ContactMethod.

Returns:
an array of the ContactMethods to which replies to this Msg should be directed

getSentDate

java.util.Date getSentDate()
Get the Date this Msg was sent.

Returns:
the Date this Msg was sent, or null if it wasn't sent

getSubject

java.lang.String getSubject()
Get the subject of this Msg

Returns:
the subject of this Msg

reply

Msg reply(boolean replyToAll)

Get a new Msg suitable for a reply to this message. The new Msg will have its attributes set up appropriately. Note that this new Msg object will be empty, that is, it will not have a "content". These will have to be suitably filled in by the client.

If replyToAll is set, the new Msg will be addressed to all recipients of this message. Otherwise, the reply will be addressed to only the sender of this message (using the value of the getReplyTo method).

The "Subject" field is filled in with the original subject prefixed with "Re: " (unless it already starts with "Re:" (case insensitive)).

Parameters:
replyToAll - whether to reply to all recipients of the original message, or just the reply-to ContactMethods
Returns:
a message to use for the reply

addContentHandler

void addContentHandler(ContentHandler ch)
Adds a new ContentHandler

Parameters:
ch - the new ContentHandler

setContentHandler

void setContentHandler(ContentHandler ch)
Sets a new ContentHandler

Parameters:
ch - the new ContentHandler

setContentHandlers

void setContentHandlers(ContentHandler[] chs)
Sets the content of the Msg

Parameters:
chs - the new ContentHandlers

setFrom

void setFrom(Contact c)
Set the "from" Contact for this Msg.

Parameters:
c - the Contact for the sender

setFrom

void setFrom(Contact[] cs)
Set the "from" Contact(s) for this Msg.

Parameters:
cs - the new sender Contact(s)

setReceivedDate

void setReceivedDate(java.util.Date d)
Set the received Date

Parameters:
d - the Date the Msg was received

setRecipient

void setRecipient(ContactMethod cm)
Set the recipient ContactMethod. All ContactMethodare replaced by the ContactMethod parameter.

Parameters:
cm - the recipient

setRecipients

void setRecipients(ContactMethod[] cms)
Set these recipient ContactMethods. Eliminates all previous recipients.

Parameters:
cms - the recipients

setReplyTo

void setReplyTo(ContactMethod cm)
Set the address to which replies should be directed.

Parameters:
cm - the reply ContactMethod

setReplyTo

void setReplyTo(ContactMethod[] cms)
Set the addresses to which replies should be directed. (Normally only a single address will be specified.)

Parameters:
cms - the reply ContactMethods

setSentDate

void setSentDate(java.util.Date d)
Set the sent Date

Parameters:
d - the Date the Msg was sent

setSubject

void setSubject(java.lang.String s)
Set the subject

Parameters:
s - the subject

getText

java.lang.String getText()
Convenience method to get the content of the Msg as a String

Returns:
a String content

setText

void setText(java.lang.String body)
Convenience method to set the content of the Msg to a String

Parameters:
body - the text to set as the content

setUnread

void setUnread(boolean isUnread)
Mutator for the unread state

Parameters:
isUnread - whether the Msg has not been read

setNew

void setNew(boolean isNew)
Mutator for the "new" state

Parameters:
isNew - whether the Msg is "new"

isUnread

boolean isUnread()
Accessor for the unread state

Returns:
whether the Msg has not been read

isNew

boolean isNew()
Accessor for the "new" state

Returns:
whether the Msg is "new"


Copyright © 2002-2004 MFlow Group. All Rights Reserved.