org.apache.james.transport.mailets.listservcommands
Interface IListServCommand

All Known Implementing Classes:
BaseCommand, ErrorCommand, Info, Owner, Subscribe, SubscribeConfirm, UnSubscribe, UnSubscribeConfirm

public interface IListServCommand

IListServCommand is the interface that all pluggable list serv commands must implement. The lifecycle of a IListServCommand will be controlled by the ICommandListservManager

Requests sent to the CommandListservManager take the form of:

 <listName>-<commandName>@domain
 
and if the commandName matches the command's name, then the onCommand(org.apache.mailet.Mail) will be invoked.

A typical command is configured:
 <command name="subscribe" class="Subscribe"/>
 


Typically, IListServCommands will format some text to reply with based off of resource files and calls to XMLResources.getString(java.lang.String) This allows you to customize the messages sent by these commands by editing text files and not editing the javacode.

Since:
2.2.0
Version:
CVS $Revision: 494012 $ $Date: 2007-01-08 10:23:58 +0000 (lun, 08 gen 2007) $
See Also:
ICommandListservManager

Method Summary
 java.lang.String getCommandName()
          The name of this command specified by the 'name' parameter.
 void init(ICommandListservManager commandListservManager, org.apache.avalon.framework.configuration.Configuration configuration)
          Perform any required initialization
 void onCommand(Mail mail)
          Process this command to your hearts content
 

Method Detail

getCommandName

java.lang.String getCommandName()
The name of this command specified by the 'name' parameter. eg:
 <command name="subscribe" class="Subscribe"/>
 

Returns:
the name of this command

init

void init(ICommandListservManager commandListservManager,
          org.apache.avalon.framework.configuration.Configuration configuration)
          throws org.apache.avalon.framework.configuration.ConfigurationException
Perform any required initialization

Parameters:
configuration -
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

onCommand

void onCommand(Mail mail)
               throws javax.mail.MessagingException
Process this command to your hearts content

Parameters:
mail -
Throws:
javax.mail.MessagingException


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.