com.atlassian.confluence.mail.persistence.dao
Interface MailDao

All Superinterfaces:
ContentEntityObjectDao, ObjectDao, VersionedObjectDao
All Known Implementing Classes:
HibernateMailDao

public interface MailDao
extends ContentEntityObjectDao


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)
          Retrieve a single mail by its persistent object id.
 Mail getMailByMessageId(String messageId)
          Retrieve a single mail by its message-id.
 List getMailsByMessageId(String messageId)
          Retrieve all mails with a particular message id.
 Mail getMostRecentMail(String spaceKey)
           
 List getSpaceMail(int firstResult, int maxResults, String spaceKey)
           
 Iterator getSpaceMailIterator(String spaceKey)
           
 Iterator getSpaceMailWithAttachmentsIterator(String spaceKey)
           
 void removeAllMail(Space space)
           
 
Methods inherited from interface com.atlassian.confluence.core.persistence.ContentEntityObjectDao
findPreviousVersions, getAllCurrentEntities, getById, getContentAuthoredByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getLockedContentBySpace, getObjectType, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getVersion, getVersionHistorySummary
 
Methods inherited from interface com.atlassian.confluence.core.persistence.VersionedObjectDao
findLatestVersionsCount, findLatestVersionsIterator, save
 
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, getPersistentClass, refresh, remove, replicate, save, saveRaw
 

Method Detail

getMailById

Mail getMailById(long id)
Retrieve a single mail by its persistent object id. Returns null if no Mail is found with that id

Parameters:
id - the id of the mail to retrieve
Returns:
the appropriate Mail object, or null if no such mail exists

getMailByMessageId

Mail getMailByMessageId(String messageId)
Retrieve a single mail by its message-id. Since message ids are not guaranteed to be unique (but should be in practice), this method will return null both if no message exists with that ID, or if multiple mails exist with that ID. To determine which is the case, call getMailsByMessageId(java.lang.String).

Message ids are case sensitive.

Parameters:
messageId - the Message-Id of the mail to retrieve
Returns:
the appropriate Mail object, or null if no such mail exists, or if multiple mails exist with that ID

getMailsByMessageId

List getMailsByMessageId(String messageId)
Retrieve all mails with a particular message id. Since message ids are supposed to be unique, you will mostly want to just use getMailByMessageId(java.lang.String) instead, but this method is useful if you want to cater for the possibility of (unlikely) accidental clashes or (more likely) deliberate forgeries.

Message ids are case sensitive

Parameters:
messageId - The Message-Id of the mail to retrieve
Returns:
a list of all mails matching that message-id, or the empty list if no such mails exist.

getMostRecentMail

Mail getMostRecentMail(String spaceKey)

getFirstMailAfter

Mail getFirstMailAfter(String spaceKey,
                       long mailId)

getFirstMailBefore

Mail getFirstMailBefore(String spaceKey,
                        long mailId)

getSpaceMailIterator

Iterator getSpaceMailIterator(String spaceKey)

getSpaceMailWithAttachmentsIterator

Iterator getSpaceMailWithAttachmentsIterator(String spaceKey)

findMailTotal

int findMailTotal(Space space)

getSpaceMail

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

removeAllMail

void removeAllMail(Space space)

getMail

List getMail(Space space,
             boolean currentOnly)


Copyright © 2003-2011 Atlassian. All Rights Reserved.