com.atlassian.jira.service.services.mail
Class MailFetcherService

java.lang.Object
  extended by com.atlassian.jira.service.AbstractService
      extended by com.atlassian.jira.service.services.file.AbstractMessageHandlingService
          extended by 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 hopefuly 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
protected static String DEFAULT_FOLDER
           
static String FOLDER_NAME_KEY
           
static String FORWARD_EMAIL
           
static String KEY_MAIL_SERVER
           
protected  Long mailserverId
           
 
Fields inherited from class com.atlassian.jira.service.services.file.AbstractMessageHandlingService
KEY_HANDLER, KEY_HANDLER_PARAMS, MAX_READ_MESSAGES_DRY_RUN
 
Fields inherited from class com.atlassian.jira.service.AbstractService
name, SERVICE_EVENT
 
Fields inherited from interface com.atlassian.jira.service.JiraService
NAME_COMPARATOR
 
Constructor Summary
MailFetcherService()
           
 
Method Summary
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.
protected  String getFolderName(com.atlassian.mail.server.MailServer server)
           
protected  org.apache.log4j.Logger getLogger()
           
 ObjectConfiguration getObjectConfiguration()
          Retrieves an object configuration object with properties that can be set
protected  int getPort(com.atlassian.mail.server.MailServer server)
           
 void init(com.opensymphony.module.propertyset.PropertySet props)
          Initialise the service.
protected  void runImpl(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, setContext
 
Methods inherited from class com.atlassian.jira.service.AbstractService
getDefaultProperty, getDescription, getKey, getLongProperty, getName, getObjectConfiguration, getProperties, getProperty, getTextProperty, hasProperty, isInternal, isUnique, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.configurable.ObjectConfigurable
getDefaultProperty, getKey, getLongProperty, getProperties, getProperty, getTextProperty, hasProperty
 

Field Detail

KEY_MAIL_SERVER

public static final String KEY_MAIL_SERVER
See Also:
Constant Field Values

mailserverId

protected Long mailserverId

FORWARD_EMAIL

public static final String FORWARD_EMAIL
See Also:
Constant Field Values

DEFAULT_FOLDER

protected static final String DEFAULT_FOLDER
See Also:
Constant Field Values

FOLDER_NAME_KEY

public static final String FOLDER_NAME_KEY
See Also:
Constant Field Values
Constructor Detail

MailFetcherService

public MailFetcherService()
Method Detail

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

getPort

protected int getPort(com.atlassian.mail.server.MailServer server)

runImpl

protected void runImpl(MessageHandlerContext context)
Connect to the POP / IMAPemail box and then handle each message.

Specified by:
runImpl in class AbstractMessageHandlingService

getFolderName

protected String getFolderName(com.atlassian.mail.server.MailServer server)

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


Copyright © 2002-2014 Atlassian. All Rights Reserved.