org.exoplatform.mail.service
Interface MailService

All Known Implementing Classes:
MailServiceImpl

public interface MailService

Created by The eXo Platform SARL Author : Tuan Nguyen Phung Nam Jun 23, 2007


Method Summary
 void addListenerPlugin(org.exoplatform.container.component.ComponentPlugin listener)
           
 void addTag(java.lang.String username, java.lang.String accountId, java.util.List<Message> messages, java.util.List<Tag> tag)
          Check the tag name to see if the tag name is configured in the account Check to see if the tag is already set in the message Add the tag to the message and save the message.
 void addTag(java.lang.String username, java.lang.String accountId, Tag tag)
          Check the tag name to see if the tag name is configured in the account If not create a new tag
 void checkMail(java.lang.String username, java.lang.String accountId)
          Getting new mail from server and store to JCR
 void checkMail(java.lang.String username, java.lang.String accountId, java.lang.String folderId)
          Getting new mail from server and store to JCR
 java.util.List<Message> checkNewMessage(java.lang.String username, java.lang.String accountId)
          This method should check for the new message in the mail server, download and save them in the Inbox folder
 java.util.List<Message> checkNewMessage(java.lang.String username, java.lang.String accountId, java.lang.String folderId)
          This method should check for the new message in the mail server, download and save them in the Inbox folder
 void createAccount(java.lang.String username, Account account)
          Use save for create and update This method should: 1.
 java.io.OutputStream exportMessage(java.lang.String username, java.lang.String accountId, Message message)
          Export message from eXo Mail.
 Account getAccountById(java.lang.String username, java.lang.String id)
          This method should: 1.
 java.util.List<Account> getAccounts(java.lang.String username)
          This method should: 1.
 CheckingInfo getCheckingInfo(java.lang.String username, java.lang.String accountId)
           
 Account getDefaultAccount(java.lang.String username)
          Get default account
 MessageFilter getFilterById(java.lang.String username, java.lang.String accountId, java.lang.String filterId)
          Get MessageFilter by id of filter
 java.util.List<MessageFilter> getFilters(java.lang.String username, java.lang.String accountId)
          Get all MessageFilter in special account
 Folder getFolder(java.lang.String username, java.lang.String accountId, java.lang.String folderId)
          This method uses to get a folder object by folderId
 java.lang.String getFolderHomePath(java.lang.String username, java.lang.String accountId)
          Get path of node, that contains all folders
 java.lang.String getFolderParentId(java.lang.String username, java.lang.String accountId, java.lang.String folderId)
          This method get id of parent folder by id of child folder
 java.util.List<Folder> getFolders(java.lang.String username, java.lang.String accountId)
           
 java.util.List<Folder> getFolders(java.lang.String username, java.lang.String accountId, boolean isPersonal)
          Get folders depend on they are personal folders or default folders
 java.lang.String getMailHierarchyNode()
           
 MailSetting getMailSetting(java.lang.String username)
          This method get mail settings
 Message getMessageById(java.lang.String username, java.lang.String accountId, java.lang.String nodeName)
          Load the message from the database if it existed and return.
 java.util.List<Message> getMessageByTag(java.lang.String username, java.lang.String accountId, java.lang.String tagId)
          Get all messages of the given tag id
 MessagePageList getMessagePageList(java.lang.String username, MessageFilter filter)
          Find all the message according the parameter that is specified in the filter object
 MessagePageList getMessagePageListByFolder(java.lang.String username, java.lang.String accountId, java.lang.String folderId)
          Get MessagePageList by folder id.
 MessagePageList getMessagePagelistByTag(java.lang.String username, java.lang.String accountId, java.lang.String tagId)
          Get MessagePageList by tag id.
 java.util.List<Message> getMessages(java.lang.String username, MessageFilter filter)
          Get messages by given filter.
 java.util.List<Message> getMessagesByFolder(java.lang.String username, java.lang.String accountId, java.lang.String folderId)
          Get all messages by given folder id.
 java.util.List<Message> getMessagesByTag(java.lang.String username, java.lang.String accountId, java.lang.String tagId)
          Get all messages by tag id.
 java.util.List<Message> getReferencedMessages(java.lang.String username, java.lang.String accountId, java.lang.String msgPath)
          Get all referenced messages of give message path
 SpamFilter getSpamFilter(java.lang.String username, java.lang.String accountId)
           
 java.util.List<Folder> getSubFolders(java.lang.String username, java.lang.String accountId, java.lang.String parentPath)
          Get all sub folders of the given folder path
 Tag getTag(java.lang.String username, java.lang.String accountId, java.lang.String tagId)
          Get tag by tagId
 java.util.List<Tag> getTags(java.lang.String username, java.lang.String accountId)
          Get all tags of account
 boolean importMessage(java.lang.String username, java.lang.String accountId, java.lang.String folderId, java.io.InputStream inputStream, java.lang.String type)
          Import message to eXo Mail.
 boolean isExistFolder(java.lang.String username, java.lang.String accountId, java.lang.String parentId, java.lang.String folderName)
          Check whether the folder contains one child folder with identify id string
 Message loadTotalMessage(java.lang.String username, java.lang.String accountId, Message msg)
          If the message object didn't load attachment yet, then this method will load it's attachment from JCR and return it's message
 Message moveMessage(java.lang.String username, java.lang.String accountId, Message msg, java.lang.String currentFolderId, java.lang.String destFolderId)
          Move a message from the current folder to the given folder
 void moveMessage(java.lang.String username, java.lang.String accountId, Message msg, java.lang.String currentFolderId, java.lang.String destFolderId, boolean updateReference)
           
 java.util.List<Message> moveMessages(java.lang.String username, java.lang.String accountId, java.util.List<Message> msgList, java.lang.String currentFolderId, java.lang.String destFolderId)
          Move a list of message from the current folder to the given folder
 java.util.List<Message> moveMessages(java.lang.String username, java.lang.String accountId, java.util.List<Message> msgList, java.lang.String currentFolderId, java.lang.String destFolderId, boolean updateReference)
          Move message(s) to Trash folder
 void removeAccount(java.lang.String username, java.lang.String accountId)
          Remove the account from the database Update the cache
 void removeCheckingInfo(java.lang.String username, java.lang.String accountId)
           
 void removeFilter(java.lang.String username, java.lang.String accountId, java.lang.String filterId)
          Remove filter by filter id
 void removeMessage(java.lang.String username, java.lang.String accountId, Message message)
          This method should: 1.
 void removeMessages(java.lang.String username, java.lang.String accountId, java.util.List<Message> messages, boolean moveReference)
          This method should: 1.
 void removeTag(java.lang.String username, java.lang.String accountId, java.lang.String tag)
          Find all the message that has the tag , remove the tag from the message and save Remove the tag from the account and save Update or invalidate the cache if needed
 void removeTagsInMessages(java.lang.String username, java.lang.String accountId, java.util.List<Message> messages, java.util.List<java.lang.String> tags)
          Remove the tag from the message Save the message into the database Update or invalidate the cache
 void removeUserFolder(java.lang.String username, java.lang.String accountId, java.lang.String folderId)
           
 void renameFolder(java.lang.String username, java.lang.String accountId, java.lang.String newName, java.lang.String folderId)
          This method remove all the messages in the folder then remove the folder of the account Save the account into the database
 void saveFilter(java.lang.String username, java.lang.String accountId, MessageFilter filter, boolean applyAll)
          Save filter to JCR
 void saveFolder(java.lang.String username, java.lang.String accountId, Folder folder)
          Save folder under special account
 void saveFolder(java.lang.String username, java.lang.String accountId, java.lang.String parentId, Folder folder)
          Save folder to JCR as child of given folder
 void saveMailSetting(java.lang.String username, MailSetting newSetting)
          This method to update mail setting
 boolean saveMessage(java.lang.String username, Account account, java.lang.String targetMsgPath, Message message, boolean isNew)
          Save message to Account/Messages/Year/Month/Day tree node.
 void saveMessage(java.lang.String username, java.lang.String accountId, Message message, boolean isNew)
           
 void saveSpamFilter(java.lang.String username, java.lang.String accountId, SpamFilter spamFilter)
          Save the given spam filter to JCR
 void sendMessage(Message message)
          This method should send out the message
 Message sendMessage(java.lang.String username, Account acc, Message message)
           
 Message sendMessage(java.lang.String username, Message message)
          This method should send out the message
 Message sendMessage(java.lang.String username, java.lang.String accId, Message message)
           
 void sendMessages(java.util.List<Message> msgList, ServerConfiguration serverConfig)
          Use smtp to send message with given server configuration
 boolean sendReturnReceipt(java.lang.String username, java.lang.String accId, java.lang.String msgId, java.util.ResourceBundle res)
           
 void stopAllJobs(java.lang.String username, java.lang.String accountId)
           
 void stopCheckMail(java.lang.String username, java.lang.String accountId)
          Requests to stop mail checking
 void synchImapFolders(java.lang.String username, java.lang.String accountId)
           
 void toggleMessageProperty(java.lang.String username, java.lang.String accountId, java.util.List<Message> msgList, java.lang.String folderId, java.lang.String property, boolean value)
          Toggle the property of message.
 void updateAccount(java.lang.String username, Account account)
          This method should: 1.
 boolean updateNumberOfUnreadMessages(java.lang.String username, java.lang.String accountId, java.lang.String folderId, long num)
          update number of unread message for a folder.
 void updateTag(java.lang.String username, java.lang.String accountId, Tag tag)
          Update a tag.
 

