|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.james.transport.mailets.listservcommands.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 String |
commandName
|
protected org.apache.avalon.framework.configuration.Configuration |
configuration
|
protected MailetContext |
mailetContext
|
Constructor Summary | |
BaseCommand()
|
Method Summary | |
protected MimeMessage |
generateMail(String destEmailAddr,
String destDisplayName,
String fromEmailAddr,
String fromDisplayName,
String emailSubject,
String emailPlainText)
Send mail |
protected ICommandListservManager |
getCommandListservManager()
The list serv manager |
String |
getCommandName()
The name of this command |
protected org.apache.avalon.framework.configuration.Configuration |
getConfiguration()
|
protected MailetContext |
getMailetContext()
The current mailet context |
protected 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(String[] names)
|
protected void |
log(String message)
Writes the specified message to a mailet log file, prepended by the mailet's name. |
protected void |
log(String message,
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,
String subject,
String message,
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 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 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(String message)
message
- - a String specifying the message to be written to the log fileprotected void log(String message, Throwable t)
message
- - a String that describes the error or exceptiont
- - the java.lang.Throwable error or exceptionprotected void sendStandardReply(Mail origMail, String subject, String message, String replyAddress) throws MessagingException
origMail
- subject
- message
- replyAddress
- an optional custom replyAddress address
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 Properties getStandardProperties()
XMLResources
protected MimeMessage generateMail(String destEmailAddr, String destDisplayName, String fromEmailAddr, String fromDisplayName, String emailSubject, String emailPlainText) throws Exception
destEmailAddr
- the destination email addr: user@server.comdestDisplayName
- the display namefromEmailAddr
- fromDisplayName
- emailSubject
- emailPlainText
-
Exception
protected XMLResources[] initXMLResources(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 |