[JDEV] Docs on the XDB element ?
Stefan Praszalowicz
stefan at avedya.com
Wed Mar 6 11:53:44 CST 2002
Hey stephane,
If I understand correctly you want to store data using Jabber's
persistence layer, aka XDB.
Well it's simple enough. What you can do is look at existing components
to see how they do it.
XDB can SET or GET xml nodes. The nodes are stored and retrieved
according to the particular host, user and namespace specified in the
packet.
- XDB Set
It will store whatever is in the node in the 'db' (flat files by
default)
Example:
<xdb type='set' to='someuser at host.com'
from='sessions' ns='jabber:x:offline' id='4'>
<offline xmlns='jabber:x:offline'/>
</xdb>
This will replace the content of the namespace 'jabber:x:offline', for
the user 'someuser' of the host 'host.com' by the fragment <offline
.../>
- XDB Get
<xdb type='get' to='popo at host.com'
from='sessions' ns='jabber:iq:auth' id='1'/>
This will look into a file for the server 'host.com', user 'popo' and
namespace 'jabber:iq:auth' and send you back the node that's been set at
this place.
It will return a packet that looks like:
<xdb type='result' to='sessions'
from='popo at host.com' ns='jabber:iq:auth' id='1'>
<password xmlns='jabber:iq:auth'>frob</password>
</xdb>
Basically you can think of that as a way to store variables, with a
variable name equal to server+user+namespace.
Note that Jabber provides a default flat file XDB component that's able
to store and retrieve any XML you want without any change. If you want
to have a SQL based XDB component, then you must create SQL queries
that'll match every particular XML you want to store (unless you store
the XML direclty into a varchar or text, blob ...)
Hope it helps a bit.
Stefan
On Wed, 2002-03-06 at 17:55, Riviere Stéphane Jean wrote:
> Hi,
>
> I'm currently developing external server components (in Java) and need to
> store/retrieve some information about the component, registered clients....
>
> This can be done using the <XBD/> element, but I didn't find much
> information but this :
> http://docs.jabber.org/general/html/component-intro.html
>
> Does further documentation about XDB exist or will I have to make personal
> tests to find how it works ?
>
> Thanks for your help,
>
> Stéphane.
>
>
> [ For those who are interested on my configuration :
> - jabberd 1.4.1 with Conferencing / JUD / MSN Transport / Weather service
> ;-)
> - server is an old P2 300MHz / 92MB RAM running a RedHat 6.2
> - external components are developed in Java with jabberbeans latest CVS
> sources
> ]
>
> ------------------------------------------
> email : Stephane.sr.Riviere at atosorigin.com
> tél : (0)3.20.60.77.14
>
> Ingénieur R&D
> Equipe Grands Projets
> Direction Recherche & Développement
> ATOS ORIGIN Activité Multimédia
> http://www.atosorigin.com
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
More information about the JDev
mailing list