hudson.plugins.im.bot
Class AbstractTextSendingCommand
java.lang.Object
hudson.plugins.im.bot.AbstractTextSendingCommand
- All Implemented Interfaces:
- BotCommand
- Direct Known Subclasses:
- AbortCommand, BuildCommand, CommentCommand, HealthCommand, SetAliasCommand, SnackCommand, StatusCommand, TestResultCommand, UserStatCommand
public abstract class AbstractTextSendingCommand
- extends java.lang.Object
- implements BotCommand
Abstract command for sending a reply back to the sender.
- Author:
- kutzi
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractTextSendingCommand
public AbstractTextSendingCommand()
getJobProvider
protected JobProvider getJobProvider()
executeCommand
public final void executeCommand(IMChat chat,
IMMessage message,
Sender sender,
java.lang.String[] args)
throws IMException
- Execute a command.
- Specified by:
executeCommand in interface BotCommand
- Parameters:
chat - the IMChat object, may be used to send reply messagesmessage - the original IMMessagesender - the command senderargs - arguments passed to the command, where args[0] is the command name itself
- Throws:
IMException
getReply
protected abstract java.lang.String getReply(Sender sender,
java.lang.String[] args)
- Gets the text reply
- Parameters:
sender - the command senderargs - arguments passed to the command, where args[0] is the command name itself
- Throws:
java.lang.RuntimeException - in case of invalid args. This is automatically caught and reported to the sender
getErrorReply
protected java.lang.String getErrorReply(Sender sender,
CommandException e)
Copyright © 2010. All Rights Reserved.