Method Detail

getAccounts

java.util.List<Account> getAccounts(java.lang.String username)
                                    throws java.lang.Exception
This method should: 1. The service should load the accounts belong to the user and cache in the service. 2. The service should return the list of the account in the cache. If the user hasn't configured an account, an empty list will be cached and return.

Parameters:
username -
Returns:
List
Throws:
java.lang.Exception

getMailHierarchyNode

java.lang.String getMailHierarchyNode()
                                      throws java.lang.Exception
Throws:
java.lang.Exception

getAccountById

Account getAccountById(java.lang.String username,
                       java.lang.String id)
                       throws java.lang.Exception
This method should: 1. Check if the list of the accounts is cached. If not call the method List getAccounts(String username) to load all the account belong to the user and cached 2. Find the account in the list of the account and return. 3. return null if no account is found.

Parameters:
username -
id -
Returns:
Account
Throws:
java.lang.Exception

createAccount

void createAccount(java.lang.String username,
                   Account account)
                   throws java.lang.Exception
Use save for create and update This method should: 1. Check all the madatory field of the account and save the account into the database. The method should throw exception , if any mandatory field is missing. 2. The method should update or invalidate the list of account of the user in the cache

Parameters:
username -
account -
Throws:
java.lang.Exception

updateAccount

void updateAccount(java.lang.String username,
                   Account account)
                   throws java.lang.Exception
