|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.james.fetchmail.FetchMail
public class FetchMail
Class FetchMail
is an Avalon task that is periodically
triggered to fetch mail from a JavaMail Message Store.
The lifecycle of an instance of FetchMail
is managed by
Avalon. The configure(Configuration)
method is invoked to parse
and validate Configuration properties. The targetTriggered(String) method is
invoked to execute the task.
When triggered, a sorted list of Message Store Accounts to be processed is
built. Each Message Store Account is processed by delegating to
StoreProcessor
.
There are two kinds of Message Store Accounts, static and dynamic. Static
accounts are expliciltly declared in the Configuration. Dynamic accounts are
built each time the task is executed, one per each user defined to James,
using the James user name with a configurable prefix and suffix to define
the host user identity and recipient identity for each Account. Dynamic
accounts allow FetchMail
to fetch mail for all James users
without modifying the Configuration parameters or restarting the Avalon
server.
To fully understand the operations supported by this task, read the Class
documention for each Class in the delegation chain starting with this
class' delegate, StoreProcessor
.
Creation Date: 24-May-03
Constructor Summary | |
---|---|
FetchMail()
Constructor for POP3mail. |
Method Summary | |
---|---|
protected java.util.Map |
computeDynamicAccounts()
Computes the dynamicAccounts. |
protected java.util.Map |
computeDynamicAccounts(java.util.Map oldAccounts,
org.apache.james.fetchmail.FetchMail.ParsedDynamicAccountParameters parameters)
Compute the dynamicAccounts for the passed parameters. |
protected java.util.List |
computeParsedDynamicAccountParameters()
Computes the ParsedDynamicAccountParameters. |
protected javax.mail.Session |
computeSession()
Answers a new Session. |
protected java.util.List |
computeStaticAccounts()
Computes the staticAccounts. |
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Method configure parses and validates the Configuration data and creates a new ParsedConfiguration , an Account for each
configured static account and a ParsedDynamicAccountParameters
for each dynamic account. |
protected org.apache.james.fetchmail.ParsedConfiguration |
getConfiguration()
Returns the configuration. |
protected java.util.Map |
getDynamicAccounts()
Returns the dynamicAccounts. |
protected UsersRepository |
getLocalUsers()
Returns the localUsers. |
protected java.util.List |
getParsedDynamicAccountParameters()
Returns the ParsedDynamicAccountParameters. |
protected MailServer |
getServer()
Returns the server. |
protected javax.mail.Session |
getSession()
Returns the session, lazily initialized if required. |
protected java.util.List |
getStaticAccounts()
Returns the accounts. |
protected boolean |
isFetching()
Returns the fetching. |
protected void |
resetDynamicAccounts()
Resets the dynamicAccounts. |
void |
service(org.apache.avalon.framework.service.ServiceManager manager)
|
protected void |
setConfiguration(org.apache.james.fetchmail.ParsedConfiguration configuration)
Sets the configuration. |
protected void |
setDynamicAccounts(java.util.Map dynamicAccounts)
Sets the dynamicAccounts. |
protected void |
setFetching(boolean fetching)
Sets the fetching. |
protected void |
setLocalUsers(UsersRepository localUsers)
Sets the localUsers. |
protected void |
setParsedDynamicAccountParameters(java.util.List parsedDynamicAccountParameters)
Sets the ParsedDynamicAccountParameters. |
protected void |
setServer(MailServer server)
Sets the server. |
protected void |
setSession(javax.mail.Session session)
Sets the session. |
protected void |
setSessionParameters(org.apache.avalon.framework.configuration.Configuration configuration)
Propogate any Session parameters in the configuration to the Session. |
protected void |
setStaticAccounts(java.util.List accounts)
Sets the accounts. |
void |
targetTriggered(java.lang.String arg0)
Method target triggered fetches mail for each configured account. |
protected void |
updateDynamicAccounts()
Updates the dynamicAccounts. |
protected void |
updateParsedDynamicAccountParameters()
Updates the ParsedDynamicAccountParameters. |
protected void |
updateSession()
Updates the current Session. |
protected void |
updateStaticAccounts()
Updates the staticAccounts. |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FetchMail()
Method Detail |
---|
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
ParsedConfiguration
, an Account
for each
configured static account and a ParsedDynamicAccountParameters
for each dynamic account.
configure
in interface org.apache.avalon.framework.configuration.Configurable
org.apache.avalon.framework.configuration.ConfigurationException
Configurable.configure(Configuration)
public void targetTriggered(java.lang.String arg0)
targetTriggered
in interface org.apache.avalon.cornerstone.services.scheduler.Target
Target.targetTriggered(String)
protected boolean isFetching()
public void service(org.apache.avalon.framework.service.ServiceManager manager) throws org.apache.avalon.framework.service.ServiceException
service
in interface org.apache.avalon.framework.service.Serviceable
org.apache.avalon.framework.service.ServiceException
Serviceable.service(ServiceManager)
protected void setFetching(boolean fetching)
fetching
- The fetching to setprotected MailServer getServer()
protected org.apache.james.fetchmail.ParsedConfiguration getConfiguration()
protected void setConfiguration(org.apache.james.fetchmail.ParsedConfiguration configuration)
configuration
- The configuration to setprotected void setServer(MailServer server)
server
- The server to setprotected UsersRepository getLocalUsers()
protected void setLocalUsers(UsersRepository localUsers)
localUsers
- The localUsers to setprotected java.util.List getStaticAccounts()
protected void setStaticAccounts(java.util.List accounts)
accounts
- The accounts to setprotected void updateStaticAccounts()
protected void updateParsedDynamicAccountParameters()
protected void updateDynamicAccounts() throws org.apache.avalon.framework.configuration.ConfigurationException
org.apache.avalon.framework.configuration.ConfigurationException
protected java.util.List computeStaticAccounts()
protected java.util.List computeParsedDynamicAccountParameters()
protected java.util.Map computeDynamicAccounts() throws org.apache.avalon.framework.configuration.ConfigurationException
org.apache.avalon.framework.configuration.ConfigurationException
protected java.util.Map getDynamicAccounts() throws org.apache.avalon.framework.configuration.ConfigurationException
org.apache.avalon.framework.configuration.ConfigurationException
protected void setDynamicAccounts(java.util.Map dynamicAccounts)
dynamicAccounts
- The dynamicAccounts to setprotected java.util.Map computeDynamicAccounts(java.util.Map oldAccounts, org.apache.james.fetchmail.FetchMail.ParsedDynamicAccountParameters parameters) throws org.apache.avalon.framework.configuration.ConfigurationException
oldAccounts
- parameters
-
org.apache.avalon.framework.configuration.ConfigurationException
protected void resetDynamicAccounts()
protected java.util.List getParsedDynamicAccountParameters()
protected void setParsedDynamicAccountParameters(java.util.List parsedDynamicAccountParameters)
ParsedDynamicAccountParameters
- The ParsedDynamicAccountParametersto setprotected javax.mail.Session getSession()
protected javax.mail.Session computeSession()
protected void updateSession()
protected void setSession(javax.mail.Session session)
session
- The session to setprotected void setSessionParameters(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configuration
- The configuration containing the parameters
org.apache.avalon.framework.configuration.ConfigurationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |