|
Yate
|
A Jabber stream event. More...
#include <yatejabber.h>
Public Types | |
| enum | Type { Terminated , Destroy , Start , Auth , Bind , Running , Message , Presence , Iq , DbResult , DbVerify , RegisterOk , RegisterFailed , Unknown } |
Static Public Member Functions | |
| static const char * | lookup (int type) |
Static Public Member Functions inherited from RefObject | |
| static bool | alive (const RefObject *obj) |
| static bool | efficientIncDec () |
Static Public Member Functions inherited from GenObject | |
| static void * | getObject (const String &name, const GenObject *obj) |
| static bool | getObjCounting () |
| static void | setObjCounting (bool enable) |
| static NamedCounter * | getObjCounter (const String &name, bool create=true) |
| static ObjList & | getObjCounters () |
Friends | |
| class | JBStream |
| class | JBClientStream |
| class | JBServerStream |
Additional Inherited Members | |
Protected Member Functions inherited from RefObject | |
| virtual void | zeroRefs () |
| bool | resurrect () |
| virtual void | destroyed () |
A Jabber stream event.
This class holds a Jabber stream event. Stream events are raised by streams and sent by the engine to the proper service
|
inline |
Constructor. Constructs an event from a stream
| type | Type of this event |
| stream | The stream that generated the event |
| element | Element that generated the event |
| from | Already parsed source JID |
| to | Already parsed destination JID |
| child | Optional type depending element's child |
References JBEvent::element(), JBEvent::from(), JBEvent::stream(), and JBEvent::to().
|
inline |
Constructor. Constructs an event from a stream
| type | Type of this event |
| stream | The stream that generated the event |
| element | Element that generated the event |
| child | Optional type depending element's child |
References JBEvent::element(), and JBEvent::stream().
| XmlElement * buildIqError | ( | bool | addTags, |
| XMPPError::Type | error, | ||
| const char * | reason = 0, |
||
| XMPPError::ErrorType | type = XMPPError::TypeModify |
||
| ) |
Build an 'iq' error stanza from event data The event's element will be released and added to the error one if the id is empty
| addTags | True to add the 'from' and 'to' attributes |
| error | Error to be returned to the event's XML sender |
| reason | Optional text to be attached to the error |
| type | Error type |
| XmlElement * buildIqResult | ( | bool | addTags, |
| XmlElement * | child = 0 |
||
| ) |
Build an 'iq' result stanza from event data
| addTags | True to add the 'from' and 'to' attributes |
| child | Optional 'iq' child (will be consumed) |
|
inline |
Get the first child of the underlying element if any
| JBClientStream * clientStream | ( | ) |
Get a client-to-server stream from the event's stream
| JBClusterStream * clusterStream | ( | ) |
Get a cluster stream from event's stream
|
inline |
Get the underlying XmlElement
Referenced by JBEvent::JBEvent(), and JBEvent::JBEvent().
Get the 'from' attribute of a received stanza
Referenced by JBEvent::JBEvent().
Get the sender's id for Write... events or the 'id' attribute if the event carries a received stanza
Get the name of an event type
References JBEvent::type().
Referenced by JBEvent::name().
Release the link with the stream to let the stream continue with events
| release | True to release the reference to the stream |
| XmlElement * releaseXml | ( | bool | del = false | ) |
Delete the underlying XmlElement(s). Release the ownership. The caller will own the returned pointer
| del | True to delete all xml elements owned by this event |
| bool sendIqResult | ( | XmlElement * | child = 0 | ) |
Build and send a stanza 'result' from enclosed 'iq' element Release the element on success
| child | Optional 'iq' child (will be consumed) |
| bool sendStanzaError | ( | XMPPError::Type | error, |
| const char * | reason = 0, |
||
| XMPPError::ErrorType | type = XMPPError::TypeModify |
||
| ) |
Build and send a stanza error from enclosed element Release the element on success
| error | Error to be returned to the event's XML sender |
| reason | Optional text to be attached to the error |
| type | Error type |
| JBServerStream * serverStream | ( | ) |
Get a server-to-server stream from the event's stream
Get the element's 'type' attribute if any
|
inline |
Get the stream that generated this event
Referenced by JBEvent::JBEvent(), and JBEvent::JBEvent().
The stanza's text or termination reason for Terminated/Destroy events
Get the 'to' attribute of a received stanza
Referenced by JBEvent::JBEvent().
|
inline |
Get the event type
Referenced by JBEvent::lookup(), and JBEvent::name().