org.apache.james.transport.mailets.listservcommands
Class SubscribeConfirm

java.lang.Object
  extended by org.apache.james.transport.mailets.listservcommands.BaseCommand
      extended by org.apache.james.transport.mailets.listservcommands.SubscribeConfirm
All Implemented Interfaces:
IListServCommand

public class SubscribeConfirm
extends BaseCommand

Subscribe handles the subscribe-confirm command. It is configured by:

<command name="subscribe-confirm" class="SubscribeConfirm"/>


It uses the formatted text-based resources for its return mail body:

After formatting the text, the message is delivered with BaseCommand.sendStandardReply(org.apache.mailet.Mail, java.lang.String, java.lang.String, java.lang.String)

This command basically sends the welcome message and adds the user to the mailing list.

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

Field Summary
protected static int ADMIN_COMMANDS
           
protected static int SUBSCRIBE_CONFIRM
           
protected  XMLResources[] xmlResources
           
 
Fields inherited from class org.apache.james.transport.mailets.listservcommands.BaseCommand
commandListservManager, commandName, configuration, mailetContext
 
Constructor Summary
SubscribeConfirm()
           
 
Method Summary
protected  boolean checkSubscriptionStatus(Mail mail)
          Checks to see if this user is already subscribed, if so return false and send a message
 void init(ICommandListservManager commandListservManager, org.apache.avalon.framework.configuration.Configuration configuration)
          Perform any required initialization
 void onCommand(Mail mail)
          After ensuring that the user isn't already subscribed, add the user to the mailing list, and send a welcome message.
 
Methods inherited from class org.apache.james.transport.mailets.listservcommands.BaseCommand
generateMail, getCommandListservManager, getCommandName, getConfiguration, getMailetContext, getStandardProperties, getUsersRepository, initXMLResources, log, log, sendStandardReply
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlResources

protected XMLResources[] xmlResources

SUBSCRIBE_CONFIRM

protected static final int SUBSCRIBE_CONFIRM
See Also:
Constant Field Values

ADMIN_COMMANDS

protected static final int ADMIN_COMMANDS
See Also:
Constant Field Values
Constructor Detail

SubscribeConfirm

public SubscribeConfirm()
Method Detail

init

public void init(ICommandListservManager commandListservManager,
                 org.apache.avalon.framework.configuration.Configuration configuration)
          throws org.apache.avalon.framework.configuration.ConfigurationException
Description copied from class: BaseCommand
Perform any required initialization

Specified by:
init in interface IListServCommand
Overrides:
init in class BaseCommand
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

onCommand

public void onCommand(Mail mail)
               throws javax.mail.MessagingException
After ensuring that the user isn't already subscribed, add the user to the mailing list, and send a welcome message.

It uses the formatted text-based resources for its return mail body:

Parameters:
mail -
Throws:
javax.mail.MessagingException

checkSubscriptionStatus

protected boolean checkSubscriptionStatus(Mail mail)
                                   throws javax.mail.MessagingException
Checks to see if this user is already subscribed, if so return false and send a message

Parameters:
mail -
Returns:
false if the user is subscribed, true otherwise
Throws:
javax.mail.MessagingException


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