public interface

MailContentManager

implements ContentEntityManager
com.atlassian.confluence.mail.MailContentManager
Known Indirect Subclasses

Summary

[Expand]
Inherited Constants
From interface com.atlassian.confluence.core.ContentEntityManager
Public Methods
abstract int findMailTotal(Space space)
abstract Mail getFirstMailAfter(String spaceKey, long mailId)
abstract Mail getFirstMailBefore(String spaceKey, long mailId)
abstract List getMail(Space space, boolean currentOnly)
abstract Mail getMailById(long id)
Get a mail by its database id.
abstract Mail getMailByMessageId(String messageId)
Get a mail by its message-id.
abstract List getMailsByMessageId(String messageId)
Get all mails with the matching message-id.
abstract List getSpaceMail(int firstResult, int maxResults, String spaceKey)
abstract Iterator getSpaceMailIterator(String spaceKey)
abstract Iterator getSpaceMailWithAttachmentsIterator(String spaceKey)
abstract void removeAllMail(Space space)
abstract void removeAttachmentsForMail(Mail mail)
abstract void removeMail(Mail mail)
removes mail and its associated attachments
abstract boolean spaceHasMail(String spaceKey)
abstract Mail storeIncomingMail(Space space, MimeMessage mimeMessage)
Create a new mail content object in the given space for the given mimeMessage.
abstract Mail storeIncomingMail(Space space, byte[] rawMessage)
Create a new mail content object in the given space for the given raw RFC822 message.
[Expand]
Inherited Methods
From interface com.atlassian.confluence.core.ContentEntityManager

Public Methods

public abstract int findMailTotal (Space space)

public abstract Mail getFirstMailAfter (String spaceKey, long mailId)

public abstract Mail getFirstMailBefore (String spaceKey, long mailId)

public abstract List getMail (Space space, boolean currentOnly)

public abstract Mail getMailById (long id)

Get a mail by its database id. If the mail does not exist, null is returned.

public abstract 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

public abstract 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

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

public abstract Iterator getSpaceMailIterator (String spaceKey)

public abstract Iterator getSpaceMailWithAttachmentsIterator (String spaceKey)

public abstract void removeAllMail (Space space)

public abstract void removeAttachmentsForMail (Mail mail)

public abstract void removeMail (Mail mail)

removes mail and its associated attachments

public abstract boolean spaceHasMail (String spaceKey)

public abstract Mail storeIncomingMail (Space space, MimeMessage mimeMessage)

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

public abstract 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