Public Member Functions | Protected Member Functions

Swift::SetResponder< T > Class Template Reference

Inheritance diagram for Swift::SetResponder< T >:
Collaboration diagram for Swift::SetResponder< T >:

List of all members.

Public Member Functions

 SetResponder (IQRouter *router)
void start ()
 Starts the responder.
void stop ()
 Stops the responder.

Protected Member Functions

virtual bool handleSetRequest (const JID &from, const JID &to, const std::string &id, boost::shared_ptr< T > payload)=0
 Handle an incoming IQ-Set request containing a payload of class PAYLOAD_TYPE.
void sendResponse (const JID &to, const std::string &id, boost::shared_ptr< T > payload)
 Convenience function for sending an IQ response.
void sendResponse (const JID &to, const JID &from, const std::string &id, boost::shared_ptr< T > payload)
 Convenience function for sending an IQ response, with a specific from address.
void sendError (const JID &to, const std::string &id, ErrorPayload::Condition condition, ErrorPayload::Type type, Payload::ref payload=Payload::ref())
 Convenience function for responding with an error.
void sendError (const JID &to, const JID &from, const std::string &id, ErrorPayload::Condition condition, ErrorPayload::Type type, Payload::ref payload=Payload::ref())
 Convenience function for responding with an error from a specific from address.
IQRoutergetIQRouter () const

Detailed Description

template<typename T>
class Swift::SetResponder< T >

Definition at line 13 of file SetResponder.h.


Constructor & Destructor Documentation

template<typename T >
Swift::SetResponder< T >::SetResponder ( IQRouter router  )  [inline]

Definition at line 15 of file SetResponder.h.


Member Function Documentation

IQRouter* Swift::Responder< T >::getIQRouter (  )  const [inline, protected, inherited]

Definition at line 97 of file Responder.h.

virtual bool Swift::Responder< T >::handleSetRequest ( const JID from,
const JID to,
const std::string &  id,
boost::shared_ptr< T >  payload 
) [protected, pure virtual, inherited]

Handle an incoming IQ-Set request containing a payload of class PAYLOAD_TYPE.

This method is implemented in the concrete subclasses.

void Swift::Responder< T >::sendError ( const JID to,
const JID from,
const std::string &  id,
ErrorPayload::Condition  condition,
ErrorPayload::Type  type,
Payload::ref  payload = Payload::ref() 
) [inline, protected, inherited]

Convenience function for responding with an error from a specific from address.

Definition at line 93 of file Responder.h.

References Swift::IQ::createError(), and Swift::IQRouter::sendIQ().

void Swift::Responder< T >::sendError ( const JID to,
const std::string &  id,
ErrorPayload::Condition  condition,
ErrorPayload::Type  type,
Payload::ref  payload = Payload::ref() 
) [inline, protected, inherited]

Convenience function for responding with an error.

Definition at line 86 of file Responder.h.

References Swift::IQ::createError(), and Swift::IQRouter::sendIQ().

void Swift::Responder< T >::sendResponse ( const JID to,
const JID from,
const std::string &  id,
boost::shared_ptr< T >  payload 
) [inline, protected, inherited]

Convenience function for sending an IQ response, with a specific from address.

Definition at line 79 of file Responder.h.

References Swift::IQ::createResult(), and Swift::IQRouter::sendIQ().

void Swift::Responder< T >::sendResponse ( const JID to,
const std::string &  id,
boost::shared_ptr< T >  payload 
) [inline, protected, inherited]

Convenience function for sending an IQ response.

Definition at line 72 of file Responder.h.

References Swift::IQ::createResult(), and Swift::IQRouter::sendIQ().

void Swift::Responder< T >::start (  )  [inline, inherited]

Starts the responder.

After the responder has started, it will start receiving and responding to requests.

See also:
stop()

Definition at line 39 of file Responder.h.

References Swift::IQRouter::addHandler().

void Swift::Responder< T >::stop (  )  [inline, inherited]

Stops the responder.

When the responder is stopped, it will no longer receive incoming requests.

See also:
start()

Definition at line 50 of file Responder.h.

References Swift::IQRouter::removeHandler().