|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.petals.bc.mail.MailSessionManager
public class MailSessionManager
This manager can be used to manage session with mail servers : create and open sessions, send and receive mails
| Field Summary | |
|---|---|
protected java.util.logging.Logger |
log
|
| Constructor Summary | |
|---|---|
MailSessionManager(java.util.logging.Logger log)
|
|
| Method Summary | |
|---|---|
void |
closeFolderAndStore(javax.mail.Folder folder,
javax.mail.Store store,
boolean expunge)
Close previously opened folder and store. |
javax.mail.Session |
createSessionPropertiesFromDescriptor(ConsumeDescriptor consumeDescriptor)
Create a Properties object with given properties. |
javax.mail.Session |
createSessionPropertiesFromDescriptor(ProvideDescriptor provideDescriptor)
Create a Properties object with given properties. |
javax.mail.Folder |
getFolderAndOpen(javax.mail.Store store,
ConsumeDescriptor consumeDescriptor)
Retrieve a specified Folder from the given Store and open
it. |
java.util.List<javax.mail.Message> |
getNewMails(javax.mail.Folder folder)
Retrieve new mails into the given folder. |
javax.mail.Store |
getStoreAndConnect(javax.mail.Session session,
ConsumeDescriptor consumeDescriptor)
Retrieve a Store from the given Session. |
void |
sendMail(javax.mail.internet.MimeMessage mimeMessage,
ProvideDescriptor sessionDescriptor,
javax.mail.Session session)
Send an email based on the given MimeMessage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.logging.Logger log
| Constructor Detail |
|---|
public MailSessionManager(java.util.logging.Logger log)
log - the component logger| Method Detail |
|---|
public void closeFolderAndStore(javax.mail.Folder folder,
javax.mail.Store store,
boolean expunge)
folder - the folder to closestore - the store to closeexpunge - public javax.mail.Session createSessionPropertiesFromDescriptor(ProvideDescriptor provideDescriptor)
Properties object with given properties. Then create a
new Session initialized with the given properties
consumeDescriptor - a SessionDescriptor build from an address URI
Sessionpublic javax.mail.Session createSessionPropertiesFromDescriptor(ConsumeDescriptor consumeDescriptor)
Properties object with given properties. Then create a
new Session initialized with the given properties
consumeDescriptor - a SessionDescriptor build from an address URI
Session
public javax.mail.Folder getFolderAndOpen(javax.mail.Store store,
ConsumeDescriptor consumeDescriptor)
throws javax.mail.MessagingException
Folder from the given Store and open
it.
store - the mail StoreconsumeDescriptor - the mail SessionDescriptor
Folder
javax.mail.MessagingException
public java.util.List<javax.mail.Message> getNewMails(javax.mail.Folder folder)
throws javax.mail.MessagingException
folder - the folder used to search for new mail
javax.mail.MessagingException
public javax.mail.Store getStoreAndConnect(javax.mail.Session session,
ConsumeDescriptor consumeDescriptor)
throws javax.mail.MessagingException
Store from the given Session. Then connect to it.
session - the mail SessionconsumeDescriptor - the SessionDescriptor associated to this session
Store
javax.mail.MessagingException
javax.jbi.JBIException - if error occurs during mail Store retrieval
public void sendMail(javax.mail.internet.MimeMessage mimeMessage,
ProvideDescriptor sessionDescriptor,
javax.mail.Session session)
throws javax.mail.MessagingException
mimeMessage - the MimeMessage to send. The resulting email will
conform to the RFC822 and MIME standardssessionDescriptor - a SessionDescriptor build from an address URIsession - the mail Session
javax.mail.MessagingException - if error occurs during message sendingTransport.send(javax.mail.Message);
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||