Class MailFetcherService
java.lang.Object
com.atlassian.jira.service.AbstractService
com.atlassian.jira.service.services.file.AbstractMessageHandlingService
com.atlassian.jira.service.services.mail.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.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.atlassian.jira.service.services.file.AbstractMessageHandlingService
AbstractMessageHandlingService.HandlerDisablementListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Longprotected static final Stringstatic final Stringstatic final Stringstatic final Stringprotected Longstatic final StringFields inherited from class com.atlassian.jira.service.services.file.AbstractMessageHandlingService
KEY_HANDLER, KEY_HANDLER_PARAMS, MAX_READ_MESSAGES_DRY_RUNFields inherited from class com.atlassian.jira.service.AbstractService
log, name, SERVICE_EVENTFields inherited from interface com.atlassian.jira.service.JiraService
NAME_COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.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 Summary
Modifier and TypeMethodDescriptionprotected StringaddHandlerInfo(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.protected org.apache.log4j.Loggerprotected com.atlassian.jira.service.services.mail.MailFetcherService.MailProcessModegetMailProcessMode(com.atlassian.mail.MailProtocol mailProtocol, FeatureManager featureManager) Retrieves an object configuration object with properties that can be setvoidinit(com.opensymphony.module.propertyset.PropertySet props) Initialise the service.voidinit(com.opensymphony.module.propertyset.PropertySet props, long configurationIdentifier) Initialise the service passing configuration identifier which is unique per configuration of the service.protected booleanprotected voidrunImpl(MessageHandlerContext context) Connect to the POP / IMAPemail box and then handle each message.Methods inherited from class com.atlassian.jira.service.services.file.AbstractMessageHandlingService
asString, destroy, getHandler, run, setContextMethods inherited from class com.atlassian.jira.service.AbstractService
getDefaultProperty, getDescription, getKey, getLongProperty, getName, getObjectConfiguration, getProperties, getProperty, getTextProperty, hasProperty, isInternal, isUnique, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.configurable.ObjectConfigurable
getDefaultProperty, getKey, getLongProperty, getProperties, getProperty, getTextProperty, hasProperty
-
Field Details
-
KEY_MAIL_SERVER
- See Also:
-
mailserverId
-
configurationIdentifier
-
FORWARD_EMAIL
- See Also:
-
DEFAULT_FOLDER
- See Also:
-
FOLDER_NAME_KEY
- See Also:
-
MARK_AS_SEEN_KEY
- See Also:
-
-
Constructor Details
-
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:JiraServiceInitialise 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:
initin interfaceJiraService- Parameters:
props- initialisation parametersconfigurationIdentifier- 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:JiraServiceInitialise 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:
initin interfaceJiraService- Overrides:
initin classAbstractMessageHandlingService- 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
Connect to the POP / IMAPemail box and then handle each message.- Specified by:
runImplin classAbstractMessageHandlingService
-
isMarkAsSeen
protected boolean isMarkAsSeen() -
addHandlerInfo
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:
addHandlerInfoin classAbstractMessageHandlingService- Parameters:
msg- log message- Returns:
- log message decorated with handler name and mail server ID
-
getObjectConfiguration
Description copied from interface:ObjectConfigurableRetrieves an object configuration object with properties that can be set- Specified by:
getObjectConfigurationin interfaceObjectConfigurable- Returns:
- ObjectConfiguration object
- Throws:
ObjectConfigurationException
-
getLogger
protected org.apache.log4j.Logger getLogger()- Specified by:
getLoggerin classAbstractMessageHandlingService
-