| com.ivata.groupware.business.mail.Mail
All known Subclasses: com.ivata.groupware.business.mail.MailImpl,
Mail | public interface Mail (Code) | | This mail interface provides a common interface to all mail features and
functionality.
author: Colin MacLeod author: colin.macleod@ivata.com since: ivata groupware 0.11 (Mar 27, 2004) version: $Revision: 1.4 $ |
Field Summary | |
String | BUNDLE_PATH Used to identify the message resources bundle related to system mail. |
Method Summary | |
MessageDO | addMessageToDraftsFolder(MailSession mailSession, MessageDO messageDO) Add a composed message to the drafts folder for later sending.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: messageDO - data object containing full details of themessage to be added to the drafts. | void | addUserAliasEmailAddresses(SecuritySession securitySession, String userName, Collection userAliases, Collection telecomAddresses, String emailAddressHost)
Add appropriate user addresses given a list of user aliases.
Parameters: securitySession - valid security session. Parameters: userName - name of the user who owns teh aliases. Parameters: userAliases - a Collection of String instances containing the local part of the different email aliasesthis user has. | MessageDO | appendAttachments(MailSession mailSession, String id, List attachments) Append attachments to a message located in the drafts folder.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: id - the unique identifier of the message to which we want to appendattachments. Parameters: attachments - Vector of String s -filenames of files waiting in upload directory. | void | createFolder(MailSession mailSession, String folderName) | MessageDO | createThreadMessage(MailSession mailSession, String folderName, List messageIds, Integer thread) Create a new message in the drafts folder from an existing one,
based on a 'thread'. | void | deleteMessagesFromTrash(MailSession mailSession, List ids) | boolean | doesFolderExist(MailSession mailSession, String folderName) Check whether or not a given folder pathname exists.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: folderName - the full path name of the folder to check. | MessageDO | findMessageByFolderMessageId(MailSession mailSession, String folderName, String id) This method retrieves the requested message and sets all the
attributes of a MessageDO object for use on client side.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: folderName - the name of the folder the message is located in. Parameters: id - the unique identifier of the message. | List | findMessagesInFolder(MailSession mailSession, String folderName, Integer sortBy, boolean sortAscending) Used in the main folder index page, this method returns the contents
of a folder as a Vector of
MessageDO instances.
Note: for efficiency reasons, this method does not
fill the text, format or attachment values of the returned
MessageDO instance. | FileContentDO | getAttachment(MailSession mailSession, String folderName, String messageId, String attachmentId) Retrieve an attachment's content and it's MimeType. | List | getUserAliases(SecuritySession securitySession, String userName) Retrieve all of the email aliases for the user provided, on the curent
email server. | String | getVacationMessage(SecuritySession securitySession, String userName) Get the vacation message for the user provided.
The vacation message is a text the user can set, which will be sent
to all emails received at this address while the user is not present.
Parameters: securitySession - Used to authenticate the current system user. Parameters: userName - the name of the user for whom to get the vacationmessage. | boolean | hasNewMessages(SecuritySession securitySession, String userName, String folderName) Get the time the specified mail folder was last modified as a
long . | MailSession | login(UserDO user, String password) Login to the mail system. | void | moveMessages(MailSession mailSession, String folderName, List ids, String targetFolderName) | void | send(MailSession mailSession, MessageDO messageDO) Send a mime email message that is already composed. | void | send(MailSession mailSession, String fromAddress, Collection to, String subject, Object content, String contentType, boolean addToSentFolder) Send an mime email message without using a data object.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: fromAddress - the address of the person sending the mail. | void | setUserAliases(SecuritySession securitySession, String userName, Collection userAliases) Set all of the email aliases for the user provided, on the curent
email server. | void | setVacationMessage(SecuritySession securitySession, String userName, String vacationMessage) Set the vacation message for the user provided.
The vacation message is a text the user can set, which will be sent
to all emails received at this address while the user is not present.
Parameters: securitySession - Used to authenticate the current system user. Parameters: userName - the name of the user for whom to get the vacationmessage. Parameters: vacationMessage - vacation message text for this user. | ValidationErrors | validate(SecuritySession securitySession, MessageDO messageDO) Confirm all of the elements of the message are present and valid,
before the message is sent.
Parameters: securitySession - Used to authenticate the current system user. Parameters: messageDO - data object to check for consistency andcompleteness. |
BUNDLE_PATH | String BUNDLE_PATH(Code) | | Used to identify the message resources bundle related to system mail.
|
addMessageToDraftsFolder | MessageDO addMessageToDraftsFolder(MailSession mailSession, MessageDO messageDO) throws SystemException(Code) | | Add a composed message to the drafts folder for later sending.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: messageDO - data object containing full details of themessage to be added to the drafts. new MessageDO with the id set to thecurrent value in the mail system. throws: SystemException - If the message cannot be added for any reason. |
addUserAliasEmailAddresses | void addUserAliasEmailAddresses(SecuritySession securitySession, String userName, Collection userAliases, Collection telecomAddresses, String emailAddressHost) throws SystemException(Code) | |
Add appropriate user addresses given a list of user aliases.
Parameters: securitySession - valid security session. Parameters: userName - name of the user who owns teh aliases. Parameters: userAliases - a Collection of String instances containing the local part of the different email aliasesthis user has. If the user has no aliaes, an empty collection shouldbe provided. Parameters: telecomAddresses - a Collection containing all theuser's existing email addresses, as TelecomAddressDO instances. Parameters: emailAddressHost - Appended to user aliases plus the at sign toform email addresses. throws: SystemException - If the alias addresses cannot be added for anyreason. |
appendAttachments | MessageDO appendAttachments(MailSession mailSession, String id, List attachments) throws SystemException(Code) | | Append attachments to a message located in the drafts folder.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: id - the unique identifier of the message to which we want to appendattachments. Parameters: attachments - Vector of String s -filenames of files waiting in upload directory. null when the operation failed, otherwise the newmessage id. exception: SystemException - if the folder doesn't exist, or thereis no matching mail in this folder. |
createFolder | void createFolder(MailSession mailSession, String folderName) throws SystemException(Code) | | Create a new mail folder.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: folderName - the full path name of the folder to create. throws: SystemException - If the folder cannot be created. |
createThreadMessage | MessageDO createThreadMessage(MailSession mailSession, String folderName, List messageIds, Integer thread) throws SystemException(Code) | | Create a new message in the drafts folder from an existing one,
based on a 'thread'. The thread indicates that the message is a:
- reply to all recipients of a previous message
- reply to one recipient of a previous message
- previous message(s) forwarded to new recipients
- an existing (draft) message being altered for resending
This new message in the drafts folder can then be used to store
attachments or for reviewing before sending.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: folderName - the name of the folder to copy existing messages from. Parameters: messageIds - the unique identifier of the messages to be extended.Can be null if a new message is requeested. Whenforwarding, multiple address identifiers may be specified otherwise(if editing a draft message or replying) only one message identifiershould be set in the list. Parameters: thread - set to one of the constants in MailConstantsMailConstants. populated message data object matching the requiredmessage, and with the id set to the message in thedrafts folder. throws: SystemException - if the message cannot be created. |
deleteMessagesFromTrash | void deleteMessagesFromTrash(MailSession mailSession, List ids) throws SystemException(Code) | | Delete a list of messages from the trash folder.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: ids - the unique identifiers (String instances) of themessages to be removed. exception: SystemException - if the folder doesn't exist, or thereis no matching mail in this folder. |
doesFolderExist | boolean doesFolderExist(MailSession mailSession, String folderName) throws SystemException(Code) | | Check whether or not a given folder pathname exists.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: folderName - the full path name of the folder to check. true if the folder exists,otherwise false . throws: SystemException - If the information cannot be accessed. |
findMessageByFolderMessageId | MessageDO findMessageByFolderMessageId(MailSession mailSession, String folderName, String id) throws SystemException(Code) | | This method retrieves the requested message and sets all the
attributes of a MessageDO object for use on client side.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: folderName - the name of the folder the message is located in. Parameters: id - the unique identifier of the message. a MessageDO instance filled up with the messages attributes,except the contents of the attachments. exception: SystemException - if the folder doesn't exist, or thereis no matching mail in this folder. |
findMessagesInFolder | List findMessagesInFolder(MailSession mailSession, String folderName, Integer sortBy, boolean sortAscending) throws SystemException(Code) | | Used in the main folder index page, this method returns the contents
of a folder as a Vector of
MessageDO instances.
Note: for efficiency reasons, this method does not
fill the text, format or attachment values of the returned
MessageDO instance. For that, you must call
Mail.findMessageByFolderMessageId findMessageByFolderMessageId .
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: folderName - the name of the folder to list. Parameters: sortBy - the field to sort the returned list by. Set to one of theSORT_... constants in MailConstants MailConstants. Parameters: sortAscending - if true then the messages are sorted inascending order, otherwise (false ) they are descending. List ofMessageDO instances. throws: SystemException - If the message cannot be accessed for any reason. |
getAttachment | FileContentDO getAttachment(MailSession mailSession, String folderName, String messageId, String attachmentId) throws SystemException(Code) | | Retrieve an attachment's content and it's MimeType. This method is
used to by the download servlet.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: folderName - the name of the folder the message is located in. Parameters: messageId - the unique identifier of the message. Parameters: attachmentId - the unique identifier of the attachment. attachment data object containing attachment contentand mime type. exception: SystemException - if the folder doesn't exist, or thereis no matching mail in this folder. |
getUserAliases | List getUserAliases(SecuritySession securitySession, String userName) throws SystemException(Code) | | Retrieve all of the email aliases for the user provided, on the curent
email server. The aliases returned each one containing just the 'user'
(or 'local') part of the email address, before the '@' sign.
Parameters: securitySession - Used to authenticate the current system user. Parameters: userName - the name of the user for whom to retrieve the emailaliases. a List of String instances containingthe local part of the different email aliases this user has. If the userhas no aliaes, an empty collection is returned. throws: SystemException - if the user name is null , or thealiases cannot be accessed for any reason. |
getVacationMessage | String getVacationMessage(SecuritySession securitySession, String userName) throws SystemException(Code) | | Get the vacation message for the user provided.
The vacation message is a text the user can set, which will be sent
to all emails received at this address while the user is not present.
Parameters: securitySession - Used to authenticate the current system user. Parameters: userName - the name of the user for whom to get the vacationmessage. the vacation message text for this user. If the user has novacation message set, null is returned. throws: SystemException - If the vacation message cannot be retrieved forany reason. |
hasNewMessages | boolean hasNewMessages(SecuritySession securitySession, String userName, String folderName) throws SystemException(Code) | | Get the time the specified mail folder was last modified as a
long . This can then be saved and compared to subsequent
calls of this method to see if the folder has changed.
Parameters: securitySession - Used to authenticate the current site user. Parameters: userName - the name of the user for whom to locate the folder. Parameters: folderName - the name of the folder to locate. operating system specific timestamp indicating when thefolder was last changed. throws: SystemException - If the messages cannot be accessed for anyreason. |
login | MailSession login(UserDO user, String password) throws SystemException(Code) | | Login to the mail system. This method should be called before any
other, to establish the mail session and store.
Parameters: user - The user who should be logged into the system. Parameters: password - The clear-text password to log into the remote system. throws: SystemException - if the person cannot log in for any reason. the mail session (class Session ) in aSessionSerializer . |
moveMessages | void moveMessages(MailSession mailSession, String folderName, List ids, String targetFolderName) throws SystemException(Code) | | Move a list of messages from one folder to another.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: folderName - the name of the folder the messages are currentlylocated in. Parameters: ids - the unique identifiers (String instances) of themessages to be moved. Parameters: targetFolderName - the name of the the folder the message will bemoved to. exception: SystemException - if the folder doesn't exist, or thereis no matching mail in this folder. |
send | void send(MailSession mailSession, MessageDO messageDO) throws SystemException(Code) | | Send a mime email message that is already composed. If id
has been set in messageDO it is assumed to point to a
message in the drafts folder. Attachments are copied from the message
who match the contents of getAttachmentIds . (All other
attachments are discarded.)
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: messageDO - data object containing full details of themessage to be sent. throws: SystemException - If the message cannot be sent for any reason. |
send | void send(MailSession mailSession, String fromAddress, Collection to, String subject, Object content, String contentType, boolean addToSentFolder) throws SystemException(Code) | | Send an mime email message without using a data object.
Parameters: mailSession - valid mail session to which the user should already belogged in. Parameters: fromAddress - the address of the person sending the mail. This mustbe formatted according to RFC822. Parameters: to - recipients, a Collection containing instances ofString or UserLocal orPersonLocal . A mixture of these types is allowed. If thetype of an instance is String , then it must be formattedaccording to RFC822.Otherwise, if the type is PersonLocal , the methodgetEmailAddress must return a valid address string forthis person. Parameters: subject - clear-text email subject field. Parameters: content - any valid email content type, as defined byMimeMessage . Parameters: contentType - mime type for the content field, asdefined by MimeMessage . Parameters: addToSentFolder - if set to true then the mail is addedto the sent folder of the current email session. throws: SystemException - If the message cannot be sent for any reason. |
setUserAliases | void setUserAliases(SecuritySession securitySession, String userName, Collection userAliases) throws SystemException(Code) | | Set all of the email aliases for the user provided, on the curent
email server. Each alias in the collection should contain just the 'user'
(or 'local') part of the email address, before the '@' sign.
Parameters: securitySession - Used to authenticate the current system user. Parameters: userName - the name of the user for whom to retrieve the emailaliases. Parameters: userAliases - a Collection of String instances containing the local part of the different email aliasesthis user has. If the user has no aliaes, an empty collection shouldbe provided. throws: SystemException - If the aliases cannot be set for any reason. |
setVacationMessage | void setVacationMessage(SecuritySession securitySession, String userName, String vacationMessage) throws SystemException(Code) | | Set the vacation message for the user provided.
The vacation message is a text the user can set, which will be sent
to all emails received at this address while the user is not present.
Parameters: securitySession - Used to authenticate the current system user. Parameters: userName - the name of the user for whom to get the vacationmessage. Parameters: vacationMessage - vacation message text for this user. If the userhas no vacation message set, set to null . throws: SystemException - If the vacation message cannot be set for anyreason. |
validate | ValidationErrors validate(SecuritySession securitySession, MessageDO messageDO) throws SystemException(Code) | | Confirm all of the elements of the message are present and valid,
before the message is sent.
Parameters: securitySession - Used to authenticate the current system user. Parameters: messageDO - data object to check for consistency andcompleteness. a collection of validation errors if any of themandatory fields are missing, or if fields contain invalid values. throws: SystemException - If the message is invalid in any way. |
|
|