| java.lang.Object org.apache.mailet.GenericMailet org.apache.james.transport.mailets.CommandListservManager
CommandListservManager | public class CommandListservManager extends GenericMailet implements ICommandListservManager(Code) | | CommandListservManager is the default implementation of
ICommandListservManager .
It loads all the configured
IListServCommand s and delegates to them at runtime.
It isn't responsible for procesing messages sent to the main mailing list, but is responsible for
individual commands sent by users, such as: info, subscribe, etc...
Requests sent to the CommandListservManager take the form of:
<listName>-<commandName>@domain
If the command isn't recognized an error will be sent using
CommandListservManager.onError .
The configuration for this mailet sould be in the 'root' processor block.
<mailet match="CommandListservMatcher=announce@localhost" class="CommandListservManager">
<listName>announce</listName>
<displayName>Announce mailing list</displayName>
<listOwner>owner@localhost</listOwner>
<repositoryName>list-announce</repositoryName>
<listDomain>localhost</listDomain>
<commandpackages>
<commandpackage>org.apache.james.transport.mailets.listservcommands</commandpackage>
</commandpackages>
<commands>
<command name="subscribe" class="Subscribe"/>
<command name="subscribe-confirm" class="SubscribeConfirm"/>
<command name="unsubscribe" class="UnSubscribe"/>
<command name="unsubscribe-confirm" class="UnSubscribeConfirm"/>
<command name="error" class="ErrorCommand"/>
<command name="owner" class="Owner"/>
<command name="info" class="Info"/>
</commands>
</mailet>
Todo: refine the command matching so we can have more sophistciated commands such as:
<listName>-<commandName>-<optCommandParam>@domain
version: CVS $Revision: 430699 $ $Date: 2006-08-11 09:02:35 +0200 (Fr, 11 Aug 2006) $ since: 2.2.0 |
commandPackages | protected List commandPackages(Code) | | |
getCommand | public IListServCommand getCommand(String name)(Code) | | Get a specific command specified by the 'commands' configuration block.
For instance:
<commands>
<command name="subscribe" class="Subscribe"/>
<command name="subscribe-confirm" class="SubscribeConfirm"/>
<command name="unsubscribe" class="UnSubscribe"/>
<command name="unsubscribe-confirm" class="UnSubscribeConfirm"/>
<command name="error" class="ErrorCommand"/>
<command name="owner" class="Owner"/>
<command name="info" class="Info"/>
</commands>
Parameters: name - case in-sensitive a IListServCommand if found, null otherwise |
getCommandName | protected String getCommandName(MailAddress mailAddress)(Code) | | Get the name of the command
Parameters: mailAddress - the name of the command |
getCommandTarget | public IListServCommand getCommandTarget(MailAddress mailAddress)(Code) | | Based on the to address get a valid or command or null
Parameters: mailAddress - IListServCommand or null |
getListDomain | public String getListDomain()(Code) | | Get the domain of the list specified by the config param: 'listDomain'.
eg: <listDomain>localhost</listDomain>
a string like localhost |
getListName | public String getListName(boolean displayFormat)(Code) | | Get the name of this list specified by the config param: 'listName'.
eg: <listName>announce</listName>
Parameters: displayFormat - is whether you want a display version of this or not the official display name of this list |
getListOwner | public String getListOwner()(Code) | | Gets the owner of this list specified by the config param: 'listOwner'.
eg: <listOwner>owner@localhost</listOwner>
this is an address like listOwner@localhost |
getResourcesFile | public String getResourcesFile()(Code) | | the configuration file for the xml resources |
getUsersRepository | public UsersRepository getUsersRepository()(Code) | | Get the current user repository for this list serv
an instance of UsersRepository that is used for the member list of the list serv |
init | public void init() throws MessagingException(Code) | | |
initUsersRepository | protected void initUsersRepository()(Code) | | Fetch the repository of users
|
initXMLResources | public XMLResources[] initXMLResources(String[] names) throws ConfigurationException(Code) | | Initializes an array of resources
Parameters: names - such as 'header, footer' etc... an initialized array of XMLResources throws: ConfigurationException - |
initializeResources | protected void initializeResources() throws Exception(Code) | | initialize the resources
throws: Exception - |
loadCommandPackages | protected void loadCommandPackages(Configuration configuration) throws ConfigurationException(Code) | | loads all of the packages for the commands
Parameters: configuration - throws: ConfigurationException - |
loadCommands | protected void loadCommands(Configuration configuration) throws Exception(Code) | | Load an initialize all of the available commands
Parameters: configuration - throws: ConfigurationException - |
onError | public void onError(Mail mail, String subject, String errorMessage) throws MessagingException(Code) | | An error occurred, send some sort of message
Parameters: subject - the subject of the message to send Parameters: mail - Parameters: errorMessage - |
service | public void service(Mail mail) throws MessagingException(Code) | | Called by the mailet container to allow the mailet to process a
message.
This method is declared abstract so subclasses must override it.
Parameters: mail - - the Mail object that contains the MimeMessage androuting information throws: MessagingException - - if an exception occurs that interferes with the mailet's normal operationoccurred |
|
|