Class IQHandler
java.lang.Object
org.jivesoftware.openfire.container.BasicModule
org.jivesoftware.openfire.handler.IQHandler
- All Implemented Interfaces:
ChannelHandler<org.xmpp.packet.IQ>,Module
- Direct Known Subclasses:
AdHocCommandHandler,IQBindHandler,IQBlockingHandler,IQDiscoInfoHandler,IQDiscoItemsHandler,IQEntityTimeHandler,IQLastActivityHandler,IQMessageCarbonsHandler,IQMUCvCardHandler,IQOfflineMessagesHandler,IQPEPHandler,IQPEPOwnerHandler,IQPingHandler,IQPrivacyHandler,IQPrivateHandler,IQRegisterHandler,IQRosterHandler,IQSessionEstablishmentHandler,IQSharedGroupHandler,IQvCardHandler,IQVersionHandler
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract IQHandlerInfogetInfo()Returns the handler information to help generically handle IQ packets.abstract org.xmpp.packet.IQhandleIQ(org.xmpp.packet.IQ packet) Handles the received IQ packet.voidinitialize(XMPPServer server) Initializes the basic module.booleanRFC 6121 8.5.1.voidprocess(org.xmpp.packet.IQ iq) Process an XMPP packet.Optional<org.xmpp.packet.IQ>processNoSuchUserCheck(org.xmpp.packet.IQ iq) Performs the check as defined in RFC 6121 8.5.1.Methods inherited from class org.jivesoftware.openfire.container.BasicModule
destroy, getName, start, stop
-
Field Details
-
deliverer
-
sessionManager
-
-
Constructor Details
-
IQHandler
Create a basic module with the given name.- Parameters:
moduleName- The name for the module or null to use the default
-
-
Method Details
-
performNoSuchUserCheck
public boolean performNoSuchUserCheck()RFC 6121 8.5.1. "No Such User" specifies how the server must respond to a request made against a non-existing user. The abstract IQ Handler plugin can act accordingly, but allows implementations to override this behavior. By default, Openfire will perform a non-existing user check and act according to the RFC 6121. Subclasses can disable this behavior by overriding this method, and returning 'false'.- Returns:
- 'true' if the Abstract IQ Handler implementation should detect if the IQ request is made against a non-existing user and return an error.
- See Also:
-
processNoSuchUserCheck
Performs the check as defined in RFC 6121 8.5.1. "No Such User":If the 'to' address specifies a bare JID <localpart@domainpart> or full JID <localpart@domainpart/resourcepart> where the domainpart of the JID matches a configured domain that is serviced by the server itself, the server MUST proceed as follows. [...] If the user account identified by the 'to' attribute does not exist, how the stanza is processed depends on the stanza type. [...] For an IQ stanza, the server MUST return a <service-unavailable/> stanza error to the sender.
- See Also:
-
process
Description copied from interface:ChannelHandlerProcess an XMPP packet.- Specified by:
processin interfaceChannelHandler<org.xmpp.packet.IQ>- Parameters:
iq- a packet to process.- Throws:
PacketException- thrown if the packet is malformed (results in the sender's session being shutdown).
-
handleIQ
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
Returns the handler information to help generically handle IQ packets. IQHandlers that aren't local server iq handlers (e.g. chatbots, transports, etc) returnnull.- Returns:
- The IQHandlerInfo for this handler
-
initialize
Description copied from class:BasicModuleInitializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
- Specified by:
initializein interfaceModule- Overrides:
initializein classBasicModule- Parameters:
server- the server hosting this module.
-