|
jabberd14
1.6.2
|
#include <jabberd.h>
Public Member Functions | |
| instance_base (instance i, xmlnode x) | |
Protected Member Functions | |
| virtual result | on_packet (dpacket dp) |
| virtual result | on_stanza_packet (dpacket dp) |
| virtual result | on_xdb_packet (dpacket dp) |
| virtual result | on_log_packet (dpacket dp) |
| virtual result | on_route_packet (dpacket dp) |
| virtual result | on_message_stanza (jpacket p) |
| virtual result | on_presence_stanza (jpacket p) |
| virtual result | on_iq_stanza (jpacket p) |
| virtual result | on_subscription_stanza (jpacket p) |
| virtual void | on_heartbeat () |
| void | set_heartbeat_interval (int interval) |
| void | deliver (dpacket p) |
| void | deliver (xmlnode x) |
| void | deliver_fail (dpacket p, const std::string &reason_text) |
| void | bounce_stanza (xmlnode x, xterror xterr) |
| std::string | get_instance_id () |
| logmessage | log (loglevel level) |
| xmlnode | get_instance_config () |
class that implements the basic functionality for a component in the server
| xmppd::instance_base::instance_base | ( | instance | i, |
| xmlnode | x | ||
| ) |
constructor to create an OOP instance from jabberd14's instance structure
| i | the instance struct for this component |
| x | configuration element that caused this instance to be loaded |
References get_instance_id(), o_DELIVER, and register_phandler().
| void xmppd::instance_base::bounce_stanza | ( | xmlnode | x, |
| xterror | xterr | ||
| ) | [protected] |
create a bounce for a stanza, send this bounce back
This method consumes the stanza!
| x | the stanza that should get bounced |
| xterr | the error reason used to bounce the stanza |
References deliver(), and jutil_error_xmpp().
Referenced by on_iq_stanza(), on_message_stanza(), and on_presence_stanza().
| void xmppd::instance_base::deliver | ( | dpacket | p | ) | [protected] |
send out a stanza
| p | the packet containing the stanza, that should be sent |
Referenced by bounce_stanza(), and deliver().
| void xmppd::instance_base::deliver | ( | xmlnode | x | ) | [protected] |
send out a stanza
| x | the xmlnode representing the stanza that should be sent |
References deliver(), and dpacket_new().
| void xmppd::instance_base::deliver_fail | ( | dpacket | p, |
| const std::string & | reason_text | ||
| ) | [protected] |
reject accepting a packet
| p | the packet that could not sucessfully be processed |
| reason_text | textual reason why the packet has been rejected |
Referenced by on_log_packet(), on_packet(), on_route_packet(), on_stanza_packet(), and on_xdb_packet().
| xmlnode xmppd::instance_base::get_instance_config | ( | ) | [protected] |
get instance's configuration
References j_strcmp(), instance_struct::x, xmlnode_get_firstchild(), xmlnode_get_namespace(), xmlnode_get_nextsibling(), and xmlnode_get_type().
| std::string xmppd::instance_base::get_instance_id | ( | ) | [protected] |
get the (main) ID of this instance
References instance_struct::id.
Referenced by instance_base().
| logmessage xmppd::instance_base::log | ( | loglevel | level | ) | [protected] |
get a logmessage, that can be used to generate a message that gets logged
| level | the loglevel to use |
| void xmppd::instance_base::on_heartbeat | ( | ) | [protected, virtual] |
event that gets fired regularly
| result xmppd::instance_base::on_iq_stanza | ( | jpacket | p | ) | [protected, virtual] |
event that handles received iq stanzas
The default implementation is to bounce the stanza
| p | the received message stanza |
References bounce_stanza(), and r_DONE.
Referenced by on_stanza_packet().
| result xmppd::instance_base::on_log_packet | ( | dpacket | dp | ) | [protected, virtual] |
event that handles received packets, that contain a normal stanza (type p_LOG)
The default implementation is to bounce the packet
| dp | the packet containing the stanza |
References deliver_fail(), and r_DONE.
Referenced by on_packet().
| result xmppd::instance_base::on_message_stanza | ( | jpacket | p | ) | [protected, virtual] |
event that handles received message stanzas
The default implementation is to bounce the stanza
| p | the received message stanza |
References bounce_stanza(), and r_DONE.
Referenced by on_stanza_packet().
| result xmppd::instance_base::on_packet | ( | dpacket | dp | ) | [protected, virtual] |
event that handles received packets
The default implementation of this handler checks the type of packet that has been received and calls the relevant handler: on_stanza_packet(), on_xdb_packet(), on_log_packet(), or on_route_packet()
| dp | packet that has to be handled |
References deliver_fail(), on_log_packet(), on_route_packet(), on_stanza_packet(), on_xdb_packet(), p_LOG, p_NORM, p_ROUTE, p_XDB, r_DONE, r_ERR, and dpacket_struct::type.
| result xmppd::instance_base::on_presence_stanza | ( | jpacket | p | ) | [protected, virtual] |
event that handles received presence stanzas
The default implementation is to bounce the stanza
| p | the received message stanza |
References bounce_stanza(), and r_DONE.
Referenced by on_stanza_packet().
| result xmppd::instance_base::on_route_packet | ( | dpacket | dp | ) | [protected, virtual] |
event that handles received packets, that contain a normal stanza (type p_ROUTE)
The default implementation is to bounce the packet
| dp | the packet containing the stanza |
References deliver_fail(), and r_DONE.
Referenced by on_packet().
| result xmppd::instance_base::on_stanza_packet | ( | dpacket | dp | ) | [protected, virtual] |
event that handles received packets, that contain a normal stanza (type p_NORM)
The default implementation of this handler is to forward the stanza to the relevant handler: on_message_stanza(), on_presence_stanza(), on_iq_stanza(), or on_subscription_stanza()
| dp | the packet containing the stanza |
References deliver_fail(), jpacket_new(), on_iq_stanza(), on_message_stanza(), on_presence_stanza(), on_subscription_stanza(), r_DONE, and dpacket_struct::x.
Referenced by on_packet().
| result xmppd::instance_base::on_subscription_stanza | ( | jpacket | p | ) | [protected, virtual] |
event that handles received subscription stanzas
The default implementation is to bounce the stanza
| p | the received message stanza |
References r_DONE, and xmlnode_free().
Referenced by on_stanza_packet().
| result xmppd::instance_base::on_xdb_packet | ( | dpacket | dp | ) | [protected, virtual] |
event that handles received packets, that contain a normal stanza (type p_XDB)
The default implementation is to bounce the packet
| dp | the packet containing the stanza |
References deliver_fail(), and r_DONE.
Referenced by on_packet().
| void xmppd::instance_base::set_heartbeat_interval | ( | int | interval | ) | [protected] |
(re)set the heartbeat interval
If no heartbeat has been registered for this instance yet, it gets registered
| interval | the interval in seconds how often the on_heartbeat() event should be fired, 0 for disabling heartbeat again |
References register_beat().
1.7.6.1