org.apache.cocoon.mail
Class MailCommandBuilder

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.mail.MailCommandBuilder
All Implemented Interfaces:
LogEnabled

public class MailCommandBuilder
extends AbstractLogEnabled

Build an AbstractMailCommand from MailContext.

As a user requests a command, the command is mapped to an MailCommand instance. The registration of MailCommand, and the resolution of a command string to a command instance are the tasks of this class.

Since:
28 December 2002
Version:
$Id: MailCommandBuilder.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Bernhard Huber

Constructor Summary
MailCommandBuilder()
          Constructor for the MailCommandBuilder object
 
Method Summary
 AbstractMailCommand buildAbstractMailCommand(MailContext mailContext)
          Build a mail command.
 void configure()
          Configure the cmd to mail command class mapping.
protected  Class getClassForCommand(String cmd)
          Get Class for a command
 boolean isCommandMapped(String cmd)
          Test if command is mapped to a Command class
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailCommandBuilder

public MailCommandBuilder()
Constructor for the MailCommandBuilder object

Method Detail

buildAbstractMailCommand

public AbstractMailCommand buildAbstractMailCommand(MailContext mailContext)
Build a mail command.

Parameters:
mailContext - Description of the Parameter
Returns:
Description of the Return Value

getClassForCommand

protected Class getClassForCommand(String cmd)
Get Class for a command

Parameters:
cmd - the command
Returns:
Class associated with cmd, or null iff cmd is not mapped to any class

isCommandMapped

public boolean isCommandMapped(String cmd)
Test if command is mapped to a Command class

Parameters:
cmd - the command
Returns:
true iff command is mapped to a Class, otherwise return false

configure

public void configure()
Configure the cmd to mail command class mapping.

New commands are registered here. A command name is associated with each command class.



Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.