Public Member Functions

Swift::IQRouter Class Reference

Collaboration diagram for Swift::IQRouter:

List of all members.

Public Member Functions

 IQRouter (IQChannel *channel)
 ~IQRouter ()
void setJID (const JID &jid)
 Sets the JID of this IQ router.
const JIDgetJID () const
void setFrom (const JID &from)
 Sets the 'from' JID for all outgoing IQ stanzas.
void addHandler (IQHandler *handler)
void removeHandler (IQHandler *handler)
void addHandler (boost::shared_ptr< IQHandler > handler)
void removeHandler (boost::shared_ptr< IQHandler > handler)
void sendIQ (boost::shared_ptr< IQ > iq)
 Sends an IQ stanza.
std::string getNewIQID ()
bool isAvailable ()
bool isAccountJID (const JID &jid)
 Checks whether the given jid is the account JID (i.e.

Detailed Description

Definition at line 20 of file IQRouter.h.

Constructor & Destructor Documentation

Swift::IQRouter::IQRouter ( IQChannel channel  ) 
Swift::IQRouter::~IQRouter (  ) 

Member Function Documentation

void Swift::IQRouter::addHandler ( IQHandler handler  ) 
void Swift::IQRouter::addHandler ( boost::shared_ptr< IQHandler handler  ) 
const JID& Swift::IQRouter::getJID (  )  const [inline]

Definition at line 35 of file IQRouter.h.

std::string Swift::IQRouter::getNewIQID (  ) 
bool Swift::IQRouter::isAccountJID ( const JID jid  )  [inline]

Checks whether the given jid is the account JID (i.e.

it is either the bare JID, or it is the empty JID). Can be used to check whether a stanza is sent by the server on behalf of the user's account.

Definition at line 73 of file IQRouter.h.

References Swift::JID::isValid(), and Swift::JID::WithResource.

bool Swift::IQRouter::isAvailable (  ) 
void Swift::IQRouter::removeHandler ( IQHandler handler  ) 
void Swift::IQRouter::removeHandler ( boost::shared_ptr< IQHandler handler  ) 
void Swift::IQRouter::sendIQ ( boost::shared_ptr< IQ iq  ) 

Sends an IQ stanza.

If a JID was specified using setFrom, the JID will be set as the 'from' address on iq before sending it.

Referenced by Swift::Responder< T >::sendError(), and Swift::Responder< T >::sendResponse().

void Swift::IQRouter::setFrom ( const JID from  )  [inline]

Sets the 'from' JID for all outgoing IQ stanzas.

By default, IQRouter does not add a from to IQ stanzas, since this is automatically added by the server. This overrides this default behavior, which is necessary for e.g. components.

Definition at line 46 of file IQRouter.h.

void Swift::IQRouter::setJID ( const JID jid  )  [inline]

Sets the JID of this IQ router.

This JID is used by requests to check whether incoming results are addressed correctly.

Definition at line 31 of file IQRouter.h.