This method should: 1. This method check the madatory field and save the updated account into the database 2. This method should update the cache if the data is updated successfully.

Parameters:
username -
account -
Throws:
java.lang.Exception

removeAccount

void removeAccount(java.lang.String username,
                   java.lang.String accountId)
                   throws java.lang.Exception
Remove the account from the database Update the cache

Parameters:
username -
account -
Throws:
java.lang.Exception

getFolders

java.util.List<Folder> getFolders(java.lang.String username,
                                  java.lang.String accountId)
                                  throws java.lang.Exception
Parameters:
username -
accountId -
Returns:
List folder
Throws:
java.lang.Exception

getFolders

java.util.List<Folder> getFolders(java.lang.String username,
                                  java.lang.String accountId,
                                  boolean isPersonal)
                                  throws java.lang.Exception
Get folders depend on they are personal folders or default folders

Parameters:
username -
accountId -
isPersonal -
Returns:
List of folders
Throws:
java.lang.Exception

getFolder

Folder getFolder(java.lang.String username,
                 java.lang.String accountId,
                 java.lang.String folderId)
                 throws java.lang.Exception
This method uses to get a folder object by folderId

Parameters:
username -
accountId -
folderId -
Returns:
exo Folder object
Throws:
java.lang.Exception

getFolderParentId

java.lang.String getFolderParentId(java.lang.String username,
                                   java.lang.String accountId,
                                   java.lang.String folderId)
                                   throws java.lang.Exception
This method get id of parent folder by id of child folder

Parameters:
username -
accountId -
folderName -
Returns:
string Id of parent folder
Throws:
java.lang.Exception

isExistFolder

boolean isExistFolder(java.lang.String username,
                      java.lang.String accountId,
                      java.lang.String parentId,
                      java.lang.String folderName)
                      throws java.lang.Exception
Check whether the folder contains one child folder with identify id string

Parameters:
username -
accountId -
parentId -
folderName -
Returns:
boolean
Throws:
java.lang.Exception

saveFolder

