org.jasig.portlet.emailpreview
Class EmailMessage

java.lang.Object
  extended by org.jasig.portlet.emailpreview.EmailMessage

public final class EmailMessage
extends Object

An entity abstraction for representing information related to an email message.

Version:
$Revision$
Author:
Andreas Christoforides, Jen Bourey, jbourey@unicon.net, Drew Wills, drew@unicon.net

Constructor Summary
EmailMessage(int messageNumber, Long uid, String sender, String subject, Date sentDate, boolean unread, boolean answered, boolean deleted, boolean multipart, String contentType, EmailMessageContent content)
          Creates a new EmailMessage based on the specified Message and EmailMessageContent.
 
Method Summary
 EmailMessageContent getContent()
           
 String getContentType()
           
 int getMessageNumber()
           
 String getSender()
          Returns the sender of this email message.
 String getSenderName()
           
 Date getSentDate()
          Returns the date the email message was sent or null if the server did not provide one.
 String getSentDateString()
           
 String getSubject()
          Returns the email message subject.
 Long getUid()
          Returns the UID of the message as set by the Folder or null if the Folder does not implement UIDFolder.
 boolean isAnswered()
           
 boolean isDeleted()
           
 boolean isMultipart()
           
 boolean isUnread()
           
 void setUnread(boolean unread)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailMessage

public EmailMessage(int messageNumber,
                    Long uid,
                    String sender,
                    String subject,
                    Date sentDate,
                    boolean unread,
                    boolean answered,
                    boolean deleted,
                    boolean multipart,
                    String contentType,
                    EmailMessageContent content)
Creates a new EmailMessage based on the specified Message and EmailMessageContent.

Method Detail

getMessageNumber

public int getMessageNumber()

getUid

public Long getUid()
Returns the UID of the message as set by the Folder or null if the Folder does not implement UIDFolder.

Returns:
The UID provided by the Folder for this message or null

getSentDate

public Date getSentDate()
Returns the date the email message was sent or null if the server did not provide one.

Returns:
Date the email message was sent or null
Throws:
MessagingException

getSentDateString

public String getSentDateString()

getSender

public String getSender()
Returns the sender of this email message.

Returns:
The sender of the email message.

getSenderName

public String getSenderName()

getSubject

public String getSubject()
Returns the email message subject.

Returns:
The email message subject.

isUnread

public boolean isUnread()

setUnread

public void setUnread(boolean unread)

isAnswered

public boolean isAnswered()

isDeleted

public boolean isDeleted()

isMultipart

public boolean isMultipart()

getContentType

public String getContentType()
Returns:
The content type (e.g. "text/plain") of the message body or null if the content cannot be read

getContent

public EmailMessageContent getContent()


Copyright © 2012 Jasig. All Rights Reserved.