org.jasig.portlet.emailpreview.dao.javamail
Class JavamailAccountDaoImpl
java.lang.Object
org.jasig.portlet.emailpreview.dao.javamail.JavamailAccountDaoImpl
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
@Component
public final class JavamailAccountDaoImpl
- extends Object
- implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
This class does the heavy-lifting for Javamail integration and implements the
caching.
- Author:
- awills
|
Method Summary |
void |
afterPropertiesSet()
|
void |
clearCache(String username,
String mailAccount)
|
AccountSummary |
fetchAccountSummaryFromStore(MailStoreConfiguration config,
javax.mail.Authenticator auth,
String username,
String mailAccount,
int start,
int max)
Performs the heavy-lifting of IEmailAccountService but in a way
that exposes Javamail implementation details. |
javax.mail.Folder |
getUserInbox(javax.mail.Session session,
String folderName)
|
javax.mail.Session |
openMailSession(MailStoreConfiguration config,
javax.mail.Authenticator auth)
|
void |
setApplicationContext(org.springframework.context.ApplicationContext ctx)
|
void |
setSecurityFile(String path)
Set the file path to the Anti-samy policy file to be used for cleaning
strings. |
EmailMessage |
wrapMessage(javax.mail.Message msg,
boolean populateContent,
javax.mail.Session session)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavamailAccountDaoImpl
public JavamailAccountDaoImpl()
setSecurityFile
public void setSecurityFile(String path)
- Set the file path to the Anti-samy policy file to be used for cleaning
strings.
- Parameters:
path -
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext ctx)
throws org.springframework.beans.BeansException
- Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
- Throws:
Exception
clearCache
@TriggersRemove(cacheName="inboxCache",
keyGenerator=@KeyGenerator(name="StringCacheKeyGenerator",properties=@Property(name="includeMethod",value="false")))
public void clearCache(String username,
String mailAccount)
fetchAccountSummaryFromStore
@Cacheable(cacheName="inboxCache",
selfPopulating=true,
keyGenerator=@KeyGenerator(name="StringCacheKeyGenerator",properties=@Property(name="includeMethod",value="false")))
public AccountSummary fetchAccountSummaryFromStore(MailStoreConfiguration config,
javax.mail.Authenticator auth,
@PartialCacheKey
String username,
@PartialCacheKey
String mailAccount,
int start,
int max)
throws EmailPreviewException
- Performs the heavy-lifting of
IEmailAccountService but in a way
that exposes Javamail implementation details. Caching annotations can be
wrapped around these methods.
username - Portal usernamemailAccount - Email accountstart - Index of the first expected messagemax - Maximum size of the collection of messages in the
returned AccountSummary object
- Returns:
- A representation of mail account details suitable for displaying
in the view
- Throws:
EmailPreviewException
openMailSession
public javax.mail.Session openMailSession(MailStoreConfiguration config,
javax.mail.Authenticator auth)
getUserInbox
public javax.mail.Folder getUserInbox(javax.mail.Session session,
String folderName)
throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
wrapMessage
public EmailMessage wrapMessage(javax.mail.Message msg,
boolean populateContent,
javax.mail.Session session)
throws javax.mail.MessagingException,
IOException,
org.owasp.validator.html.ScanException,
org.owasp.validator.html.PolicyException
- Throws:
javax.mail.MessagingException
IOException
org.owasp.validator.html.ScanException
org.owasp.validator.html.PolicyException
Copyright © 2012 Jasig. All Rights Reserved.