| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.confluence.core.DefaultContentEntityManager
com.atlassian.confluence.mail.DefaultMailContentManager
public class DefaultMailContentManager
| Field Summary | |
|---|---|
static org.apache.log4j.Category | 
log
 | 
| Fields inherited from class com.atlassian.confluence.core.DefaultContentEntityManager | 
|---|
contentEntityObjectDao, eventManager, indexer, linkManager | 
| Fields inherited from interface com.atlassian.confluence.core.ContentEntityManager | 
|---|
ITERATE_ALL | 
| Constructor Summary | |
|---|---|
DefaultMailContentManager()
 | 
|
| 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.  | 
 Mail | 
getMailItemFromSpace(Space space,
                     java.lang.String messageId)
 | 
 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)
Get a particular subset (page) of mail from a space.  | 
 java.util.Iterator | 
getSpaceMailIterator(java.lang.String spaceKey)
 | 
 java.util.Iterator | 
getSpaceMailWithAttachmentsIterator(java.lang.String spaceKey)
 | 
protected  void | 
publishCreateEvent(ContentEntityObject obj)
This method publishes *CreateEventss. | 
protected  void | 
publishRemoveEvent(ContentEntityObject obj)
This method publishes *RemoveEvents. | 
protected  void | 
publishUpdateEvent(ContentEntityObject obj,
                   ContentEntityObject origObj,
                   SaveContext saveContext)
This method publishes *UpdateEvents. | 
 void | 
removeAllMail(Space space)
removes all mail in a space including their attachments  | 
 void | 
removeAttachmentsForMail(Mail mail)
 | 
 void | 
removeMail(Mail mail)
removes mail and its associated attachments  | 
 void | 
setAttachmentManager(AttachmentManager attachmentManager)
 | 
 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 class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final org.apache.log4j.Category log
| Constructor Detail | 
|---|
public DefaultMailContentManager()
| Method Detail | 
|---|
public void setAttachmentManager(AttachmentManager attachmentManager)
public Mail getMailById(long id)
MailContentManager
getMailById in interface MailContentManagerpublic java.util.Iterator getSpaceMailIterator(java.lang.String spaceKey)
getSpaceMailIterator in interface MailContentManagerpublic java.util.Iterator getSpaceMailWithAttachmentsIterator(java.lang.String spaceKey)
getSpaceMailWithAttachmentsIterator in interface MailContentManager
public java.util.List getSpaceMail(int firstResult,
                                   int maxResults,
                                   java.lang.String spaceKey)
getSpaceMail in interface MailContentManagerfirstResult - index of the first record from the resulting resultsetmaxResults - the maximum number of records to retrieve after this indexspaceKey - the key for the space from which to remove the mail
public int findMailTotal(Space space)
findMailTotal in interface MailContentManager
public java.util.List getMail(Space space,
                              boolean currentOnly)
getMail in interface MailContentManagerpublic Mail getMailByMessageId(java.lang.String messageId)
getMailByMessageId in interface MailContentManagerpublic java.util.List getMailsByMessageId(java.lang.String messageId)
getMailsByMessageId in interface MailContentManagermessageId - the message id of the mails to retrieve
public Mail storeIncomingMail(Space space,
                              byte[] rawMessage)
MailContentManagerWe use a byte array because RFC822 messages are streams of bytes - character encoding happens after the header is parsed
storeIncomingMail in interface MailContentManagerspace - the space to attach the message torawMessage - the message that has been receivedpublic boolean spaceHasMail(java.lang.String spaceKey)
spaceHasMail in interface MailContentManager
public Mail getFirstMailAfter(java.lang.String spaceKey,
                              long mailId)
getFirstMailAfter in interface MailContentManager
public Mail getFirstMailBefore(java.lang.String spaceKey,
                               long mailId)
getFirstMailBefore in interface MailContentManagerpublic void removeMail(Mail mail)
MailContentManager
removeMail in interface MailContentManagerpublic void removeAllMail(Space space)
removeAllMail in interface MailContentManagerspace - the space from which to remove the mailpublic void removeAttachmentsForMail(Mail mail)
removeAttachmentsForMail in interface MailContentManager
public Mail getMailItemFromSpace(Space space,
                                 java.lang.String messageId)
space - messageId - 
com.atlassian.confluence.Mail which matches messageId, otherwise null.
public Mail storeIncomingMail(Space space,
                              javax.mail.internet.MimeMessage mimeMessage)
                       throws ConfluenceException
MailContentManager
storeIncomingMail in interface MailContentManagerspace - the space to attach the message tomimeMessage - the message that has been received
ConfluenceExceptionprotected void publishCreateEvent(ContentEntityObject obj)
DefaultContentEntityManager*CreateEventss.
 Specific content entity object manager that need to publish those events should override this method.
publishCreateEvent in class DefaultContentEntityManagerobj - the created content entity objectprotected void publishRemoveEvent(ContentEntityObject obj)
DefaultContentEntityManager*RemoveEvents.
 Specific content entity object manager that need to publish those events should override this method.
publishRemoveEvent in class DefaultContentEntityManagerobj - the removed content entity object
protected void publishUpdateEvent(ContentEntityObject obj,
                                  ContentEntityObject origObj,
                                  SaveContext saveContext)
DefaultContentEntityManager*UpdateEvents.
 Specific content entity object manager that need to publish those events should override this method.
publishUpdateEvent in class DefaultContentEntityManagerobj - the updated content entity objectorigObj - the old version of the content entity object, for history purposesaveContext - the associated SaveContext
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||