void saveFolder(java.lang.String username,
                java.lang.String accountId,
                Folder folder)
                throws java.lang.Exception
Save folder under special account

Parameters:
username -
accountId -
folder -
Throws:
java.lang.Exception

renameFolder

void renameFolder(java.lang.String username,
                  java.lang.String accountId,
                  java.lang.String newName,
                  java.lang.String folderId)
                  throws java.lang.Exception
This method remove all the messages in the folder then remove the folder of the account Save the account into the database

Parameters:
username -
folderId -
account -
Throws:
java.lang.Exception

removeUserFolder

void removeUserFolder(java.lang.String username,
                      java.lang.String accountId,
                      java.lang.String folderId)
                      throws java.lang.Exception
Throws:
java.lang.Exception

getFilters

java.util.List<MessageFilter> getFilters(java.lang.String username,
                                         java.lang.String accountId)
                                         throws java.lang.Exception
Get all MessageFilter in special account

Parameters:
username -
accountId -
Returns:
list of all filters
Throws:
java.lang.Exception

getFilterById

MessageFilter getFilterById(java.lang.String username,
                            java.lang.String accountId,
                            java.lang.String filterId)
                            throws java.lang.Exception
Get MessageFilter by id of filter

Parameters:
username -
accountId -
filterId -
Returns:
MessageFilter
Throws:
java.lang.Exception

saveFilter

void saveFilter(java.lang.String username,
                java.lang.String accountId,
                MessageFilter filter,
                boolean applyAll)
                throws java.lang.Exception
Save filter to JCR

Parameters:
username -
accountId -
filter -
applyAll -
Throws:
java.lang.Exception

removeFilter

void removeFilter(java.lang.String username,
                  java.lang.String accountId,
                  java.lang.String filterId)
                  throws java.lang.Exception
Remove filter by filter id

Parameters:
username -
accountId -
filterId -
Throws:
java.lang.Exception

getMessageByTag

java.util.List<Message> getMessageByTag(java.lang.String username,
                                        java.lang.String accountId,
                                        java.lang.String tagId)
                                        throws java.lang.Exception
Get all messages of the given tag id

Parameters:
username -
accountId -
tagId -
Throws:
java.lang.Exception

getMessagePagelistByTag

MessagePageList getMessagePagelistByTag(java.lang.String username,
                                        java.lang.String accountId,
                                        java.lang.String tagId)
                                        throws java.lang.Exception
Get MessagePageList by tag id. This method get all message and put it to MessagePageList object this object will use getPage() method to return a list of messages.

Parameters:
username -
accountId -
tagId -
Returns:
MessagePageList that hold message by page
Throws:
java.lang.Exception

getMessagePageListByFolder

MessagePageList getMessagePageListByFolder(java.lang.String username,
                                           java.lang.String accountId,
                                           java.lang.String folderId)
                                           throws java.lang.Exception
Get MessagePageList by folder id. This method get all message and put it to MessagePageList object this object will use getPage() method to return a list of messages.

Parameters:
username -
accountId -
folderId -
Returns:
MessagePageList
Throws:
java.lang.Exception

getTags

java.util.List<Tag> getTags(java.lang.String username,
                            java.lang.String accountId)
                            throws java.lang.Exception
Get all tags of account

Parameters:
username -
accountId -
Returns:
List of Tag
Throws:
java.lang.Exception

getTag

Tag getTag(java.lang.String username,
           java.lang.String accountId,
           java.lang.String tagId)
           throws java.lang.Exception
Get tag by tagId

Parameters:
username -
accountId -
Returns:
List of Tag
Throws:
java.lang.Exception

addTag

void addTag(java.lang.String username,
            java.lang.String accountId,
            Tag tag)
            throws java.lang.Exception
Check the tag name to see if the tag name is configured in the account If not create a new tag

Parameters:
username -
accountId -
tag -
Throws:
java.lang.Exception

addTag

void addTag(java.lang.String username,
            java.lang.String accountId,
            java.util.List<Message> messages,
            java.util.List<Tag> tag)
            throws java.lang.Exception
Check the tag name to see if the tag name is configured in the account Check to see if the tag is already set in the message Add the tag to the message and save the message. Invalidate or update the cache.

Parameters:
username -
tag -
message -
Throws:
java.lang.Exception

removeTagsInMessages

