org.xwiki.ircbot.wiki
Interface WikiIRCBotManager


@Role
public interface WikiIRCBotManager

Start/stop the Wiki IRC Bot including its Wiki Bot Listeners and provides some other APIs about the Wiki IRC Bot.

Since:
4.0M2
Version:
$Id: e9aa2628f1aa44e4d3c886e053b69b69dea9fbc1 $

Method Summary
 List<org.xwiki.ircbot.internal.BotListenerData> getBotListenerData()
          Provides information about all Bot Listeners (whether they are Wiki Bot Listeners or standard Java components).
 Map<String,Object> getContext()
           
 boolean isBotStarted()
           
 void startBot(boolean updateBotStatus)
          Connects the IRC Bot using the Configuration data located in WikiIRCBotConstants.WIKI_BOT_CONFIGURATION_CLASS and registers all Wiki Bot Listeners that are not marked as inactive.
 void stopBot(boolean updateBotStatus)
          Disconnect the IRC Bot and unregister all Wiki Bot Listeners.
 

Method Detail

startBot

void startBot(boolean updateBotStatus)
              throws IRCBotException
Connects the IRC Bot using the Configuration data located in WikiIRCBotConstants.WIKI_BOT_CONFIGURATION_CLASS and registers all Wiki Bot Listeners that are not marked as inactive. Note that the Bot is only connected if it's not marked inactive.

Parameters:
updateBotStatus - if true then update the Bot status to mark it as active
Throws:
IRCBotException - if any error happens

stopBot

void stopBot(boolean updateBotStatus)
             throws IRCBotException
Disconnect the IRC Bot and unregister all Wiki Bot Listeners.

Parameters:
updateBotStatus - if true then update the Bot status to mark it as inactive (this means that the Bot should not be restarted automatically by the IRC Bot Scheduler Job for example)
Throws:
IRCBotException - if any error happens

isBotStarted

boolean isBotStarted()
Returns:
true if the IRC Bot is connected or false otherwise

getBotListenerData

List<org.xwiki.ircbot.internal.BotListenerData> getBotListenerData()
                                                                   throws IRCBotException
Provides information about all Bot Listeners (whether they are Wiki Bot Listeners or standard Java components).

Returns:
the information about all Bot Listeners (such as id, name, description, etc)
Throws:
IRCBotException - if any error happens

getContext

Map<String,Object> getContext()
                              throws IRCBotException
Returns:
the IRC Bot Execution Context where variables from the Bot Events are stored. You'll need to access this if you write a Wiki Bot Listener and want access to the Event data such as the channel, the message the user, etc
Throws:
IRCBotException - if any error happens


Copyright © 2004-2012 XWiki. All Rights Reserved.