public class CommandHandler extends Object
Constructor and Description |
---|
CommandHandler() |
CommandHandler(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(String command) |
Command |
getCommand(String commandName)
Returns the command object corresponding to the specified command name.
|
HelpMessage |
getHelp(String command) |
Set<String> |
getVerbs() |
void |
handleCommand(Session context,
String commandString) |
public CommandHandler()
public CommandHandler(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(String commandName)
commandName
- case insensitive name of the command.public boolean containsCommand(String command)
public void handleCommand(Session context, String commandString) throws SocketTimeoutException, IOException, DropConnectionException
public HelpMessage getHelp(String command) throws CommandException
CommandException
Copyright © 2006–2017. All rights reserved.