void removeTagsInMessages(java.lang.String username,
                          java.lang.String accountId,
                          java.util.List<Message> messages,
                          java.util.List<java.lang.String> tags)
                          throws java.lang.Exception
Remove the tag from the message Save the message into the database Update or invalidate the cache

Parameters:
username -
tags -
message -
Throws:
java.lang.Exception

removeTag

void removeTag(java.lang.String username,
               java.lang.String accountId,
               java.lang.String tag)
               throws java.lang.Exception
Find all the message that has the tag , remove the tag from the message and save Remove the tag from the account and save Update or invalidate the cache if needed

Parameters:
username -
tag -
account -
Throws:
java.lang.Exception

updateTag

void updateTag(java.lang.String username,
               java.lang.String accountId,
               Tag tag)
               throws java.lang.Exception
Update a tag.

Parameters:
username -
accountId -
tag -
Throws:
java.lang.Exception

getMessageById

Message getMessageById(java.lang.String username,
                       java.lang.String accountId,
                       java.lang.String nodeName)
                       throws java.lang.Exception
Load the message from the database if it existed and return. This method should implement a cache to cache the message by the message id and the username

Parameters:
username -
nodeName -
Returns:
message
Throws:
java.lang.Exception

getMessagePageList

MessagePageList getMessagePageList(java.lang.String username,
                                   MessageFilter filter)
                                   throws java.lang.Exception
Find all the message according the parameter that is specified in the filter object

Parameters:
username -
filter -
Returns:
MessagePageList
Throws:
java.lang.Exception

getMessagesByTag

java.util.List<Message> getMessagesByTag(java.lang.String username,
                                         java.lang.String accountId,
                                         java.lang.String tagId)
                                         throws java.lang.Exception
Get all messages by tag id.

Parameters:
username -
accountId -
tagId -
Returns:
List of messages
Throws:
java.lang.Exception

getMessagesByFolder

java.util.List<Message> getMessagesByFolder(java.lang.String username,
                                            java.lang.String accountId,
                                            java.lang.String folderId)
                                            throws java.lang.Exception
Get all messages by given folder id.

Parameters:
username -
accountId -
folderId -
Returns:
List of messages
Throws:
java.lang.Exception

getMessages

java.util.List<Message> getMessages(java.lang.String username,
                                    MessageFilter filter)
                                    throws java.lang.Exception
Get messages by given filter. This method get all message which are statisfied all conditions of filter

Parameters:
username -
accountId -
folderId -
Returns:
List of messages
Throws:
java.lang.Exception

saveMessage

boolean saveMessage(java.lang.String username,
                    Account account,
                    java.lang.String targetMsgPath,
                    Message message,
                    boolean isNew)
                    throws java.lang.Exception
Save message to Account/Messages/Year/Month/Day tree node. If message is new then Day node will create a new node if not it will update the exist message.

Parameters:
username -
account -
targetMsgPath - this param is path of node Account/Messages/Year/Month/Day
Returns:
true if save message success. false if else
Throws:
java.lang.Exception

saveMessage

void saveMessage(java.lang.String username,
                 java.lang.String accountId,
                 Message message,
                 boolean isNew)
                 throws java.lang.Exception
Throws:
java.lang.Exception

removeMessage

void removeMessage(java.lang.String username,
                   java.lang.String accountId,
                   Message message)
                   throws java.lang.Exception
This method should: 1. Remove the message from the database if it is existed 2. Update or invalidate the cache if the message is cached

Parameters:
username -
message -
Throws:
java.lang.Exception

removeMessages

void removeMessages(java.lang.String username,
                    java.lang.String accountId,
                    java.util.List<Message> messages,
                    boolean moveReference)
                    throws java.lang.Exception
This method should: 1. Remove all the messages 2. Update or invalidate the cache

Parameters:
username -
messageId -
Throws:
java.lang.Exception

moveMessages

java.util.List<Message> moveMessages(java.lang.String username,
                                     java.lang.String accountId,
                                     java.util.List<Message> msgList,
                                     java.lang.String currentFolderId,
                                     java.lang.String destFolderId)
                                     throws java.lang.Exception
Move a list of message from the current folder to the given folder

Parameters:
username -
accountId -
currentFolderId -
destFolderId -
msg -
Throws:
java.lang.Exception

moveMessages

java.util.List<Message> moveMessages(java.lang.String username,
                                     java.lang.String accountId,
                                     java.util.List<Message> msgList,
                                     java.lang.String currentFolderId,
                                     java.lang.String destFolderId,
                                     boolean updateReference)
                                     throws java.lang.Exception
