Hey Koder,

First take a look at <http://www.xmpp.org/extensions/xep-0163.html>.

"There is no need for multiple publishers to a PEP service, since by definition the service generates information associated with only one entity. The owner-publisher for every node is the bare JID of the account owner."

From that it is safe to assume that a server can not subscribe via PubSub. Edit: According to Section 10 it can, but servers/clients may still break, best not to try.

Your server will have a hard time keeping track of all of the information, but I will outline how it could be possible. Two corporations/servers: benvolio (your client), juliet (your client's contact), montague.net (your client's server, a.k.a. your server), capulet.com (juliet's server). By the end of this you will see that it is, unfortunately, not possible.

Firstly, as per the XEP, the Juliet creates the node. That is of no interest to your users, unless the subscription has initial data (in which case their server should forward it anyway).

Second, Juliet updates that data. Benvolio will receive a presence notification via montague.net. It is at this point that montague.net should interpret the data and store it.

<message from='[EMAIL PROTECTED]'
         to='[EMAIL PROTECTED]'
         type='headline'
         id='foo'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='http://jabber.org/protocol/tune'>
      <item>
        [...]
      </item>
    </items>
  </event>
</message>

Montague.net can now use this opportunity to store the subscription information about [EMAIL PROTECTED] There will be many 'items' elements and many 'item' elements per 'items' element, you will have to decide how to store that in your database (you could piggy-back off the exact same table that your clients use).

Third, Benvolio logs off and on again. First thing his client does is to send his presence.

<presence from='[EMAIL PROTECTED]'>
  <c xmlns='http://jabber.org/protocol/caps'
     node='http://www.chatopus.com/ec'
     ver='2.1'
     ext='foobar pres+'/>
</presence>

Montague will now forward that to all his subscriptions (which is important, you CAN'T stop this message, otherwise Juliet will not know about his new log-in, he will appear offline).

<presence from='[EMAIL PROTECTED]' to='[EMAIL PROTECTED]'>
  <c xmlns='http://jabber.org/protocol/caps'
     node='http://www.chatopus.com/ec'
     ver='2.1'
     ext='foobar pres+'/>
</presence>

Capulet.com now sees this message and realises that it must send Juliet's last subscription notice.

<message from='[EMAIL PROTECTED]'
         to='[EMAIL PROTECTED]'
         type='headline'
         id='foo'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='http://jabber.org/protocol/tune'>
      <item>
        [...]
      </item>
    </items>
  </event>
  <x xmlns='jabber:x:delay' stamp='20031213T23:58:37'/>
</message>

You can't avoid it. Sorry. Nor would I know why you would want to, maybe if you could explain your situation?

Cheers,
 Jonathan Dickinson

[EMAIL PROTECTED] wrote:
Hi Peter,

could you please elaborate on this subject?

Thank you in advance.
Koder
-------- Original-Nachricht --------
Datum: Thu, 16 Aug 2007 09:51:33 +0200
Von: Jonathan Dickinson <[EMAIL PROTECTED]>
An: [EMAIL PROTECTED]
Betreff: Re: [jdev] mirroring many presence servers

        Hey,
Sorry, I don't know of any JEP that would help. You will probably have to write it yourself. As I said: * Client sends presence notification
     * Your server "notices" the notification
     * Your server stores this in the database
     * Your server forwardes the original notification
You can also subscribing your sever. As far as I know, that should work, but some other clients/servers might break if you try that. Maybe someone else could elaborate (Peter)? I have noticed that websites (such as the Jabber world map) need a contact in your contact list to subscribe, I'm not sure if has occurred to anyone to just subscribe the server. Cheers,
  Jonathan Dickinson
[EMAIL PROTECTED] wrote:
 > Hi Jonathan,
 >
> I understand that a client must/can subscribe to an other client to > get notifications of his status.
 >
 > But can a presence server do something like that?
 > Can a presence server subscribe to other clients?
 >
> The Idea is, that I have in my organisation Clients, that only needs > the presence information of other clients in other organisations. So I > want to cache/mirror in my server the presence information ot the > clients ot the other organisation, so that I do need to connect the > server ot the partners for each request from the clients of my > organisation.
 >
 > Thanks
 > Koder
 >
 >> -------- Original-Nachricht --------
 >> Datum: Wed, 15 Aug 2007 10:34:35 +0200
 >> Von: Jonathan Chayce Dickinson <[EMAIL PROTECTED]>
 >> An: Jabber software development list <jdev@jabber.org>
 >> Betreff: Re: [jdev] mirroring many presence servers
 >>
 >> Hey,
 >>
 >> If you know the language that your server is written in you could catch
 >> all the presence notifications before sending them on and store them
 >> locally (in your database etc.).
 >>
 >> However, what you are asking kinda doesn't make sense. If you never get
 >> a presence notification from a contact, they *are* offline (if you
 >> notice, while your client is connecting to a Jabber server all your
 >> contacts briefly show as offline), unless you are not subscribed to
 >> them, in which case you would never know anyway.
 >>
 >> Hope this helps.
 >>
 >> Cheers,
 >> Jonathan Dickinson
 >>
 >> On Wed, 2007-08-15 at 10:19 +0200, [EMAIL PROTECTED] wrote:
 >> > Hi,
 >> >
 >> > I have the following scenario in my student project. Which solution
 >> > would you propose?
 >> >
 >> > I have many business partners "B", "C" and "D", each of them has his
 >> > own presence server "PB", "PC" and "PD".
 >> >
 >> > I need in my organisation "A" a presence service "PA", who "mirros"
 >> > the actual status of all the users on PB, PC and PD, to whom I
 >> > subscribed.
 >> >
>> > I know, that I could implement my presence service PA as a client, who >> > subscribes to all the users on PB, PC and PD. What I am asking for: is
 >> > there an other solution?
 >> >
>> > 1. Can I be on the one hand a client of the servers PB, PC, PD, and on
 >> > the other hand a "server" for other applications/clients/servers.
 >> >
 >> > 2. Can I say to the other servers PB, PC and PD "hey, I am a presence
>> > server (and not a client), would you please send me each change of the
 >> > status of my users, to whom I subscribed".
 >> >
 >> > 3. Can I make benefit of the s2s protocol in my scenario?
 >> >
 >> > You can say: What I want to have, is a local presence service in my
 >> > organisation, who localy mirros many others presence servers of other
 >> > partners. How would be your solution?
 >> >
 >> > Thank you for your help and your patience.
 >> > Koder
 >> >
 >> >
 >> >
 >> > --
 >> > Psssst! Schon vom neuen GMX MultiMessenger gehört?
 >> > Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
>> -- >> Jonathan Dickinson
 >> Developer [Xeer Technology]
 >>
 >> email: [EMAIL PROTECTED]
 >> jabber: [EMAIL PROTECTED]
 >> twitter: Moitoius
 >>
 >> Principle will kick us all in the butt one day. If you have principle,
 >> you have all you will ever need.
 >
 >
 >
> -- > Psssst! Schon vom neuen GMX MultiMessenger gehört?
 > Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

Reply via email to