/** */ protected BaseCommand(String name, String help, String argumentDescription) { this.name = name; this.helpMsg = new HelpMessage(name, help, argumentDescription); }
/** */ public HelpMessage(String commandName, String helpMessage, String argumentDescription) { this.commandName = commandName; this.argumentDescription = argumentDescription == null ? "" : " " + argumentDescription; this.helpMessage = helpMessage; this.buildOutputString(); }
@Override public void execute(String commandString, ConnectionContext context) throws IOException { String args = getArgPredicate(commandString); if ("".equals(args)) { context.sendResponse(getCommandMessage((SMTPServer)context.getServer())); return; } try { context.sendResponse(getHelp(args).toOutputString()); } catch (CommandException e) { context.sendResponse("504 HELP topic \"" + args + "\" unknown."); } }
public void setHelp(HelpMessage helpMessage) { helpMessageMap.put(helpMessage.getName().toUpperCase(), helpMessage); }
/** */ @Override public void execute(String commandString, Session context) throws IOException { String args = this.getArgPredicate(commandString); if ("".equals(args)) { context.sendResponse(this.getCommandMessage(context.getServer())); return; } try { context.sendResponse(context.getServer().getCommandHandler().getHelp(args).toOutputString()); } catch (CommandException e) { context.sendResponse("504 HELP topic \"" + args + "\" unknown."); } }
/** */ protected BaseCommand(String name, String help) { this.name = name; this.helpMsg = new HelpMessage(name, help); }
/** */ public HelpMessage(String commandName, String helpMessage, String argumentDescription) { this.commandName = commandName; this.argumentDescription = argumentDescription == null ? "" : " " + argumentDescription; this.helpMessage = helpMessage; this.buildOutputString(); }
/** */ @Override public void execute(String commandString, Session context) throws IOException { String args = this.getArgPredicate(commandString); if ("".equals(args)) { context.sendResponse(this.getCommandMessage(context.getServer())); return; } try { context.sendResponse(context.getServer().getCommandHandler().getHelp(args).toOutputString()); } catch (CommandException e) { context.sendResponse("504 HELP topic \"" + args + "\" unknown."); } }
/** */ protected BaseCommand(String name, String help) { this.name = name; this.helpMsg = new HelpMessage(name, help); }
public HelpMessage(String commandName, String helpMessage, String argumentDescription) { this.commandName = commandName; this.argumentDescription = argumentDescription == null ? "" : " " + argumentDescription; this.helpMessage = helpMessage; buildOutputString(); }
/** */ protected BaseCommand(String name, String help, String argumentDescription) { this.name = name; this.helpMsg = new HelpMessage(name, help, argumentDescription); }
public BaseCommand(String name, String help, String argumentDescription) { this.name = name; setHelp(new HelpMessage(name, help, argumentDescription)); }
public BaseCommand(String name, String help) { this.name = name; setHelp(new HelpMessage(name, help)); }