org.subethamail.smtp.server
Class BaseCommand

java.lang.Object
  extended by org.subethamail.smtp.server.BaseCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
AuthCommand, DataCommand, EhloCommand, HelloCommand, HelpCommand, MailCommand, NoopCommand, QuitCommand, ReceiptCommand, ResetCommand, StartTLSCommand, VerifyCommand

public abstract class BaseCommand
extends Object
implements Command

Author:
Ian McFarland <ian@neo.com>, Jon Stevens, Jeff Schnitzer, Scott Hernandez

Constructor Summary
protected BaseCommand(String name, String help)
           
protected BaseCommand(String name, String help, String argumentDescription)
           
 
Method Summary
abstract  void execute(String commandString, Session context)
          This is the main method that you need to override in order to implement a command.
protected  String getArgPredicate(String commandString)
           
protected  String[] getArgs(String commandString)
           
 HelpMessage getHelp()
           
 String getName()
          Returns the name of the command in upper case.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseCommand

protected BaseCommand(String name,
                      String help)

BaseCommand

protected BaseCommand(String name,
                      String help,
                      String argumentDescription)
Method Detail

execute

public abstract void execute(String commandString,
                             Session context)
                      throws IOException,
                             DropConnectionException
This is the main method that you need to override in order to implement a command.

Specified by:
execute in interface Command
Throws:
IOException
DropConnectionException

getHelp

public HelpMessage getHelp()
Specified by:
getHelp in interface Command

getName

public String getName()
Description copied from interface: Command
Returns the name of the command in upper case. For example "QUIT".

Specified by:
getName in interface Command

getArgPredicate

protected String getArgPredicate(String commandString)

getArgs

protected String[] getArgs(String commandString)


Copyright © 2006-2012. All Rights Reserved.