Openfire 3.6.3 Javadoc

org.jivesoftware.openfire.handler
Class IQHandler

java.lang.Object
  extended by org.jivesoftware.openfire.container.BasicModule
      extended by org.jivesoftware.openfire.handler.IQHandler
All Implemented Interfaces:
ChannelHandler, Module
Direct Known Subclasses:
AdHocCommandHandler, IQAuthHandler, IQBindHandler, IQDiscoInfoHandler, IQDiscoItemsHandler, IQLastActivityHandler, IQOfflineMessagesHandler, IQPEPHandler, IQPEPOwnerHandler, IQPingHandler, IQPrivacyHandler, IQPrivateHandler, IQRegisterHandler, IQRosterHandler, IQSessionEstablishmentHandler, IQSharedGroupHandler, IQTimeHandler, IQvCardHandler, IQVersionHandler

public abstract class IQHandler
extends BasicModule
implements ChannelHandler

Base class whose main responsibility is to handle IQ packets. Subclasses may only need to specify the IQHandlerInfo (i.e. name and namespace of the packets to handle) and actually handle the IQ packet. Simplifies creation of simple TYPE_IQ message handlers.

Author:
Gaston Dombiak

Field Summary
protected  PacketDeliverer deliverer
           
protected  SessionManager sessionManager
           
 
Constructor Summary
IQHandler(String moduleName)
          Create a basic module with the given name.
 
Method Summary
abstract  IQHandlerInfo getInfo()
          Returns the handler information to help generically handle IQ packets.
abstract  IQ handleIQ(IQ packet)
          Handles the received IQ packet.
 void initialize(XMPPServer server)
          Initializes the basic module.
 void process(Packet packet)
          Process an XMPP packet.
 
Methods inherited from class org.jivesoftware.openfire.container.BasicModule
destroy, getName, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

deliverer

protected PacketDeliverer deliverer

sessionManager

protected SessionManager sessionManager
Constructor Detail

IQHandler

public IQHandler(String moduleName)
Create a basic module with the given name.

Parameters:
moduleName - The name for the module or null to use the default
Method Detail

process

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

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

handleIQ

public abstract IQ handleIQ(IQ packet)
                     throws UnauthorizedException
Handles the received IQ packet.

Parameters:
packet - the IQ packet to handle.
Returns:
the response to send back.
Throws:
UnauthorizedException - if the user that sent the packet is not authorized to request the given operation.

getInfo

public abstract IQHandlerInfo getInfo()
Returns the handler information to help generically handle IQ packets. IQHandlers that aren't local server iq handlers (e.g. chatbots, transports, etc) return null.

Returns:
The IQHandlerInfo for this handler

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.

Openfire 3.6.3 Javadoc

Copyright © 2003-2008 Jive Software.