|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MailService
MailService - The mail service to obtain both an appropriate instance of MailAccess for accessing mail system and an
appropriate instance of MailTransport for sending mails.
| Method Summary | |
|---|---|
MailAccess<?,?> |
getMailAccess(com.openexchange.session.Session session,
int accountId)
Gets an appropriate instance of mail access parameterized with given session. |
MailTransport |
getMailTransport(com.openexchange.session.Session session,
int accountId)
Gets an appropriate instance of mail transport parameterized with given session. |
| Method Detail |
|---|
MailAccess<?,?> getMailAccess(com.openexchange.session.Session session,
int accountId)
throws MailException
mail access parameterized with given session.
When starting to work with obtained mail access at first its MailAccess.connect() method is supposed to be invoked.
On finished work the final MailAccess.close(boolean) must be called in order to release resources:
final MailAccess mailAccess = mailService.getMailAccess(session);
mailAccess.connect();
try {
// Do something
} finally {
mailAccess.close(putToCache)
}
session - The sessionaccountId - The account ID
MailAccess
MailException - If an appropriate instance of mail access cannot be initialized
MailTransport getMailTransport(com.openexchange.session.Session session,
int accountId)
throws MailException
mail transport parameterized with given session.
Note: Don't forget to call final MailTransport.close() on obtained mail transport:
final MailTransport mailTransport = mailService.getMailTransport(session);
try {
// Do something
} finally {
mailTransport.close();
}
session - The session providing needed user dataaccountId - The account ID
MailTransport
MailException - If an appropriate instance of mail transport cannot be initialized
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||