Move message(s) to Trash folder

Throws:
java.lang.Exception

moveMessage

Message moveMessage(java.lang.String username,
                    java.lang.String accountId,
                    Message msg,
                    java.lang.String currentFolderId,
                    java.lang.String destFolderId)
                    throws java.lang.Exception
Move a message from the current folder to the given folder

Parameters:
username -
accountId -
msg -
currentFolderId -
destFolderId -
Returns:
the moved/deleted message, and return null value if that message hasn't moved/deleted
Throws:
java.lang.Exception

moveMessage

void moveMessage(java.lang.String username,
                 java.lang.String accountId,
                 Message msg,
                 java.lang.String currentFolderId,
                 java.lang.String destFolderId,
                 boolean updateReference)
                 throws java.lang.Exception
Throws:
java.lang.Exception

sendMessages

void sendMessages(java.util.List<Message> msgList,
                  ServerConfiguration serverConfig)
                  throws java.lang.Exception
Use smtp to send message with given server configuration

Parameters:
msgList -
serverConfig -
Throws:
java.lang.Exception

sendMessage

Message sendMessage(java.lang.String username,
                    Account acc,
                    Message message)
                    throws java.lang.Exception
Throws:
java.lang.Exception

sendMessage

Message sendMessage(java.lang.String username,
                    java.lang.String accId,
                    Message message)
                    throws java.lang.Exception
Throws:
java.lang.Exception

sendMessage

void sendMessage(Message message)
                 throws java.lang.Exception
This method should send out the message

Parameters:
message -
Throws:
java.lang.Exception

sendMessage

Message sendMessage(java.lang.String username,
                    Message message)
                    throws java.lang.Exception
This method should send out the message

Parameters:
username -
message -
Returns:
Message
Throws:
java.lang.Exception

synchImapFolders

void synchImapFolders(java.lang.String username,
                      java.lang.String accountId)
                      throws java.lang.Exception
Throws:
java.lang.Exception

checkNewMessage

java.util.List<Message> checkNewMessage(java.lang.String username,
                                        java.lang.String accountId)
                                        throws java.lang.Exception
This method should check for the new message in the mail server, download and save them in the Inbox folder

Parameters:
username -
account -
Returns:
List
Throws:
java.lang.Exception

checkNewMessage

java.util.List<Message> checkNewMessage(java.lang.String username,
                                        java.lang.String accountId,
                                        java.lang.String folderId)
                                        throws java.lang.Exception
This method should check for the new message in the mail server, download and save them in the Inbox folder

Parameters:
username -
folderId -
account -
Returns:
List
Throws:
java.lang.Exception

removeCheckingInfo

void removeCheckingInfo(java.lang.String username,
                        java.lang.String accountId)
                        throws java.lang.Exception
Throws:
java.lang.Exception

getCheckingInfo

CheckingInfo getCheckingInfo(java.lang.String username,
                             java.lang.String accountId)
                             throws java.lang.Exception
Throws:
java.lang.Exception

checkMail

void checkMail(java.lang.String username,
               java.lang.String accountId)
               throws java.lang.Exception
Getting new mail from server and store to JCR

Parameters:
username -
accountId -
Throws:
java.lang.Exception

checkMail

void checkMail(java.lang.String username,
               java.lang.String accountId,
               java.lang.String folderId)
               throws java.lang.Exception
Getting new mail from server and store to JCR

Parameters:
username -
accountId -
folderId -
Throws:
java.lang.Exception

stopCheckMail

void stopCheckMail(java.lang.String username,
                   java.lang.String accountId)
Requests to stop mail checking

Parameters:
username - userid
accountId - mail account
Throws:
java.lang.Exception

stopAllJobs

void stopAllJobs(java.lang.String username,
                 java.lang.String accountId)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getMailSetting

MailSetting getMailSetting(java.lang.String username)
                           throws java.lang.Exception
This method get mail settings

Parameters:
username -
Returns:
MailSetting
Throws:
java.lang.Exception

saveMailSetting

void saveMailSetting(java.lang.String username,
                     MailSetting newSetting)
                     throws java.lang.Exception
This method to update mail setting

Parameters:
username -
newSetting -
Throws:
java.lang.Exception

importMessage

