Clearspace API (1.10.16) Core Javadocs

com.jivesoftware.community.event
Interface XMPPListener


public interface XMPPListener

A XMPPListener gets notified anytime a XMPP event is fired. Concrete implementations of this class must have a zero argument constructor.

See Also:
IMManager

Method Summary
 void componentStarted()
          The XMPP component started, which means there is an active connection to an XMPP server.
 void componentStopped()
          The XMPP component stopped, which means there is no connection to an XMPP server.
 void presenceReceived(org.xmpp.packet.Presence presence, org.xmpp.packet.Presence oldPresence)
          A presence update was received for an XMPP user.
 

Method Detail

componentStarted

void componentStarted()
The XMPP component started, which means there is an active connection to an XMPP server.


componentStopped

void componentStopped()
The XMPP component stopped, which means there is no connection to an XMPP server.


presenceReceived

void presenceReceived(org.xmpp.packet.Presence presence,
                      org.xmpp.packet.Presence oldPresence)
A presence update was received for an XMPP user. To find the Clearspace user that the presence information corresponds to (if any), use:
 JID from = presence.getFrom();
 User user = imManager.getUserForJID(from);
Use the Presence.isAvailable() method to determine if the user is currently online or offline. The oldPresence value can be used to determine if the user has newly signed on or off. For example, if the user was previously "away" and then updates their status to "do not disturb", then a presence update will be received and the oldPresence will show the the user as previously "away".

Note that all users should be considered offline if the componentStopped() event is triggered -- in that case, explicit offline events will not be generated.

Parameters:
presence - the presence packet received.
oldPresence - the previous presence value for the XMPP address, or null if there was no previous value (for example, when the user is newly coming online).

Clearspace Project Page

Copyright © 1999-2007 Jive Software.