org.jasig.portlet.emailpreview.dao.exchange
Class ExchangeAccountDaoImpl

java.lang.Object
  extended by org.jasig.portlet.emailpreview.dao.exchange.ExchangeAccountDaoImpl

public class ExchangeAccountDaoImpl
extends Object

Data accessor that uses Exchange Web Services to access messages.

Author:
James Wennmacher, jwennmacher@unicon.net

Field Summary
protected static String DELETE_ITEM_SOAP_ACTION
           
protected static String FIND_FOLDER_SOAP_ACTION
           
protected static String FIND_ITEM_SOAP_ACTION
           
protected static String GET_FOLDER_SOAP_ACTION
           
protected static String GET_ITEM_SOAP_ACTION
           
protected static QName REQUEST_SERVER_VERSION_QNAME
           
protected static String ROOT_SOAP_ACTION
           
protected static String UPDATE_ITEM_SOAP_ACTION
           
 
Constructor Summary
ExchangeAccountDaoImpl()
           
 
Method Summary
 void clearAccountSummaryCache(String username, String mailAccount)
           
 void deleteMessages(MailStoreConfiguration storeConfig, String[] uuids)
          Delete the list of messages from Exchange.
 AccountSummary fetchAccountSummaryFromStore(MailStoreConfiguration config, String username, String mailAccount, int start, int max, String folder)
          Performs the heavy-lifting of IEmailAccountService but in a way that exposes Exchange implementation details.
 List<ExchangeFolderDto> getAllUserInboxFolders(MailStoreConfiguration storeConfig)
          Gets all the user's inbox folders.
 EmailMessage getMessage(MailStoreConfiguration storeConfig, String uuid)
          Gets a message from the Exchange server.
 ItemIdType getMessageChangeKey(String uuid, MailStoreConfiguration config)
           
 void setAutoDiscoveryDao(org.jasig.portlet.emailpreview.dao.exchange.IExchangeAutoDiscoverDao autoDiscoveryDao)
           
 void setCredentialsService(IExchangeCredentialsService credentialsService)
           
 void setFolderCache(net.sf.ehcache.Cache folderCache)
           
 void setFolderCacheKeyGenerator(IUsernameCacheKeyGenerator folderCacheKeyGenerator)
           
 void setFolderCacheKeyPrefix(String folderCacheKeyPrefix)
           
 void setIdCache(net.sf.ehcache.Cache idCache)
           
 void setIdCacheKeyGenerator(IMessageCacheKeyGenerator idCacheKeyGenerator)
           
 void setLinkServiceRegistry(ILinkServiceRegistry linkServiceRegistry)
           
 void setMarshaller(org.springframework.oxm.Marshaller marshaller)
           
 void setMessageReadStatus(MailStoreConfiguration storeConfig, String[] uuids, boolean read)
          Sets the isRead status of the indicated messages to the indicated value.
 void setMessageUtils(MessageUtils messageUtils)
           
 void setRegexFoldernameExclusionPatterns(List<String> regexFoldernameExclusionPatterns)
           
 void setWebServiceOperations(org.springframework.ws.client.core.WebServiceOperations webServiceOperations)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT_SOAP_ACTION

protected static final String ROOT_SOAP_ACTION
See Also:
Constant Field Values

FIND_FOLDER_SOAP_ACTION

protected static final String FIND_FOLDER_SOAP_ACTION
See Also:
Constant Field Values

GET_FOLDER_SOAP_ACTION

protected static final String GET_FOLDER_SOAP_ACTION
See Also:
Constant Field Values

FIND_ITEM_SOAP_ACTION

protected static final String FIND_ITEM_SOAP_ACTION
See Also:
Constant Field Values

GET_ITEM_SOAP_ACTION

protected static final String GET_ITEM_SOAP_ACTION
See Also:
Constant Field Values

DELETE_ITEM_SOAP_ACTION

protected static final String DELETE_ITEM_SOAP_ACTION
See Also:
Constant Field Values

UPDATE_ITEM_SOAP_ACTION

protected static final String UPDATE_ITEM_SOAP_ACTION
See Also:
Constant Field Values

REQUEST_SERVER_VERSION_QNAME

protected static final QName REQUEST_SERVER_VERSION_QNAME
Constructor Detail

ExchangeAccountDaoImpl

public ExchangeAccountDaoImpl()
Method Detail

setRegexFoldernameExclusionPatterns

public void setRegexFoldernameExclusionPatterns(List<String> regexFoldernameExclusionPatterns)

setFolderCache

public void setFolderCache(net.sf.ehcache.Cache folderCache)

setFolderCacheKeyGenerator

public void setFolderCacheKeyGenerator(IUsernameCacheKeyGenerator folderCacheKeyGenerator)

setFolderCacheKeyPrefix

public void setFolderCacheKeyPrefix(String folderCacheKeyPrefix)

setIdCache

public void setIdCache(net.sf.ehcache.Cache idCache)

setIdCacheKeyGenerator

public void setIdCacheKeyGenerator(IMessageCacheKeyGenerator idCacheKeyGenerator)

setWebServiceOperations

public void setWebServiceOperations(org.springframework.ws.client.core.WebServiceOperations webServiceOperations)

setLinkServiceRegistry

public void setLinkServiceRegistry(ILinkServiceRegistry linkServiceRegistry)

setMessageUtils

public void setMessageUtils(MessageUtils messageUtils)

setCredentialsService

public void setCredentialsService(IExchangeCredentialsService credentialsService)

setAutoDiscoveryDao

public void setAutoDiscoveryDao(org.jasig.portlet.emailpreview.dao.exchange.IExchangeAutoDiscoverDao autoDiscoveryDao)

setMarshaller

public void setMarshaller(org.springframework.oxm.Marshaller marshaller)

clearAccountSummaryCache

@TriggersRemove(cacheName="inboxCache",
                keyGenerator=@KeyGenerator(name="StringCacheKeyGenerator",properties=@Property(name="includeMethod",value="false")))
public void clearAccountSummaryCache(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,
                                                                                   @PartialCacheKey
                                                                                   String username,
                                                                                   @PartialCacheKey
                                                                                   String mailAccount,
                                                                                   int start,
                                                                                   int max,
                                                                                   String folder)
                                            throws EmailPreviewException
Performs the heavy-lifting of IEmailAccountService but in a way that exposes Exchange implementation details. Caching annotations can be wrapped around these methods.

username - Portal username
mailAccount - Email account
start - Index of the first expected message
max - 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

getMessage

public EmailMessage getMessage(MailStoreConfiguration storeConfig,
                               String uuid)
Gets a message from the Exchange server.

Parameters:
storeConfig - mail configuration
uuid - Message
Returns:
message

getMessageChangeKey

public ItemIdType getMessageChangeKey(String uuid,
                                      MailStoreConfiguration config)

deleteMessages

public void deleteMessages(MailStoreConfiguration storeConfig,
                           String[] uuids)
Delete the list of messages from Exchange.

uuids - uuids if the messages to delete

setMessageReadStatus

public void setMessageReadStatus(MailStoreConfiguration storeConfig,
                                 String[] uuids,
                                 boolean read)
Sets the isRead status of the indicated messages to the indicated value.

uuids - uuids of the messages to change the read status of
read - true to indicate message has been read

getAllUserInboxFolders

public List<ExchangeFolderDto> getAllUserInboxFolders(MailStoreConfiguration storeConfig)
Gets all the user's inbox folders.

Returns:
List of user's folders.


Copyright © 2013 Jasig. All Rights Reserved.