com.atlassian.confluence.plugins.emailgateway.service
Class DefaultEmailThreadConverterService

java.lang.Object
  extended by com.atlassian.confluence.plugins.emailgateway.service.DefaultEmailThreadConverterService
All Implemented Interfaces:
EmailStagingService, StagedEmailThreadAdminService

public class DefaultEmailThreadConverterService
extends java.lang.Object
implements StagedEmailThreadAdminService, EmailStagingService


Constructor Summary
DefaultEmailThreadConverterService(StagedEmailThreadManager stagedEmailThreadManager, UsersByEmailService usersByEmailService, com.atlassian.security.random.SecureTokenGenerator secureTokenGenerator, com.atlassian.event.api.EventPublisher eventPublisher, Blacklist<com.atlassian.user.User> blacklist)
           
 
Method Summary
 int clearExpiredEmailThreads(org.joda.time.DateTime expiry)
          Deletes old email threads from the staging area.
<C extends ContentEntityObject>
C
convertAndPublishStagedEmailThread(StagedEmailThreadKey key, MessageHolder messageHolder, EmailToContentConverter<C> emailToContentConverter)
          Converts an existing StagedEmailThread into a Confluence Page and publishes it.
 void deleteStagedEmailThread(StagedEmailThreadKey key)
          Delete an existing StagedEmailThread from the store.
 StagedEmailThreadKey stageEmailThread(ReceivedEmail receivedEmail, ConfirmationNotificationSender confirmationNotificationSender)
          Stage the given received email.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEmailThreadConverterService

public DefaultEmailThreadConverterService(StagedEmailThreadManager stagedEmailThreadManager,
                                          UsersByEmailService usersByEmailService,
                                          com.atlassian.security.random.SecureTokenGenerator secureTokenGenerator,
                                          com.atlassian.event.api.EventPublisher eventPublisher,
                                          Blacklist<com.atlassian.user.User> blacklist)
Method Detail

stageEmailThread

public StagedEmailThreadKey stageEmailThread(ReceivedEmail receivedEmail,
                                             ConfirmationNotificationSender confirmationNotificationSender)
                                      throws EmailStagingException
Description copied from interface: EmailStagingService
Stage the given received email.

Specified by:
stageEmailThread in interface EmailStagingService
Parameters:
receivedEmail - The received email to be staged.
confirmationNotificationSender - The sender for the relevant confirmation email.
Returns:
The StagedEmailThreadKey representing the staged email.
Throws:
EmailStagingException - If the received email cannot be staged.

clearExpiredEmailThreads

public int clearExpiredEmailThreads(org.joda.time.DateTime expiry)
Description copied from interface: StagedEmailThreadAdminService
Deletes old email threads from the staging area.

Specified by:
clearExpiredEmailThreads in interface StagedEmailThreadAdminService
Parameters:
expiry - the cut-off date for which any threads older will be deleted
Returns:
the number of threads removed

convertAndPublishStagedEmailThread

public <C extends ContentEntityObject> C convertAndPublishStagedEmailThread(StagedEmailThreadKey key,
                                                                            MessageHolder messageHolder,
                                                                            EmailToContentConverter<C> emailToContentConverter)
Description copied from interface: StagedEmailThreadAdminService
Converts an existing StagedEmailThread into a Confluence Page and publishes it.

Specified by:
convertAndPublishStagedEmailThread in interface StagedEmailThreadAdminService
Parameters:
key - The key used to locate the StagedEmailThread
messageHolder - The collector for any status messages that should be shown to the user
emailToContentConverter - The converter to use in publishing the staged email
Returns:
A representation of the newly published content

deleteStagedEmailThread

public void deleteStagedEmailThread(StagedEmailThreadKey key)
Description copied from interface: StagedEmailThreadAdminService
Delete an existing StagedEmailThread from the store.

Specified by:
deleteStagedEmailThread in interface StagedEmailThreadAdminService
Parameters:
key - The key used to locate the StagedEmailThread


Copyright © 2003-2014 Atlassian. All Rights Reserved.