xdb.cc File Reference

implement the interface to the XML database access More...

#include "jabberd.h"

Functions

xdbcache xdb_cache (instance id)
xmlnode xdb_get (xdbcache xc, jid owner, const char *ns)
int xdb_act (xdbcache xc, jid owner, const char *ns, char *act, char *match, xmlnode data)
int xdb_act_path (xdbcache xc, jid owner, const char *ns, char const *act, char const *matchpath, xht namespaces, xmlnode data)
int xdb_set (xdbcache xc, jid owner, const char *ns, xmlnode data)


Detailed Description

implement the interface to the XML database access


Function Documentation

int xdb_act ( xdbcache  xc,
jid  owner,
const char *  ns,
char *  act,
char *  match,
xmlnode  data 
)

sends new xml action, returns non-zero if failure

Referenced by _js_session_to().

int xdb_act_path ( xdbcache  xc,
jid  owner,
const char *  ns,
char const *  act,
char const *  matchpath,
xht  namespaces,
xmlnode  data 
)

xdbcache xdb_cache ( instance  id  ) 

create an xdbcache for the specified instance

This creates the _xdbcache structure from the memory pool of the instance, and registers two handlers: One handler is registered to get/handle the xdb responses that are delivered to the instance. The other handler is registered to get called regularily every 10 seconds.

Parameters:
id the instance to create the _xdbcache for.
Returns:
the newly created xdbcache

References xdbcache_struct::i, xdbcache_struct::mutex, xdbcache_struct::next, o_PRECOND, instance_struct::p, pmalloco(), xdbcache_struct::prev, register_beat(), and register_phandler().

Referenced by dialback(), dnsrv(), jsm(), pthsock_client(), xdb_file(), and xdb_sql().

xmlnode xdb_get ( xdbcache  xc,
jid  owner,
const char *  ns 
)

query data from the xdb

blocks until namespace is retrieved, host must map back to this service!

Parameters:
xc the xdbcache used for this query
owner for which JID the query should be made
ns which namespace to query
Returns:
NULL if nothing found, result else (has to be freed by the caller!)

References xdbcache_struct::cond, xdbcache_struct::data, xdbcache_struct::i, xdbcache_struct::id, jid_full(), log_debug2, LOGT_STORAGE, LOGT_THREAD, xdbcache_struct::mutex, xdbcache_struct::next, xdbcache_struct::ns, NTYPE_TAG, xdbcache_struct::owner, xdbcache_struct::preblock, xdbcache_struct::prev, xdbcache_struct::sent, xdbcache_struct::set, xmlnode_free(), xmlnode_get_firstchild(), xmlnode_get_nextsibling(), xmlnode_get_type(), and ZONE.

Referenced by _js_authreg_register(), dialback(), dnsrv(), js_config(), js_user(), pthsock_client(), xdb_file(), and xdb_sql().

int xdb_set ( xdbcache  xc,
jid  owner,
const char *  ns,
xmlnode  data 
)

sends new xml to replace old, returns non-zero if failure


Generated on Wed Sep 10 01:59:48 2008 for jabberd14 by  doxygen 1.5.5