XMPP Component Protocol: Difference between revisions

From OLPC
Jump to navigation Jump to search
(clarify)
(add information about how the component finds this stuff, and enforce properties living in their own namespace, and enhance the examples)
Line 1: Line 1:
Information about the protocol for the OLPC-specific XMPP server component.
Information about the protocol for the OLPC-specific XMPP server component.

== Data Acquisition ==

Currently buddy properties and activity properties and are implemented using PEP nodes. It's intended that the buddy properties continue using PEP nodes, and that activity properties are changed to be propagated within a MUC using a simple MUC <presence> based protocol.

This server component shall appear as a JID which can be found using service discovery, which when subscribed to, will subscribe to your presence (and hence PEP notifications), and therefore be privy to your buddy properties and make them available for others to search and be notified of changes. If this is undesirable for privacy reasons, the component JID should simply be removed from the roster.

The component JID can also be invited into activities in order to be made aware of the activity's existence, properties and current membership (by observing the <presence> stanzas of the MUC members). This information is then made available for others to search and be notified of changes.

Laptops still receive information about their buddies' current activity (FIXME: maybe?) and properties directly from them using PEP notifications.


== Protocol Overview ==
== Protocol Overview ==


Laptops query the server component about activities and buddies. For both kinds
Laptops query the server component about activities and buddies. For both kinds of
of query, there is at most one <strong>result set</strong> active at any given
query, there is at most one <strong>result set</strong> active at any given
time. Result sets are managed using the <strong>Result Set Management</strong>
time. Result sets are managed using the <strong>Result Set Management</strong>
(RSM) XMPP extension, as described in
(RSM) XMPP extension, as described in
[http://www.xmpp.org/extensions/xep-0059.html XEP-0059].
[http://www.xmpp.org/extensions/xep-0059.html XEP-0059].


The component sends notifications to clients based on their current result sets.
The component sends notifications to clients based on their currently visible result sets.


== Activity Protocol ==
== Activity Protocol ==
Line 24: Line 34:
<query xmlns="...">
<query xmlns="...">
<activity>
<activity>
<property type="str" name="type">org.laptop.Connect</property>
<properties xmlns="...">
<property type="str" name="type">org.laptop.Connect</property>
</properties>
</activity>
</activity>
</query>
</query>
Line 33: Line 45:
<iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
<iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
<query xmlns="...">
<query xmlns="...">
<activity id="abcde123" />
<activity jid="abcde123@conference.example.org" />
</query>
</query>
</iq>
</iq>


Example: XO can search for a union of activities matching different search criteria (to be subscribed to changes of multiple activities)
Search results can contain information about the buddies in them.


<iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
Example: component replies to query.
<query xmlns="...">
<activity>
<properties xmlns="...">
<property type="str" name="type">org.laptop.Connect</property>
</properties>
</activity>
<activity jid="abcde123@conference.example.org" />
</query>
</iq>

Search results contain information about the matching activities, including their properties and their current members.

Example: component replies to query:


<iq type="result" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
<iq type="result" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
<query xmlns="...">
<query xmlns="...">
<activity activity="...">
<activity jid="connect4@conference.jabber.laptop.org">
<property type="str" name="type">org.laptop.Connect</property>
<properties xmlns="...">
<buddy jid="bob@jabber.laptop.org">
<property type="str" name="type">org.laptop.Connect</property>
</properties>
<property type="str" name="color">#005FE4,#00A0FF</property>
<buddy jid="alice@jabber.laptop.org" />
<buddy jid="bob@jabber.laptop.org" />
...
</activity>
<activity jid="abcde123@conference.example.org">
<properties xmlns="...">
...
...
</property>
</properties>
...
</activity>
...
</query>
</iq>

Any buddies who are known by the component, and not currently visible in the XO's buddy result set, will have their properties included in full.

Example: component replies to query with supplemental buddy information.

<iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
<query xmlns="...">
<activity jid="...">
<properties xmlns="...">
<property type="str" name="type">org.laptop.Connect</property>
</properties>
<buddy jid="alice@jabber.laptop.org" />
<buddy jid="bob@jabber.laptop.org">
<properties xmlns="...">
<property type="str" name="color">#005FE4,#00A0FF</property>
...
</properties>
</buddy>
</buddy>
...
...
</activity>
</activity>
...
</query>
</query>
</iq>
</iq>



=== Change announcement ===
=== Change announcement ===
Line 68: Line 123:


=== Join announcement ===
=== Join announcement ===

Example: XO tells the component that it has joined an activity.

<message type="notice" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
<activity xmlns="...">
<joined />
</activity>
</iq>


Component tells XO that somebody has joined an activity.
Component tells XO that somebody has joined an activity.
Line 87: Line 134:
=== Departure announcement ===
=== Departure announcement ===


Announce that someone has departed an actvitiy.
Component tells XO that someone has departed an actvitiy.


<message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
<message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
Line 97: Line 144:
=== Closed ===
=== Closed ===


Announce that all participants have departed an activity.
Component tells XO that all participants have departed an activity.


<message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
<message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
Line 116: Line 163:


<iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
<iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
<buddy jid="bob@jabber.laptop.org" />
<query xmlns="...">
<buddy jid="bob@jabber.laptop.org" />
</query>
</iq>
</iq>


Line 123: Line 172:
<message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
<message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
<change xmlns="..." jid="bob@jabber.laptop.org">
<change xmlns="..." jid="bob@jabber.laptop.org">
<properties>
<properties xmlns="...">
<property type="str" name="color">#005FE4,#00A0FF</property>
<property type="str" name="color">#005FE4,#00A0FF</property>
</properties>
</properties>

Revision as of 21:20, 30 November 2007

Information about the protocol for the OLPC-specific XMPP server component.

Data Acquisition

Currently buddy properties and activity properties and are implemented using PEP nodes. It's intended that the buddy properties continue using PEP nodes, and that activity properties are changed to be propagated within a MUC using a simple MUC <presence> based protocol.

This server component shall appear as a JID which can be found using service discovery, which when subscribed to, will subscribe to your presence (and hence PEP notifications), and therefore be privy to your buddy properties and make them available for others to search and be notified of changes. If this is undesirable for privacy reasons, the component JID should simply be removed from the roster.

The component JID can also be invited into activities in order to be made aware of the activity's existence, properties and current membership (by observing the <presence> stanzas of the MUC members). This information is then made available for others to search and be notified of changes.

Laptops still receive information about their buddies' current activity (FIXME: maybe?) and properties directly from them using PEP notifications.

Protocol Overview

Laptops query the server component about activities and buddies. For both kinds of query, there is at most one result set active at any given time. Result sets are managed using the Result Set Management (RSM) XMPP extension, as described in XEP-0059.

The component sends notifications to clients based on their currently visible result sets.

Activity Protocol

Namespace: http://laptop.org/xmpp/activity

Query

Return all activities matching the properties given.

Example: XO searches for all instances of the "Connect" activity.

 <iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
   <query xmlns="...">
     <activity>
       <properties xmlns="...">
         <property type="str" name="type">org.laptop.Connect</property>
       </properties>
     </activity>
   </query>
 </iq>

Example: XO searches for an activity by ID.

 <iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
   <query xmlns="...">
     <activity jid="abcde123@conference.example.org" />
   </query>
 </iq>

Example: XO can search for a union of activities matching different search criteria (to be subscribed to changes of multiple activities)

 <iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
   <query xmlns="...">
     <activity>
       <properties xmlns="...">
         <property type="str" name="type">org.laptop.Connect</property>
       </properties>
     </activity>
     <activity jid="abcde123@conference.example.org" />
   </query>
 </iq>

Search results contain information about the matching activities, including their properties and their current members.

Example: component replies to query:

 <iq type="result" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
   <query xmlns="...">
     <activity jid="connect4@conference.jabber.laptop.org">
       <properties xmlns="...">
         <property type="str" name="type">org.laptop.Connect</property>
       </properties>
       <buddy jid="alice@jabber.laptop.org" />
       <buddy jid="bob@jabber.laptop.org" />
       ...
     </activity>
     <activity jid="abcde123@conference.example.org">
       <properties xmlns="...">
         ...
       </properties>
       ...
     </activity>
     ...
   </query>
 </iq>

Any buddies who are known by the component, and not currently visible in the XO's buddy result set, will have their properties included in full.

Example: component replies to query with supplemental buddy information.

 <iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
   <query xmlns="...">
     <activity jid="...">
       <properties xmlns="...">
         <property type="str" name="type">org.laptop.Connect</property>
       </properties>
       <buddy jid="alice@jabber.laptop.org" />
       <buddy jid="bob@jabber.laptop.org">
         <properties xmlns="...">
           <property type="str" name="color">#005FE4,#00A0FF</property>
           ...
         </properties>
       </buddy>
       ...
     </activity>
     ...
   </query>
 </iq>


Change announcement

Example: component notifies client about change in activity properties:

 <message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
   <change xmlns="...">
     <properties xmlns="..." activity="abcde123">
       <property type="str" name="tags">news, france</property>
     </properties>
   </change>
 </message>

Join announcement

Component tells XO that somebody has joined an activity.

 <message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
   <activity xmlns="..." activity="abcde123"">
     <joined jid="bob@jabber.laptop.org" />
   </activity>
 </message>

Departure announcement

Component tells XO that someone has departed an actvitiy.

 <message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
   <activity xmlns="..." activity="abcde123"">
     <left jid="bob@jabber.laptop.org" />
   </activity>
 </message>

Closed

Component tells XO that all participants have departed an activity.

 <message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
   <activity xmlns="..." activity="abcde123"">
     <closed/>
   </activity>
 </message>

Buddy Protocol

Namespace: http://laptop.org/xmpp/buddy

Query

Fetch information about buddies. Similar to activity querying.

By JID:

 <iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
   <query xmlns="...">
     <buddy jid="bob@jabber.laptop.org" />
   </query>
 </iq>

Changed

 <message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
   <change xmlns="..." jid="bob@jabber.laptop.org">
     <properties xmlns="...">
       <property type="str" name="color">#005FE4,#00A0FF</property>
     </properties>
   </change>
 </message>