XMPP Component Protocol: Difference between revisions

From OLPC
Jump to navigation Jump to search
(clarify)
Line 3: Line 3:
== Protocol Overview ==
== Protocol Overview ==


Laptops query the server about activities and buddies. For both kinds of
Laptops query the server component about activities and buddies. For both kinds
query, there is at most one <strong>result set</strong> active at any given
of 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
Line 39: Line 39:
Search results can contain information about the buddies in them.
Search results can contain information about the buddies in them.


Example: server replies to query.
Example: component replies to query.


<iq type="get" 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 activity="...">
Line 57: Line 57:
=== Change announcement ===
=== Change announcement ===


Example: server notifies client about change in activity properties:
Example: component notifies client about change in activity properties:


<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">

Revision as of 20:53, 30 November 2007

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

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 current 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>
       <property type="str" name="type">org.laptop.Connect</property>
     </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 id="abcde123" />
   </query>
 </iq>

Search results can contain information about the buddies in them.

Example: component replies to query.

 <iq type="result" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
   <query xmlns="...">
     <activity activity="...">
       <property type="str" name="type">org.laptop.Connect</property>
       <buddy jid="bob@jabber.laptop.org">
         <property type="str" name="color">#005FE4,#00A0FF</property>
         ...
         </property>
       </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

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.

 <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

Announce 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

Announce 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">
   <buddy jid="bob@jabber.laptop.org" />
 </iq>

Changed

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