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
 void onActivityEndEvent(javax.slee.ActivityEndEvent event, javax.slee.ActivityContextInterface aci)
          Handler to disconnect from Google when the service is being deactivated.
 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 handle the Presence messages.
 void onStartServiceEvent(javax.slee.serviceactivity.ServiceStartedEvent event, javax.slee.ActivityContextInterface aci)
          Init the xmpp connection to GOOGLE TALK when the service is activated by SLEE
 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)
           
 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)
Init the xmpp connection to GOOGLE TALK when the service is activated by SLEE

Parameters:
event -
aci -

onPresence

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

Parameters:
packet -
aci -

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 :)

Parameters:
message -
aci -

onActivityEndEvent

public void onActivityEndEvent(javax.slee.ActivityEndEvent event,
                               javax.slee.ActivityContextInterface aci)
Handler to disconnect from Google when the service is being deactivated.

Parameters:
event -
aci -

setSbbContext

public void setSbbContext(javax.slee.SbbContext context)
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


Copyright © 2010. All Rights Reserved.