com.atlassian.confluence.mail
Class Mail

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.confluence.core.ConfluenceEntityObject
          extended by com.atlassian.confluence.core.AbstractVersionedEntityObject
              extended by com.atlassian.confluence.core.ContentEntityObject
                  extended by com.atlassian.confluence.core.SpaceContentEntityObject
                      extended by com.atlassian.confluence.mail.Mail
All Implemented Interfaces:
com.atlassian.bonnie.Searchable, Addressable, ContentTypeAware, Versioned, Labelable, Spaced, Serializable, Cloneable, Comparable

public class Mail
extends SpaceContentEntityObject

See Also:
Serialized Form

Field Summary
static String CONTENT_TYPE
           
static String DEFAULT_NO_SUBJECT
           
static int MESSAGE_ID_SIZE
           
static int MESSAGE_SUBJECT_SIZE
           
 
Fields inherited from class com.atlassian.confluence.core.ContentEntityObject
CREATED, CURRENT, DELETED, MODIFIED
 
Fields inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
INITIAL_VERSION
 
Constructor Summary
Mail()
           
 
Method Summary
 String getCanonicalSubject()
          Get the canonical subject of this mail.
 String getContent()
           
 Date getCreationDate()
           
 String getDisplayableCanonicalSubject()
          Get the displayable version of the mails canonical subject string.
 String getDisplayableSubject()
          Get the displayable version of the mails subject string.
 String getExcerpt()
           
 ConfluenceMailAddress[] getFrom()
           
 List getFromForSearch()
           
 String getInReplyTo()
           
 String getMessageBody()
           
 String getMessageId()
           
 javax.mail.internet.MimeMessage getMimeMessage()
           
 ConfluenceMailAddress[] getRecipients()
           
 List getRecipientsForSearch()
           
 List getReferences()
           
 Date getSentDate()
           
 String getSubject()
          Get the mail subject string.
 String getTitle()
           
 String getType()
          An easy name for the type of this content: makes it easy for things like the #contentLink macro to work out what to draw.
 String getUnquotedTextForSummary()
           
 String getUrlPath()
           
 boolean hasSubject()
           
 void loadContent(InputStream in)
           
 void setContent(String content)
           
 void setMessageId(String messageId)
           
 void setMimeMessage(javax.mail.internet.MimeMessage message)
           
 
Methods inherited from class com.atlassian.confluence.core.SpaceContentEntityObject
addTrackbackLink, convertToHistoricalVersion, getNameForComparison, getSpace, getSpaceKey, hashCode, isIndexable, isInSpace, setSpace
 
Methods inherited from class com.atlassian.confluence.core.ContentEntityObject
addAttachment, addComment, addLabelling, addOutgoingLink, addPermission, addReferralLink, clone, compareTo, equals, getAttachmentNamed, getAttachments, getAttachmentsUrlPath, getBodyContents, getComments, getContentPermission, getContentPermissionSet, getContentStatus, getDisplayTitle, getGlobalLabels, getIdAsString, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getLabelUtil, getLatestVersionsOfAttachments, getOutgoingLinks, getPermissions, getPersonalLabels, getReferralLinks, getRenderedVersionComment, getSearchableDependants, getTrackbackLinks, getUserAccessor, getVersionComment, getVisibleLabels, hasContentPermissions, hasPermissions, isCurrent, isDeleted, isFavourite, isRecentlyUpdatedFor, isVersionCommentAvailable, removeAttachment, removeComment, removeContentPermissionSet, removeLabelling, removeOutgoingLink, removeReferralLink, removeTrackbackLink, setAttachments, setBodyContents, setComments, setContentStatus, setOutgoingLinks, setReferralLinks, setTitle, setTrackbackLinks, setUserAccessor, setVersionComment, toPageContext, toString, trash
 
Methods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject
getLatestVersion, getOriginalVersion, getVersion, isLatestVersion, isNew, setOriginalVersion, setVersion
 
Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreatorName, getLastModifierName, getRealClass, isPersistent, setCreatorName, setLastModifierName
 
Methods inherited from class com.atlassian.core.bean.EntityObject
getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.bonnie.Searchable
getId
 
Methods inherited from interface com.atlassian.confluence.core.Addressable
getId
 

Field Detail

MESSAGE_ID_SIZE

public static final int MESSAGE_ID_SIZE
See Also:
Constant Field Values

MESSAGE_SUBJECT_SIZE

public static final int MESSAGE_SUBJECT_SIZE
See Also:
Constant Field Values

CONTENT_TYPE

public static final String CONTENT_TYPE
See Also:
Constant Field Values

DEFAULT_NO_SUBJECT

public static final String DEFAULT_NO_SUBJECT
See Also:
Constant Field Values
Constructor Detail

Mail

public Mail()
Method Detail

getType

public String getType()
Description copied from class: ContentEntityObject
An easy name for the type of this content: makes it easy for things like the #contentLink macro to work out what to draw.

This is a bit of a hack, but it saves heaps of code elsewhere, especially since we tend to get back these objects wrapped in all sorts of Hibernate CGLIB stuff.

Specified by:
getType in interface ContentTypeAware
Specified by:
getType in class ContentEntityObject
Returns:
the content type

getContent

public String getContent()
Overrides:
getContent in class ContentEntityObject

getUrlPath

public String getUrlPath()
Specified by:
getUrlPath in interface Addressable
Specified by:
getUrlPath in class ContentEntityObject

getMimeMessage

public javax.mail.internet.MimeMessage getMimeMessage()
                                               throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

loadContent

public void loadContent(InputStream in)
                 throws IOException
Throws:
IOException

setContent

public void setContent(String content)
Overrides:
setContent in class ContentEntityObject

getTitle

public String getTitle()
Overrides:
getTitle in class ContentEntityObject

hasSubject

public boolean hasSubject()
Returns:
True if this mail item contains a subject string, false otherwise. If we can not determine the presence of the subject in the mime-message, we assume that one does not exist.

getSubject

public String getSubject()
Get the mail subject string.

See Also:
getDisplayableSubject()

getDisplayableSubject

public String getDisplayableSubject()
Get the displayable version of the mails subject string. If the mail does not have a subject, then this returns the default subject.

See Also:
hasSubject(), getSubject()

getCanonicalSubject

public String getCanonicalSubject()
Get the canonical subject of this mail. The canonical form removes all Re: and Fwd: style prefixes on the email, returning what should be the original emails subject. All emails within a thread will have the same canonical subject.

See Also:
getSubject()

getDisplayableCanonicalSubject

public String getDisplayableCanonicalSubject()
Get the displayable version of the mails canonical subject string. That is, if the mail does not have a canonical subject, return the default.

See Also:
getCanonicalSubject(), hasSubject()

getMessageId

public String getMessageId()

setMessageId

public void setMessageId(String messageId)

getMessageBody

public String getMessageBody()

setMimeMessage

public void setMimeMessage(javax.mail.internet.MimeMessage message)

getInReplyTo

public String getInReplyTo()

getReferences

public List getReferences()

getFrom

public ConfluenceMailAddress[] getFrom()

getFromForSearch

public List getFromForSearch()

getRecipientsForSearch

public List getRecipientsForSearch()

getRecipients

public ConfluenceMailAddress[] getRecipients()

getSentDate

public Date getSentDate()

getCreationDate

public Date getCreationDate()
Overrides:
getCreationDate in class com.atlassian.core.bean.EntityObject

getExcerpt

public String getExcerpt()
Overrides:
getExcerpt in class ContentEntityObject

getUnquotedTextForSummary

public String getUnquotedTextForSummary()


Copyright © 2003-2011 Atlassian. All Rights Reserved.