@FunctionalInterface public interface IQHandler
IQ.Type.GET or IQ.Type.SET) by processing the request and returning an IQ response of type result or error.
In contrast to XmppSession.addInboundIQListener(Consumer) which merely listens to IQ stanzas, IQ handlers facilitate the proper handling of IQ requests by enforcing the semantics of IQs, especially:
8.2.3. IQ SemanticsIQ handlers are registered for a specific payload type viaAn entity that receives an IQ request of type "get" or "set" MUST reply with an IQ response of type "result" or "error". The response MUST preserve the 'id' attribute of the request (or be empty if the generated stanza did not include an 'id' attribute).
XmppSession.addIQHandler(Class, IQHandler).| Modifier and Type | Method and Description |
|---|---|
IQ |
handleRequest(IQ iq)
|
IQ handleRequest(IQ iq)
get or set.
The returned IQ must be of type result or error.
If null is returned, no response is returned to the requester and you must take responsibility of sending a response manually. However, this approach is not recommended.
Use IQ.createResult() or IQ.createError(rocks.xmpp.core.stanza.model.StanzaError) to generate the response IQ (i.e. an IQ with the same id).
iq - The inbound IQ stanza.Copyright © 2014–2015 XMPP.rocks. All rights reserved.