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(String spaceKey, long mailId)
           
 Mail getFirstMailBefore(String spaceKey, long mailId)
           
 List getMail(Space space, boolean currentOnly)
           
 Mail getMailById(long id)
          Get a mail by its database id.
 Mail getMailByMessageId(String messageId)
          Get a mail by its message-id.
 List getMailsByMessageId(String messageId)
          Get all mails with the matching message-id.
 List getSpaceMail(int firstResult, int maxResults, String spaceKey)
           
 Iterator getSpaceMailIterator(String spaceKey)
           
 Iterator getSpaceMailWithAttachmentsIterator(String spaceKey)
           
 void removeAllMail(Space space)
           
 void removeAttachmentsForMail(Mail mail)
           
 void removeMail(Mail mail)
          removes mail and its associated attachments
 boolean spaceHasMail(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, getLockedBySpace, getNextVersion, getOtherVersion, getPreviousVersion, getRecentlyAddedEntities, getRecentlyModifiedEntities, 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(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

List getMailsByMessageId(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(String spaceKey)

getFirstMailAfter

Mail getFirstMailAfter(String spaceKey,
                       long mailId)

getFirstMailBefore

Mail getFirstMailBefore(String spaceKey,
                        long mailId)

removeMail

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

Parameters:
mail -

removeAttachmentsForMail

void removeAttachmentsForMail(Mail mail)

getSpaceMailIterator

Iterator getSpaceMailIterator(String spaceKey)

getSpaceMailWithAttachmentsIterator

Iterator getSpaceMailWithAttachmentsIterator(String spaceKey)

getSpaceMail

List getSpaceMail(int firstResult,
                  int maxResults,
                  String spaceKey)

findMailTotal

int findMailTotal(Space space)

getMail

List getMail(Space space,
             boolean currentOnly)

removeAllMail

void removeAllMail(Space space)


Copyright © 2003-2011 Atlassian. All Rights Reserved.