public class CommandHandler
extends java.lang.Object
Constructor and Description |
---|
CommandHandler() |
CommandHandler(java.util.Collection<Command> availableCommands)
Create a command handler with a specific set of commands.
|
Modifier and Type | Method and Description |
---|---|
void |
addCommand(Command command)
Adds or replaces the specified command.
|
boolean |
containsCommand(java.lang.String command) |
Command |
getCommand(java.lang.String commandName)
Returns the command object corresponding to the specified command name.
|
HelpMessage |
getHelp(java.lang.String command) |
java.util.Set<java.lang.String> |
getVerbs() |
void |
handleCommand(Session context,
java.lang.String commandString) |
public CommandHandler()
public CommandHandler(java.util.Collection<Command> availableCommands)
availableCommands
- the available commands (not null)
TLS note: wrap commands with RequireTLSCommandWrapper
when appropriate.public void addCommand(Command command)
public Command getCommand(java.lang.String commandName)
commandName
- case insensitive name of the command.public boolean containsCommand(java.lang.String command)
public java.util.Set<java.lang.String> getVerbs()
public void handleCommand(Session context, java.lang.String commandString) throws java.net.SocketTimeoutException, java.io.IOException, DropConnectionException
java.net.SocketTimeoutException
java.io.IOException
DropConnectionException
public HelpMessage getHelp(java.lang.String command) throws CommandException
CommandException
Copyright © 2006–2014. All rights reserved.