Hi!

I've completed the handler skeletons for the XEP-0060 extension. For
now, we've got six handlers each assigned to one stanza type within
pubsub:

"General" namespace:
 - subscribe
 - unsubscribe
 - publish
 - create
Owner namespace:
 - configure
 - delete

In the following I'll try to explain a bit what the handlers are and
how they fit into Vysper (my progress is tracked by VYSPER-8[1] and
its subtasks).

For example, the subscribe stanza sent from a client to the
pubsub-service could look like this:
<iq type='set'
    from='[email protected]/barracks'
    to='pubsub.shakespeare.lit'
    id='sub1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <subscribe
        node='princely_musings'
        jid='[email protected]'/>
  </pubsub>
</iq>

The stanza (iq, type "set") has a inner-worker element "pubsub" (in
the 'http://jabber.org/protocol/pubsub', which I call the "general"
namespace). All pubsub messages look like this (except the type, which
could be "set", "get", "result"...).
Within the pubsub element lies the "subscribe" element
(inner-inner-worker), the element specifying what the sender wants
from the receiver. In our case "[email protected]" wants to
subscribe to the node "princely_musings" of the service
"pubsub.shakespeare.lit".

The handlers described above receive only the messages they're
supposed to receive (this stanza would be dispatched to the
subscribe-handler). Vysper provides means for easy registration of a
handler. First the stanzas are distinguished by their namespace, then
each handler (for that namespace) has to inspect the inner-element(s)
and returns either "true" (yes, I could handle this) or "false" (nope,
not for me).

Cheers,
Michael

 1: https://issues.apache.org/jira/browse/VYSPER-8

Reply via email to