com.atlassian.confluence.mail
Interface MailContentManager

All Superinterfaces:
ContentEntityManager
All Known Implementing Classes:
DefaultMailContentManager

public interface MailContentManager
extends ContentEntityManager


Field Summary
 
Fields inherited from interface com.atlassian.confluence.core.ContentEntityManager
ITERATE_ALL
 
Method Summary
 int findMailTotal(Space space)
           
 Mail getFirstMailAfter(java.lang.String spaceKey, long mailId)
           
 Mail getFirstMailBefore(java.lang.String spaceKey, long mailId)
           
 java.util.List getMail(Space space, boolean currentOnly)
           
 Mail getMailById(long id)
          Get a mail by its database id.
 Mail getMailByMessageId(java.lang.String messageId)
          Get a mail by its message-id.
 java.util.List getMailsByMessageId(java.lang.String messageId)
          Get all mails with the matching message-id.
 java.util.List getSpaceMail(int firstResult, int maxResults, java.lang.String spaceKey)
           
 java.util.Iterator getSpaceMailIterator(java.lang.String spaceKey)
           
 java.util.Iterator getSpaceMailWithAttachmentsIterator(java.lang.String spaceKey)
           
 void removeAllMail(Space space)
           
 void removeAttachmentsForMail(Mail mail)
           
 void removeMail(Mail mail)
          removes mail and its associated attachments
 boolean spaceHasMail(java.lang.String spaceKey)
           
 Mail storeIncomingMail(Space space, byte[] rawMessage)
          Create a new mail content object in the given space for the given raw RFC822 message.
 Mail storeIncomingMail(Space space, javax.mail.internet.MimeMessage mimeMessage)
          Create a new mail content object in the given space for the given mimeMessage.
 
Methods inherited from interface com.atlassian.confluence.core.ContentEntityManager
getAllCurrentEntities, getById, getEntitiesModifiedSince, getLockedBySpace, getNextVersion, getOtherVersion, getPreviousVersion, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesByType, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getVersionHistorySummaries, refreshContentEntity, removeContentEntity, revertContentEntityBackToVersion, revertContentEntityBackToVersion, saveContentEntity, saveContentEntity, setEventManager, updateContentLinkingTo, updateOutgoingLinksInContent, updateSingleContentLinkinTo, updateSingleContentLinkinTo
 

Method Detail

getMailById

Mail getMailById(long id)
Get a mail by its database id. If the mail does not exist, null is returned.


getMailByMessageId

Mail getMailByMessageId(java.lang.String messageId)
Get a mail by its message-id. If the mail does not exist, or if there are multiple mails with the same message id, null is returned


getMailsByMessageId

java.util.List getMailsByMessageId(java.lang.String messageId)
Get all mails with the matching message-id. Mostly you won't need to use this, as you'll generally be looking for a single message, message ids are reasonably unique, and the single-mail method is less code.

Parameters:
messageId - the message id of the mails to retrieve
Returns:
a list of all messages matching that ID

storeIncomingMail

Mail storeIncomingMail(Space space,
                       javax.mail.internet.MimeMessage mimeMessage)
                       throws ConfluenceException
Create a new mail content object in the given space for the given mimeMessage. The message should be in the raw form it was received in. All post-arrival munging such as filter application, multipart content decisions and attachment removal happen inside this method

Parameters:
space - the space to attach the message to
mimeMessage - the message that has been received
Throws:
ConfluenceException

storeIncomingMail

Mail storeIncomingMail(Space space,
                       byte[] rawMessage)
Create a new mail content object in the given space for the given raw RFC822 message. The message should be in the raw form it was received in. All post-arrival munging such as filter application, multipart content decisions and attachment removal happen inside this method

We use a byte array because RFC822 messages are streams of bytes - character encoding happens after the header is parsed

Parameters:
space - the space to attach the message to
rawMessage - the message that has been received

spaceHasMail

boolean spaceHasMail(java.lang.String spaceKey)

getFirstMailAfter

Mail getFirstMailAfter(java.lang.String spaceKey,
                       long mailId)

getFirstMailBefore

Mail getFirstMailBefore(java.lang.String spaceKey,
                        long mailId)

removeMail

void removeMail(Mail mail)
removes mail and its associated attachments

Parameters:
mail -

removeAttachmentsForMail

void removeAttachmentsForMail(Mail mail)

getSpaceMailIterator

java.util.Iterator getSpaceMailIterator(java.lang.String spaceKey)

getSpaceMailWithAttachmentsIterator

java.util.Iterator getSpaceMailWithAttachmentsIterator(java.lang.String spaceKey)

getSpaceMail

java.util.List getSpaceMail(int firstResult,
                            int maxResults,
                            java.lang.String spaceKey)

findMailTotal

int findMailTotal(Space space)

getMail

java.util.List getMail(Space space,
                       boolean currentOnly)

removeAllMail

void removeAllMail(Space space)


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.