GenericRequest is used for managing the sending of, and handling of replies to, iq stanzas that do not have their own Request types. More...
Public Member Functions | |
GenericRequest (IQ::Type type, const JID &receiver, boost::shared_ptr< Payload > payload, IQRouter *router) | |
Create a request suitable for client use. | |
GenericRequest (IQ::Type type, const JID &sender, const JID &receiver, boost::shared_ptr< Payload > payload, IQRouter *router) | |
Create a request suitable for component or server use. | |
virtual void | handleResponse (boost::shared_ptr< Payload > payload, ErrorPayload::ref error) |
Internal method, do not use. | |
void | send () |
const JID & | getReceiver () const |
Public Attributes | |
boost::signal< void(boost::shared_ptr < PAYLOAD_TYPE > , ErrorPayload::ref)> | onResponse |
Signal emitted when a reply to the iq has been received. | |
Protected Member Functions | |
boost::shared_ptr< PAYLOAD_TYPE > | getPayloadGeneric () const |
virtual void | setPayload (boost::shared_ptr< Payload > payload) |
boost::shared_ptr< Payload > | getPayload () const |
virtual void | handleResponse (boost::shared_ptr< Payload >, boost::shared_ptr< ErrorPayload >)=0 |
GenericRequest is used for managing the sending of, and handling of replies to, iq stanzas that do not have their own Request types.
To create an iq stanza, call a constructor with the type of the iq that needs to be sent (either Set or Get), addressing information (clients should use the constructor that doesn't specify a sender), the payload that should be sent in the iq, and the IQRouter for the connection, obtained through the Client or CoreClient object.
Having created a GenericRequest, connect to the onResponse signal to be told when a response (either a result or an error) has been received by Swiften.
To send the iq, then call send() - onResponse will be called when a reply is received.
Definition at line 23 of file GenericRequest.h.
Swift::GenericRequest< PAYLOAD_TYPE >::GenericRequest | ( | IQ::Type | type, | |
const JID & | receiver, | |||
boost::shared_ptr< Payload > | payload, | |||
IQRouter * | router | |||
) | [inline] |
Create a request suitable for client use.
type | Iq type - Get or Set. | |
receiver | JID to send request to. | |
payload | Payload to send in stanza. | |
router | IQRouter instance for current connection. |
Definition at line 32 of file GenericRequest.h.
Swift::GenericRequest< PAYLOAD_TYPE >::GenericRequest | ( | IQ::Type | type, | |
const JID & | sender, | |||
const JID & | receiver, | |||
boost::shared_ptr< Payload > | payload, | |||
IQRouter * | router | |||
) | [inline] |
Create a request suitable for component or server use.
As a client, use the other constructor instead.
type | Iq type - Get or Set. | |
sender | JID to use in "from" of stanza. | |
receiver | JID to send request to. | |
payload | Payload to send in stanza. | |
router | IQRouter instance for current connection. |
Definition at line 48 of file GenericRequest.h.
boost::shared_ptr<Payload> Swift::Request::getPayload | ( | ) | const [inline, protected, inherited] |
Definition at line 78 of file Request.h.
Referenced by Swift::GenericRequest< InBandRegistrationPayload >::getPayloadGeneric().
boost::shared_ptr<PAYLOAD_TYPE> Swift::GenericRequest< PAYLOAD_TYPE >::getPayloadGeneric | ( | ) | const [inline, protected] |
Definition at line 65 of file GenericRequest.h.
const JID& Swift::Request::getReceiver | ( | ) | const [inline, inherited] |
virtual void Swift::GenericRequest< PAYLOAD_TYPE >::handleResponse | ( | boost::shared_ptr< Payload > | payload, | |
ErrorPayload::ref | error | |||
) | [inline, virtual] |
Internal method, do not use.
Definition at line 60 of file GenericRequest.h.
virtual void Swift::Request::handleResponse | ( | boost::shared_ptr< Payload > | , | |
boost::shared_ptr< ErrorPayload > | ||||
) | [protected, pure virtual, inherited] |
void Swift::Request::send | ( | ) | [inherited] |
virtual void Swift::Request::setPayload | ( | boost::shared_ptr< Payload > | payload | ) | [inline, protected, virtual, inherited] |
boost::signal<void (boost::shared_ptr<PAYLOAD_TYPE>, ErrorPayload::ref)> Swift::GenericRequest< PAYLOAD_TYPE >::onResponse |
Signal emitted when a reply to the iq has been received.
Contains a payload if one was present, and an error if one was present.
Definition at line 73 of file GenericRequest.h.
Referenced by Swift::GenericRequest< InBandRegistrationPayload >::handleResponse().