org.coweb.bots
Class VanillaBot

java.lang.Object
  extended by org.coweb.bots.VanillaBot
All Implemented Interfaces:
Bot

public abstract class VanillaBot
extends Object
implements Bot

Implement the Bot interface with nops for all public methods.


Constructor Summary
VanillaBot()
           
 
Method Summary
 void init()
          The bot Proxy will call this method when a new session has been created and a user has subscribed to this bot's service.
 void onRequest(Map<String,Object> params, String replyToken, String username)
          Called when a user make a private request to this bot.
 void onShutdown()
          Called when the bot service is to shutdown.
 void onSubscribe(String username)
          Called when a user subscribes to the service provided by this bot.
 void onUnsubscribe(String username)
          Called when a user unsubscribes to the service provided by this bot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.coweb.bots.Bot
setProxy
 

Constructor Detail

VanillaBot

public VanillaBot()
Method Detail

init

public void init()
Description copied from interface: Bot
The bot Proxy will call this method when a new session has been created and a user has subscribed to this bot's service.

Specified by:
init in interface Bot

onSubscribe

public void onSubscribe(String username)
Description copied from interface: Bot
Called when a user subscribes to the service provided by this bot.

Specified by:
onSubscribe in interface Bot
Parameters:
username - The username of the client subscribing.

onUnsubscribe

public void onUnsubscribe(String username)
Description copied from interface: Bot
Called when a user unsubscribes to the service provided by this bot.

Specified by:
onUnsubscribe in interface Bot
Parameters:
username - The username of the client unsubscribing.

onRequest

public void onRequest(Map<String,Object> params,
                      String replyToken,
                      String username)
Description copied from interface: Bot
Called when a user make a private request to this bot.

Specified by:
onRequest in interface Bot
Parameters:
params - key value pairs of parameters sent by the user.
replyToken - token associated with this request. The bot must pass this token back to the proxy when replying to this request.
username - The username of the client making this request.

onShutdown

public void onShutdown()
Description copied from interface: Bot
Called when the bot service is to shutdown. Allows the bot to do any cleanup that it needs to.

Specified by:
onShutdown in interface Bot


Copyright © 2011-2012 The Dojo Foundation. All Rights Reserved.