Class MailFetcherService

All Implemented Interfaces:
ObjectConfigurable, JiraService, Runnable

@Internal public class MailFetcherService extends AbstractMessageHandlingService implements ObjectConfigurable
Mail fetcher for both POP and IMAP protocols. This class is going to be hopefully moved to JIRA Mail Plugin.
  • Field Details

  • Constructor Details

    • MailFetcherService

      @Deprecated public MailFetcherService()
      Deprecated.
    • MailFetcherService

      public MailFetcherService(com.atlassian.jira.service.services.mail.MailFetcherService.ErrorEmailForwarder errorEmailForwarder, com.atlassian.jira.service.services.mail.MailFetcherService.MessageProvider messageProvider, MailReaderFactory mailReaderFactory, MailSettings.Fetch settings, com.atlassian.jira.service.services.mail.DeadLetterStore deadLetterStore, com.atlassian.beehive.ClusterLockService clusterLockService, FeatureManager featureManager, MailboxCleanupPause mailboxCleanupPause)
  • Method Details

    • init

      public void init(com.opensymphony.module.propertyset.PropertySet props, long configurationIdentifier) throws ObjectConfigurationException
      Description copied from interface: JiraService
      Initialise the service passing configuration identifier which is unique per configuration of the service.

      As the parameters are gained from the user's interaction with the website, it is not guaranteed to be called with the correct, or indeed with any parameters.

      this method may be called multiple times during the services lifetime.

      Specified by:
      init in interface JiraService
      Parameters:
      props - initialisation parameters
      configurationIdentifier - identifier of the configuration of the service
      Throws:
      ObjectConfigurationException - in case of an error with initialisation parameters
    • init

      public void init(com.opensymphony.module.propertyset.PropertySet props) throws ObjectConfigurationException
      Description copied from interface: JiraService
      Initialise the service. This method is guaranteed to be called before the first call to run().

      As the parameters are gained from the user's interaction with the website, it is not guaranteed to be called with the correct, or indeed with any parameters.

      init() may be called multiple times during the services lifetime.

      Specified by:
      init in interface JiraService
      Overrides:
      init in class AbstractMessageHandlingService
      Parameters:
      props - initialisation parameters
      Throws:
      ObjectConfigurationException - in case of an error with initialisation parameters
      See Also:
    • getMailProcessMode

      protected com.atlassian.jira.service.services.mail.MailFetcherService.MailProcessMode getMailProcessMode(com.atlassian.mail.MailProtocol mailProtocol, FeatureManager featureManager)
    • runImpl

      protected void runImpl(MessageHandlerContext context)
      Connect to the POP / IMAPemail box and then handle each message.
      Specified by:
      runImpl in class AbstractMessageHandlingService
    • isMarkAsSeen

      protected boolean isMarkAsSeen()
    • addHandlerInfo

      protected String addHandlerInfo(String msg)
      JRA-13590 Small decorator to add the service handler name and the mail service ID to log messages to make it easier if you have multiple services configured to determine which one is throwing exceptions.
      Specified by:
      addHandlerInfo in class AbstractMessageHandlingService
      Parameters:
      msg - log message
      Returns:
      log message decorated with handler name and mail server ID
    • getObjectConfiguration

      public ObjectConfiguration getObjectConfiguration() throws ObjectConfigurationException
      Description copied from interface: ObjectConfigurable
      Retrieves an object configuration object with properties that can be set
      Specified by:
      getObjectConfiguration in interface ObjectConfigurable
      Returns:
      ObjectConfiguration object
      Throws:
      ObjectConfigurationException
    • getLogger

      protected org.apache.log4j.Logger getLogger()
      Specified by:
      getLogger in class AbstractMessageHandlingService