Package rocks.xmpp.core.stanza
Class AbstractIQHandler
- java.lang.Object
-
- rocks.xmpp.core.stanza.AbstractIQHandler
-
- All Implemented Interfaces:
IQHandler
- Direct Known Subclasses:
AbstractRpcManager
,BlockingManager
,ContactExchangeManager
,EntityTimeHandler
,HttpAuthenticationManager
,PingHandler
,PrivacyListManager
,ReachabilityManager
,RosterManager
,SoftwareVersionProtocol
,StreamInitiationManager
public abstract class AbstractIQHandler extends Object implements IQHandler
This class is an IQ handler for extension managers.If an extension is disabled, IQs with this extension are automatically responded to with
<service-unavailable
.If the extension is known, but the request contains a wrong type (e.g. 'set' instead of 'get') this manager automatically responds with a
<bad-request/>
error.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>
getPayloadClass()
Gets the IQ's payload class.IQ
handleRequest(IQ iq)
-
-
-
Method Detail
-
getPayloadClass
public final Class<?> getPayloadClass()
Description copied from interface:IQHandler
Gets the IQ's payload class. Only payloads of this type are handled by this handler.- Specified by:
getPayloadClass
in interfaceIQHandler
- Returns:
- The IQ's payload class.
- See Also:
Stanza.getExtension(Class)
-
handleRequest
public final IQ handleRequest(IQ iq)
Description copied from interface:IQHandler
Handles an inbound IQ stanza of typeget
orset
.The returned IQ must be of type
result
orerror
. Ifnull
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()
orIQ.createError(rocks.xmpp.core.stanza.model.StanzaError)
to generate the response IQ (i.e. an IQ with the same id).- Specified by:
handleRequest
in interfaceIQHandler
- Parameters:
iq
- The inbound IQ stanza.- Returns:
- The result or error IQ, which is the response to sending entity.
-
-