boolean importMessage(java.lang.String username,
                      java.lang.String accountId,
                      java.lang.String folderId,
                      java.io.InputStream inputStream,
                      java.lang.String type)
                      throws java.lang.Exception
Import message to eXo Mail. This method get InputStream and parse it to eXo Message object in special type

Parameters:
username -
newSetting -
Throws:
java.lang.Exception

exportMessage

java.io.OutputStream exportMessage(java.lang.String username,
                                   java.lang.String accountId,
                                   Message message)
                                   throws java.lang.Exception
Export message from eXo Mail. The exported file can reimport to eXo Mail or import to other mail system

Parameters:
username -
accountId -
folderId -
inputStream -
type -
Returns:
OutputStream
Throws:
java.lang.Exception

getSpamFilter

SpamFilter getSpamFilter(java.lang.String username,
                         java.lang.String accountId)
                         throws java.lang.Exception
Parameters:
username -
accountId -
Throws:
java.lang.Exception

saveSpamFilter

void saveSpamFilter(java.lang.String username,
                    java.lang.String accountId,
                    SpamFilter spamFilter)
                    throws java.lang.Exception
Save the given spam filter to JCR

Parameters:
username -
accountId -
spamFilter -
Throws:
java.lang.Exception

toggleMessageProperty

void toggleMessageProperty(java.lang.String username,
                           java.lang.String accountId,
                           java.util.List<Message> msgList,
                           java.lang.String folderId,
                           java.lang.String property,
                           boolean value)
                           throws java.lang.Exception
Toggle the property of message. For example read/unread, star/unstar

Parameters:
username -
accountId -
msgList -
property -
Throws:
java.lang.Exception

getFolderHomePath

java.lang.String getFolderHomePath(java.lang.String username,
                                   java.lang.String accountId)
                                   throws java.lang.Exception
Get path of node, that contains all folders

Parameters:
username -
accountId -
Returns:
String
Throws:
java.lang.Exception

saveFolder

void saveFolder(java.lang.String username,
                java.lang.String accountId,
                java.lang.String parentId,
                Folder folder)
                throws java.lang.Exception
Save folder to JCR as child of given folder

Parameters:
username -
accountId -
parentId -
folder -
Throws:
java.lang.Exception

getSubFolders

java.util.List<Folder> getSubFolders(java.lang.String username,
                                     java.lang.String accountId,
                                     java.lang.String parentPath)
                                     throws java.lang.Exception
Get all sub folders of the given folder path

Parameters:
username -
accountId -
folderPath -
Returns:
List
Throws:
java.lang.Exception

getReferencedMessages

java.util.List<Message> getReferencedMessages(java.lang.String username,
                                              java.lang.String accountId,
                                              java.lang.String msgPath)
                                              throws java.lang.Exception
Get all referenced messages of give message path

Parameters:
username -
accountId -
msgPath -
Returns:
List
Throws:
java.lang.Exception

getDefaultAccount

Account getDefaultAccount(java.lang.String username)
                          throws java.lang.Exception
Get default account

Parameters:
username -
accountId -
Returns:
Account
Throws:
java.lang.Exception

loadTotalMessage

Message loadTotalMessage(java.lang.String username,
                         java.lang.String accountId,
                         Message msg)
                         throws java.lang.Exception
If the message object didn't load attachment yet, then this method will load it's attachment from JCR and return it's message

Parameters:
username -
accountId -
msg -
Returns:
Message
Throws:
java.lang.Exception

addListenerPlugin

void addListenerPlugin(org.exoplatform.container.component.ComponentPlugin listener)
                       throws java.lang.Exception
Throws:
java.lang.Exception

sendReturnReceipt

boolean sendReturnReceipt(java.lang.String username,
                          java.lang.String accId,
                          java.lang.String msgId,
                          java.util.ResourceBundle res)
                          throws java.lang.Exception
Throws:
java.lang.Exception

updateNumberOfUnreadMessages

boolean updateNumberOfUnreadMessages(java.lang.String username,
                                     java.lang.String accountId,
                                     java.lang.String folderId,
                                     long num)
                                     throws java.lang.Exception
update number of unread message for a folder.

Parameters:
username - - user name
accountId - - account id
folderId - - folder id
num - - new number of unread message
Returns:
Throws:
java.lang.Exception


Copyright © 2012 eXo Platform SAS. All Rights Reserved.