hudson.plugins.im.bot
Class CommentCommand

java.lang.Object
  extended by hudson.plugins.im.bot.BotCommand
      extended by hudson.plugins.im.bot.AbstractTextSendingCommand
          extended by hudson.plugins.im.bot.CommentCommand
All Implemented Interfaces:
hudson.ExtensionPoint

@Extension
public class CommentCommand
extends AbstractTextSendingCommand


Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
CommentCommand()
           
 
Method Summary
 java.util.Collection<java.lang.String> getCommandNames()
          Obtains the name of the command.
 java.lang.String getHelp()
          Return the command usage text.
protected  java.lang.CharSequence getMessageForJob(hudson.model.AbstractProject<?,?> job, Sender sender, java.lang.String[] args)
          Returns the message to return for this job.
protected  java.lang.String getReply(Bot bot, Sender sender, java.lang.String[] args)
          Gets the text reply
 
Methods inherited from class hudson.plugins.im.bot.AbstractTextSendingCommand
executeCommand, getErrorReply, getJobProvider
 
Methods inherited from class hudson.plugins.im.bot.BotCommand
all
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommentCommand

public CommentCommand()
Method Detail

getCommandNames

public java.util.Collection<java.lang.String> getCommandNames()
Description copied from class: BotCommand
Obtains the name of the command. Single commands can register multiple aliases, so this method returns a collection.

Specified by:
getCommandNames in class BotCommand
Returns:
Can be empty but never null.

getMessageForJob

protected java.lang.CharSequence getMessageForJob(hudson.model.AbstractProject<?,?> job,
                                                  Sender sender,
                                                  java.lang.String[] args)
                                           throws CommandException
Returns the message to return for this job. Implementors should only return a String if the command was executed successfully. Otherwise a CommandException should be thrown!

Parameters:
job - The job
sender - The sender of the command
Returns:
the result message for this job if the command was executed successfully
Throws:
CommandException - if the command couldn't be executed for any reason

getHelp

public java.lang.String getHelp()
Description copied from class: BotCommand
Return the command usage text.

Specified by:
getHelp in class BotCommand
Returns:
the command usage text

getReply

protected java.lang.String getReply(Bot bot,
                                    Sender sender,
                                    java.lang.String[] args)
Description copied from class: AbstractTextSendingCommand
Gets the text reply

Specified by:
getReply in class AbstractTextSendingCommand
Parameters:
bot - The bot for which this command is currently operating. Never be null.
sender - the command sender
args - arguments passed to the command, where args[0] is the command name itself @throws RuntimeException in case of invalid args. This is automatically caught and reported to the sender


Copyright © 2010. All Rights Reserved.