Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire.handler
Class PresenceUpdateHandler

java.lang.Object
  extended by org.jivesoftware.wildfire.container.BasicModule
      extended by org.jivesoftware.wildfire.handler.PresenceUpdateHandler
All Implemented Interfaces:
ChannelHandler, Module

public class PresenceUpdateHandler
extends BasicModule
implements ChannelHandler

Implements the presence protocol. Clients use this protocol to update presence and roster information.

The handler must properly detect the presence type, update the user's roster, and inform presence subscribers of the session's updated presence status. Presence serves many purposes in Jabber so this handler will likely be the most complex of all handlers in the server.

There are four basic types of presence updates:

Author:
Iain Shigeoka

Constructor Summary
PresenceUpdateHandler()
           
 
Method Summary
 Presence createSubscribePresence(JID senderAddress, boolean isSubscribe)
           
 void directedPresenceSent(Presence update, ChannelHandler handler, String jid)
          Notification method sent to this handler when a user has sent a directed presence to an entity.
 boolean hasDirectPresence(Session session, JID recipientJID)
           
 void initialize(XMPPServer server)
          Initializes the basic module.
 void process(Packet packet)
          Process an XMPP packet.
 void process(Presence presence)
          Handle presence updates that affect roster subscriptions.
 void process(Presence presence, ClientSession session)
           
 
Methods inherited from class org.jivesoftware.wildfire.container.BasicModule
destroy, getName, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PresenceUpdateHandler

public PresenceUpdateHandler()
Method Detail

process

public void process(Packet packet)
             throws UnauthorizedException,
                    PacketException
Description copied from interface: ChannelHandler
Process an XMPP packet.

Specified by:
process in interface ChannelHandler
Parameters:
packet - a packet to process.
Throws:
UnauthorizedException - if not allowed to process the packet.
PacketException - thrown if the packet is malformed (results in the sender's session being shutdown).

process

public void process(Presence presence,
                    ClientSession session)
             throws UnauthorizedException,
                    PacketException
Throws:
UnauthorizedException
PacketException

process

public void process(Presence presence)
             throws PacketException
Handle presence updates that affect roster subscriptions.

Parameters:
presence - The presence presence to handle
Throws:
PacketException

createSubscribePresence

public Presence createSubscribePresence(JID senderAddress,
                                        boolean isSubscribe)

directedPresenceSent

public void directedPresenceSent(Presence update,
                                 ChannelHandler handler,
                                 String jid)
Notification method sent to this handler when a user has sent a directed presence to an entity. If the sender of the presence is local (to this server) and the target entity does not belong to the user's roster then update the registry of sent directed presences by the user.

Parameters:
update - the directed Presence sent by the user to an entity.
handler - the handler that routed the presence to the entity.
jid - the jid that the handler has processed

hasDirectPresence

public boolean hasDirectPresence(Session session,
                                 JID recipientJID)

initialize

public void initialize(XMPPServer server)
Description copied from class: BasicModule

Initializes the basic module.

Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.

Specified by:
initialize in interface Module
Overrides:
initialize in class BasicModule
Parameters:
server - the server hosting this module.

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.