Java Doc for Mail.java in  » Groupware » ivatagroupware » com » ivata » groupware » business » mail » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Groupware » ivatagroupware » com.ivata.groupware.business.mail 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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
 StringBUNDLE_PATH
     Used to identify the message resources bundle related to system mail.


Method Summary
 MessageDOaddMessageToDraftsFolder(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.
 voidaddUserAliasEmailAddresses(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 Stringinstances containing the local part of the different email aliasesthis user has.
 MessageDOappendAttachments(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 Strings -filenames of files waiting in upload directory.
 voidcreateFolder(MailSession mailSession, String folderName)
    
 MessageDOcreateThreadMessage(MailSession mailSession, String folderName, List messageIds, Integer thread)
    

Create a new message in the drafts folder from an existing one, based on a 'thread'.

 voiddeleteMessagesFromTrash(MailSession mailSession, List ids)
    
 booleandoesFolderExist(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.
 MessageDOfindMessageByFolderMessageId(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.
 ListfindMessagesInFolder(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.

 FileContentDOgetAttachment(MailSession mailSession, String folderName, String messageId, String attachmentId)
    

Retrieve an attachment's content and it's MimeType.

 ListgetUserAliases(SecuritySession securitySession, String userName)
    

Retrieve all of the email aliases for the user provided, on the curent email server.

 StringgetVacationMessage(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.
 booleanhasNewMessages(SecuritySession securitySession, String userName, String folderName)
    

Get the time the specified mail folder was last modified as a long.

 MailSessionlogin(UserDO user, String password)
    

Login to the mail system.

 voidmoveMessages(MailSession mailSession, String folderName, List ids, String targetFolderName)
    
 voidsend(MailSession mailSession, MessageDO messageDO)
    

Send a mime email message that is already composed.

 voidsend(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.
 voidsetUserAliases(SecuritySession securitySession, String userName, Collection userAliases)
    

Set all of the email aliases for the user provided, on the curent email server.

 voidsetVacationMessage(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.
 ValidationErrorsvalidate(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.

Field Detail
BUNDLE_PATH
String BUNDLE_PATH(Code)
Used to identify the message resources bundle related to system mail.





Method Detail
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 Stringinstances 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 TelecomAddressDOinstances.
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 Strings -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 Stringinstances 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.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.