org.mobicents.examples.googletalk
Class GoogleTalkBotSbb

java.lang.Object
  extended by org.mobicents.examples.googletalk.GoogleTalkBotSbb
All Implemented Interfaces:
javax.slee.Sbb

public abstract class GoogleTalkBotSbb
extends java.lang.Object
implements javax.slee.Sbb

Version:
2.0 A prototype SBB for the XMPP Resource Adaptor in client mode. It demonstrates connection with the GoogleTalk service. Simulates a regular GoogleTalk user. The bot simply receives IM chat messages from Google Talk users and echoes them back. It also responds to a 'time' message with the current time at the server where the SBB is hosted.
Author:
Neutel, Ivelin Ivanov, Eduardo Martins

Constructor Summary
GoogleTalkBotSbb()
           
 
Method Summary
protected  javax.slee.SbbContext getSbbContext()
          Convenience method to retrieve the SbbContext object stored in setSbbContext.
protected  java.lang.String getTraceMessageType()
           
 void onActivityEndEvent(javax.slee.ActivityEndEvent event, javax.slee.ActivityContextInterface aci)
           
 void onMessage(org.jivesoftware.smack.packet.Message message, javax.slee.ActivityContextInterface aci)
          This is the point where we already have a chat session with the user, so, when they send us messages, we count the chars and reply or tell time :)
 void onPresence(org.jivesoftware.smack.packet.Presence packet, javax.slee.ActivityContextInterface aci)
          Here we recieve the Presence messages.
 void onStartServiceEvent(javax.slee.serviceactivity.ServiceStartedEvent event, javax.slee.ActivityContextInterface aci)
           
 void sbbActivate()
           
 void sbbCreate()
           
 void sbbExceptionThrown(java.lang.Exception exception, java.lang.Object event, javax.slee.ActivityContextInterface activity)
           
 void sbbLoad()
           
 void sbbPassivate()
           
 void sbbPostCreate()
           
 void sbbRemove()
           
 void sbbRolledBack(javax.slee.RolledBackContext context)
           
 void sbbStore()
           
 void setSbbContext(javax.slee.SbbContext context)
          Initialize SBB component.
 void unsetSbbContext()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GoogleTalkBotSbb

public GoogleTalkBotSbb()
Method Detail

onStartServiceEvent

public void onStartServiceEvent(javax.slee.serviceactivity.ServiceStartedEvent event,
                                javax.slee.ActivityContextInterface aci)

onPresence

public void onPresence(org.jivesoftware.smack.packet.Presence packet,
                       javax.slee.ActivityContextInterface aci)
Here we recieve the Presence messages.


onMessage

public void onMessage(org.jivesoftware.smack.packet.Message message,
                      javax.slee.ActivityContextInterface aci)
This is the point where we already have a chat session with the user, so, when they send us messages, we count the chars and reply or tell time :)


onActivityEndEvent

public void onActivityEndEvent(javax.slee.ActivityEndEvent event,
                               javax.slee.ActivityContextInterface aci)

setSbbContext

public void setSbbContext(javax.slee.SbbContext context)
Initialize SBB component. Gets a reference to the XMPP RA so that messages can be sent out.

Specified by:
setSbbContext in interface javax.slee.Sbb

unsetSbbContext

public void unsetSbbContext()
Specified by:
unsetSbbContext in interface javax.slee.Sbb

sbbCreate

public void sbbCreate()
               throws javax.slee.CreateException
Specified by:
sbbCreate in interface javax.slee.Sbb
Throws:
javax.slee.CreateException

sbbPostCreate

public void sbbPostCreate()
                   throws javax.slee.CreateException
Specified by:
sbbPostCreate in interface javax.slee.Sbb
Throws:
javax.slee.CreateException

sbbActivate

public void sbbActivate()
Specified by:
sbbActivate in interface javax.slee.Sbb

sbbPassivate

public void sbbPassivate()
Specified by:
sbbPassivate in interface javax.slee.Sbb

sbbRemove

public void sbbRemove()
Specified by:
sbbRemove in interface javax.slee.Sbb

sbbLoad

public void sbbLoad()
Specified by:
sbbLoad in interface javax.slee.Sbb

sbbStore

public void sbbStore()
Specified by:
sbbStore in interface javax.slee.Sbb

sbbExceptionThrown

public void sbbExceptionThrown(java.lang.Exception exception,
                               java.lang.Object event,
                               javax.slee.ActivityContextInterface activity)
Specified by:
sbbExceptionThrown in interface javax.slee.Sbb

sbbRolledBack

public void sbbRolledBack(javax.slee.RolledBackContext context)
Specified by:
sbbRolledBack in interface javax.slee.Sbb

getSbbContext

protected javax.slee.SbbContext getSbbContext()
Convenience method to retrieve the SbbContext object stored in setSbbContext. TODO: If your SBB doesn't require the SbbContext object you may remove this method, the sbbContext variable and the variable assignment in setSbbContext().

Returns:
this SBB's SbbContext object

getTraceMessageType

protected java.lang.String getTraceMessageType()


Copyright © 2008. All Rights Reserved.