Package org.subethamail.smtp.server
Class CommandHandler
java.lang.Object
org.subethamail.smtp.server.CommandHandler
This class manages execution of a SMTP command.
- Author:
- Jon Stevens, Scott Hernandez
-
Constructor Summary
ConstructorsConstructorDescriptionCommandHandler(Collection<Command> availableCommands) Create a command handler with a specific set of commands. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommand(Command command) Adds or replaces the specified command.booleancontainsCommand(String command) getCommand(String commandName) Returns the command object corresponding to the specified command name.getVerbs()voidhandleCommand(Session context, String commandString)
-
Constructor Details
-
CommandHandler
public CommandHandler() -
CommandHandler
Create a command handler with a specific set of commands.- Parameters:
availableCommands- the available commands (not null) TLS note: wrap commands withRequireTLSCommandWrapperwhen appropriate.
-
-
Method Details
-
addCommand
Adds or replaces the specified command. -
getCommand
Returns the command object corresponding to the specified command name.- Parameters:
commandName- case insensitive name of the command.- Returns:
- the command object, or null, if the command is unknown.
-
containsCommand
-
getVerbs
-
handleCommand
public void handleCommand(Session context, String commandString) throws SocketTimeoutException, IOException, DropConnectionException -
getHelp
- Returns:
- the HelpMessage object for the given command name (verb)
- Throws:
CommandException
-