No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0209.xml 11KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Metacontacts</title>
  10. <abstract>This document specifies an XMPP protocol extension for defining metacontacts and grouping member JIDs.</abstract>
  12. <number>0209</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards JIG</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. <spec>XEP-0049</spec>
  20. </dependencies>
  21. <supersedes/>
  22. <supersededby/>
  23. <shortname>NOT YET ASSIGNED</shortname>
  24. &ksmith;
  25. &remko;
  26. <author>
  27. <firstname>Yann</firstname>
  28. <surname>Le Boulanger</surname>
  29. <email></email>
  30. <jid></jid>
  31. </author>
  32. <revision>
  33. <version>0.1</version>
  34. <date>2007-04-10</date>
  35. <initials>psa</initials>
  36. <remark><p>Initial published version.</p></remark>
  37. </revision>
  38. <revision>
  39. <version>0.0.1</version>
  40. <date>2007-03-26</date>
  41. <initials>kis</initials>
  42. <remark><p>First draft.</p></remark>
  43. </revision>
  44. </header>
  45. <section1 topic='Introduction' anchor='intro'>
  46. <p>It is often the case that a user will have multiple representations of a single contact, either within one account (as is often the case with contacts using legacy systems through transports) or across several accounts (particularly where a user or contact has separate work and home accounts). As these are different representations of the same logical entity, this XEP provides a method for binding them together into a single meta-contact. </p>
  47. </section1>
  48. <section1 topic='Requirements' anchor='reqs'>
  49. <p>The authors have designed the metacontacts protocol with the following requirements in mind:</p>
  50. <ul>
  51. <li>It MUST provide a method of consolidating multiple roster contacts representing the same logical entity both within an account and, if the user utilises multiple accounts, between accounts.</li>
  52. <li>In the case of meta-contacts spanning multiple accounts, the meta-contact data must be resilient to the failure (or simply the absence) of any combination of these accounts. Particularly it MUST NOT rely upon the private storage of one account to store data for other accounts.</li>
  53. <li>It MUST allow a user to order the contacts within a meta-contact in a hierarchy which clients are able to use to determine which should be the default recipient of messages where more than one is available at any time but MUST NOT require the enforcement of a hierarchy.</li>
  54. </ul>
  55. </section1>
  56. <section1 topic='Overview' anchor='overview'>
  57. <p>The metacontact storage is achieved through the use of private data storage. In order to achieve the resilience described above, the private storage of each account is used to store the metacontact membership of Jids in the roster of that account. The metacontacts are stored within private data storage of each account simply as an unordered collection of meta tags.</p>
  58. <example caption='A metacontact tag'><![CDATA[
  59. <meta jid='' tag='d93nov' order='0'>
  60. ]]></example>
  61. <p>In this example, the 'jid' specifies that the roster entry '' is a member of a metacontact. The 'tag' provides a key for a metacontact; in this example all metacontacts with a tag of 'd93nov' (across all accounts) refer to the same entity. The 'order' denotes the priority of this Jid over other Jids within the metacontact, with it being preferable to use Jids with higher priority (this is roughly analogous to the 'priority' on presence stanzas when a Jid has multiple online resources in XMPP).</p>
  62. </section1>
  63. <section1 topic='Use Cases' anchor='usecases'>
  64. <p>Below are example of setting and retrieving metacontacts for an account. When using metacontacts across multiple accounts, the steps are identical and the 'tag' attributes and used across accounts (that is: when the same tag is used for multiple contacts, all entries with the tag are merged into a single metacontact whether they reside on the same of different accounts).</p>
  65. <section2 topic='Retrieving the metacontact data' anchor='retrieving'>
  66. <p>Upon login, a client will need to know the current state of the metacontact structure and so SHOULD request the state for each account.</p>
  67. <example caption='Requesting metacontacts'><![CDATA[
  68. <iq type='get' id='get1'>
  69. <query xmlns='jabber:iq:private'>
  70. <storage xmlns='storage:metacontacts'/>
  71. </query>
  72. </iq>
  73. ]]></example>
  74. <p>The result of the query will list the metacontact membership for roster entries belonging to the queried account. </p>
  75. <example caption='Server returns metacontact data'><![CDATA[
  76. <iq type='result' id='get1'>
  77. <query xmlns='jabber:iq:private'>
  78. <storage xmlns='storage:metacontacts'>
  79. <meta jid='' tag='ae18f2' order='1'/>
  80. <meta jid='' tag='82a1a5' order='1'/>
  81. <meta jid='' tag='283b94' order='2'/>
  82. <meta jid='' tag='ae18f2' order='2'/>
  83. </storage>
  84. </query>
  85. </iq>
  86. ]]></example>
  87. <p>The meta tags each represent a contact which is a member of a metacontact; as such it is likely that some roster entries for an account will not have corresponding meta tags (if they are not members of a metacontact). Each 'meta' tag MUST have a 'jid' attribute and a 'tag' attribute, an optional 'order' attribute MAY be included. </p>
  88. <p>The value of the 'jid' attribute MUST be the bare JID of a contact which is a member of the described metacontact and any jid MUST NOT be specified in this manner as a member of more than one metacontact within an account. A JID specified as a member of a metacontact for an account SHOULD be a member of the roster for that account. </p>
  89. <p>The value of the 'tag' is used as a non-human readable unique identifier for a metacontact. In the above example, there are three metacontacts; those with tags of '82a1a5' and '283b94' each have only one contact on this account, while the metacontact with tag tag='ae18f2' contains two contacts.</p>
  90. <p>The value of the 'order' attribute is used to suggest preference of some contacts over others within a metacontact; those contacts with a higher order are preferable to those with a lower order. In this example, '' is considered preferable to '' when communicating with the metacontact with tag 'ae18f2', due to their order of 2 and 1 respectively.</p>
  91. <p>Note: It is entirely possible for the query result for an account to indicate that, in isolation from other accounts, there exist metacontacts which contain only a single member contact, as is the case in the above example. The client MUST NOT discard such data, as other accounts belonging to the user (which the client need not have details of) may also have members of this metacontact. </p>
  92. </section2>
  93. <section2 topic='Storing the metacontact data' anchor='storing'>
  94. <example caption=''><![CDATA[
  95. <iq type='set' id='set2'>
  96. <query xmlns='jabber:iq:private'>
  97. <storage xmlns='storage:metacontacts'>
  98. <meta jid='' tag='ae18f2' order='1'/>
  99. <meta jid='' tag='82a1a5' order='1'/>
  100. <meta jid='' tag='283b94' order='2'/>
  101. <meta jid='' tag='492ab2' order='2'/>
  102. <meta jid='' tag='9248cc' order='1'/>
  103. </storage>
  104. </query>
  105. </iq>
  106. ]]></example>
  107. <example caption='Server returns'><![CDATA[
  108. <iq type='result' id='set2'/>
  109. ]]></example>
  110. </section2>
  111. <!--As metacontacts are especially useful when used across multiple accounts, examples are also provided for actions across two accounts.
  112. <section2 topic='Retrieving metacontact data (account 1)' anchor='dualaccount-get1'>
  113. <example caption=''><![CDATA[
  114. ]]></example>
  115. </section2>-->
  116. </section1>
  117. <section1 topic='Implementation Notes' anchor='impl'>
  118. <!--<p>Optional.</p>-->
  119. <section2 topic='Creating a metacontact' anchor='creating'>
  120. <p>Creation of a metacontact is uncomplicated; the simple addition of meta tag with a common tag results in a new metacontact.</p>
  121. </section2>
  122. <section2 topic='Removing a metacontact' anchor='removing'>
  123. <p>Similarly, to remove a metacontact all that is required is to remove the meta tags which contribute to the metacontact.</p>
  124. </section2>
  125. <section2 topic='Uniqueness of order within a metacontact' anchor='uniqueness'>
  126. <p>Although it is unavoidable that multiple contacts within a metacontact MAY have the same order (due to potentially unavailable information from other accounts), clients SHOULD NOT apply the same order to multiple members of the same metacontact where it is possible to avoid it. If multiple members of a metacontact have the same order, the behaviour is dependent upon the client; it MAY apply rules itself to determine which member to communicate with (based upon presence, recent activity or other methods) it MAY present the user with the option to sort the members such that the orders are again unique, or it MAY employ another appropriate action.</p>
  127. <p>As the order attribute is optional, clients need a method for determining which member contact to use where the metacontact consists entirely of unordered members. When ordered and unordered members are present, unordered members SHOULD be considered to have the lowest order.</p>
  128. </section2>
  129. </section1>
  130. <section1 topic='Security Considerations' anchor='security'>
  131. <p>Security considerations related to private XML storage are described in XEP-0049; this XEP introduces no additional concerns.</p>
  132. </section1>
  133. <section1 topic='IANA Considerations' anchor='iana'>
  134. <p>No interaction with &IANA; is required as a result of this XEP.</p>
  135. </section1>
  136. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  137. <p>No namespaces or parameters need to be registered with the &REGISTRAR; as a result of this XEP.</p>
  138. </section1>
  139. <section1 topic='XML Schema' anchor='schema'>
  140. <code><![CDATA[
  141. <xs:schema
  142. xmlns:xs=''
  143. targetNamespace='storage:metacontacts'
  144. xmlns='storage:metacontacts'
  145. elementFormDefault='qualified'>
  146. <xs:element name='metacontacts'>
  147. <xs:complexType>
  148. <xs:sequence>
  149. <xs:element ref='meta' minOccurs='0' maxOccurs='unbounded'/>
  150. </xs:sequence>
  151. </xs:complexType>
  152. </xs:element>
  153. <xs:element name='meta'>
  154. <xs:complexType>
  155. <xs:attribute name='jid' type='xs:string' use='required'/>
  156. <xs:attribute name='tag' type='xs:string' use='required'/>
  157. <xs:attribute name='order' type='xs:xs:unsignedInt' use='optional'/>
  158. </xs:complexType>
  159. </xs:element>
  160. </xs:schema>
  161. ]]></code>
  162. </section1>
  163. </xep>