|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.james.transport.mailets.listservcommands.BaseCommand
public abstract class BaseCommand
BaseCommand is a convience base class for any class that wishes to implement IListServCommand
.
It provides some functions like:
log(java.lang.String)
sendStandardReply(org.apache.mailet.Mail, java.lang.String, java.lang.String, java.lang.String)
generateMail(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
CommandListservManager
Field Summary | |
---|---|
protected ICommandListservManager |
commandListservManager
|
protected java.lang.String |
commandName
|
protected org.apache.avalon.framework.configuration.Configuration |
configuration
|
protected MailetContext |
mailetContext
|
Constructor Summary | |
---|---|
BaseCommand()
|
Method Summary | |
---|---|
protected javax.mail.internet.MimeMessage |
generateMail(java.lang.String destEmailAddr,
java.lang.String destDisplayName,
java.lang.String fromEmailAddr,
java.lang.String fromDisplayName,
java.lang.String emailSubject,
java.lang.String emailPlainText)
Send mail |
protected ICommandListservManager |
getCommandListservManager()
The list serv manager |
java.lang.String |
getCommandName()
The name of this command |
protected org.apache.avalon.framework.configuration.Configuration |
getConfiguration()
|
protected MailetContext |
getMailetContext()
The current mailet context |
protected java.util.Properties |
getStandardProperties()
Use this to get standard properties for future calls to XMLResources |
protected UsersRepository |
getUsersRepository()
|
void |
init(ICommandListservManager commandListservManager,
org.apache.avalon.framework.configuration.Configuration configuration)
Perform any required initialization |
protected XMLResources[] |
initXMLResources(java.lang.String[] names)
|
protected void |
log(java.lang.String message)
Writes the specified message to a mailet log file, prepended by the mailet's name. |
protected void |
log(java.lang.String message,
java.lang.Throwable t)
Writes an explanatory message and a stack trace for a given Throwable exception to the mailet log file, prepended by the mailet's name. |
protected void |
sendStandardReply(Mail origMail,
java.lang.String subject,
java.lang.String message,
java.lang.String replyAddress)
Produces a standard response replyAddress to the sender |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.james.transport.mailets.listservcommands.IListServCommand |
---|
onCommand |
Field Detail |
---|
protected org.apache.avalon.framework.configuration.Configuration configuration
protected ICommandListservManager commandListservManager
protected java.lang.String commandName
protected MailetContext mailetContext
Constructor Detail |
---|
public BaseCommand()
Method Detail |
---|
public void init(ICommandListservManager commandListservManager, org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
init
in interface IListServCommand
configuration
-
org.apache.avalon.framework.configuration.ConfigurationException
public java.lang.String getCommandName()
getCommandName
in interface IListServCommand
IListServCommand.getCommandName()
protected org.apache.avalon.framework.configuration.Configuration getConfiguration()
Configuration
protected ICommandListservManager getCommandListservManager()
ICommandListservManager
protected MailetContext getMailetContext()
MailetContext
protected UsersRepository getUsersRepository()
ICommandListservManager.getUsersRepository()
protected void log(java.lang.String message)
message
- - a String specifying the message to be written to the log fileprotected void log(java.lang.String message, java.lang.Throwable t)
message
- - a String that describes the error or exceptiont
- - the java.lang.Throwable error or exceptionprotected void sendStandardReply(Mail origMail, java.lang.String subject, java.lang.String message, java.lang.String replyAddress) throws javax.mail.MessagingException
origMail
- subject
- message
- replyAddress
- an optional custom replyAddress address
javax.mail.MessagingException
generateMail(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
,
MailetContext.sendMail(javax.mail.internet.MimeMessage)
protected java.util.Properties getStandardProperties()
XMLResources
protected javax.mail.internet.MimeMessage generateMail(java.lang.String destEmailAddr, java.lang.String destDisplayName, java.lang.String fromEmailAddr, java.lang.String fromDisplayName, java.lang.String emailSubject, java.lang.String emailPlainText) throws java.lang.Exception
destEmailAddr
- the destination email addr: user@server.comdestDisplayName
- the display namefromEmailAddr
- fromDisplayName
- emailSubject
- emailPlainText
-
java.lang.Exception
protected XMLResources[] initXMLResources(java.lang.String[] names) throws org.apache.avalon.framework.configuration.ConfigurationException
org.apache.avalon.framework.configuration.ConfigurationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |