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-0312.xml 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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>PubSub Since</title>
  10. <abstract>This specification defines a publish-subscribe feature that enables a subscriber to automatically receive pubsub and PEP notifications since the last logout time of a specific resource.</abstract>
  11. &LEGALNOTICE;
  12. <number>0312</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. </dependencies>
  20. <supersedes/>
  21. <supersededby/>
  22. <shortname>NOT_YET_ASSIGNED</shortname>
  23. &hildjj;
  24. &stpeter;
  25. <revision>
  26. <version>0.3</version>
  27. <date>2012-05-29</date>
  28. <initials>psa</initials>
  29. <remark><p>Corrected namespace to use namespace versioning; tweaked some of the delivery rules.</p></remark>
  30. </revision>
  31. <revision>
  32. <version>0.2</version>
  33. <date>2012-03-08</date>
  34. <initials>psa</initials>
  35. <remark><p>Replaced jabber:iq:last with a specialized namespace.</p></remark>
  36. </revision>
  37. <revision>
  38. <version>0.1</version>
  39. <date>2012-02-29</date>
  40. <initials>psa</initials>
  41. <remark><p>Initial published version.</p></remark>
  42. </revision>
  43. <revision>
  44. <version>0.0.2</version>
  45. <date>2012-02-29</date>
  46. <initials>psa</initials>
  47. <remark><p>Addressed some feedback from the XMPP Council.</p></remark>
  48. </revision>
  49. <revision>
  50. <version>0.0.1</version>
  51. <date>2012-02-27</date>
  52. <initials>psa</initials>
  53. <remark><p>First draft.</p></remark>
  54. </revision>
  55. </header>
  56. <section1 topic='Introduction' anchor='introduction'>
  57. <p>Many &xep0060; and &xep0163; services send notifications based on information about the presence of subscribers. This implies that subscribers might not receive notifications that were generated when they are offline at a particular resource. This specification defines how pubsub and PEP services can use the last logout information to send interim notifications to subscribers. (Although &xep0256; defines a way for clients to note their last logout time, this document defines a specialized namespace to reduce the possibility that non-initial presence notifications would trigger the synchronization behavior.)</p>
  58. </section1>
  59. <section1 topic='How It Works' anchor='feature'>
  60. <p>When sending initial presence, a subscriber (more precisely, a subscriber's specific full JID) can indicate how long ago it last logged out by including an &lt;ago/&gt; element qualifed by the 'urn:xmpp:ago:0' namespace; the 'secs' attribute indicates the number of seconds since this resource was last online.</p>
  61. <example caption='Last Logout Indication in Initial Presence'><![CDATA[
  62. <presence from='juliet@capulet.com/balcony'>
  63. <ago xmlns='urn:xmpp:ago:0' secs='86511'/>
  64. </presence>
  65. ]]></example>
  66. <p>Upon receiving such an indication, a pubsub or PEP service that supports presence-based notifications and the "pubsub-since" feature defined herein would behave as follows:</p>
  67. <ol>
  68. <li>The service MUST send to the subscriber's full JID all of the notifications stored in the relevant node's history that were generated since the last logout time (although see the rule #2 and rule #5 below).</li>
  69. <li>The service SHOULD NOT include items that were deleted from the node, and MAY purge the node if items are deleted (naturally, if the node is purged then the service would not be able to meet rule #1 above).</li>
  70. <li>The service SHOULD include only the final version of each pubsub notification (e.g., in case of items that were updated during the period when the subscriber was offline).</li>
  71. <li>The service MAY adjust its definition of "interim notification" to account for reasonable clock skew (e.g., including notifications up to five minutes older than the subscriber's last logout time).</li>
  72. <li>The service MAY limit the number of notifications that it sends to avoid resource contraints.</li>
  73. <li>The service MAY include &xep0059; data so that the subscriber can page through the set of interim notifications.</li>
  74. </ol>
  75. <p>If the pubsub service receives subsequent available presence from that full JID (even a presence update that includes the last availability indication), it MUST behave according to the rules in XEP-0060 or XEP-0163 (typically this means it would do nothing, since presence-based delivery toggles notifications "on" when receiving initial presence and toggles notifications "off" when receiving unavailable presence).</p>
  76. </section1>
  77. <section1 topic='Determining Support' anchor='disco'>
  78. <p>If a pubsub or PEP service supports the protocol defined herein, it MUST report that by including a &xep0030; feature of "http://jabber.org/protocol/pubsub#since" in response to disco#info requests:</p>
  79. <example caption="Service discovery information request"><![CDATA[
  80. <iq from='bard@shakespeare.lit/globe'
  81. id='sb2t1d49'
  82. to='pubsub.shakespeare.lit'
  83. type='get'>
  84. <query xmlns='http://jabber.org/protocol/disco#info'/>
  85. </iq>
  86. ]]></example>
  87. <example caption="Service discovery information response"><![CDATA[
  88. <iq from='pubsub.shakespeare.lit'
  89. id='sb2t1d49'
  90. to='bard@shakespeare.lit/globe'
  91. type='result'>
  92. <query xmlns='http://jabber.org/protocol/disco#info'>
  93. <identity category='pubsub' type='service'/>
  94. <feature var='http://jabber.org/protocol/pubsub'/>
  95. <feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/>
  96. <feature var='http://jabber.org/protocol/pubsub#presence-notifications'/>
  97. <feature var='http://jabber.org/protocol/pubsub#since'/>
  98. </query>
  99. </iq>
  100. ]]></example>
  101. </section1>
  102. <section1 topic='Security Considerations' anchor='security'>
  103. <p>The number or cumulative size of the notifications published since the subscriber's last login time might be large, causing a significant load on the service. Implementations might consider truncating the interim notifications to avoid a denial of service.</p>
  104. </section1>
  105. <section1 topic='IANA Considerations' anchor='iana'>
  106. <p>This document requires no interaction with &IANA;.</p>
  107. </section1>
  108. <section1 topic='Implementation Notes' anchor='impl'>
  109. <p>The Last Activity extension (XEP-0012) notates time in seconds before the moment of stanza generation. Although some commenters have suggested that it would be easier to implement last activity notations in terms of UTC timestamps, clients can mitigate some implementation problems by storing the last activity time in UTC instead of local time (in case the device is moved across time zones) and by using standard technologies for clock synchronization such as &rfc1305; and &xep0202;. The five-minute grace period is merely a suggestion for developers; implementation and deployment experience might indicate that other values are more prudent.</p>
  110. </section1>
  111. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  112. <section2 topic='Protocol Namespaces' anchor='registrar-namespaces'>
  113. <p>The &REGISTRAR; shall add 'urn:xmpp:ago:0' to its registry at &NAMESPACES;.</p>
  114. </section2>
  115. <section2 topic='Service Discovery Features' anchor='registrar-features'>
  116. <p>Support for the feature defined in this document is advertised by the "http://jabber.org/protocol/pubsub#since" Service Discovery feature.</p>
  117. <p>The XMPP Registrar shall add this feature to its registry at &DISCOFEATURES;. The registration is as follows.</p>
  118. <code caption='Registry Submission'><![CDATA[
  119. <var>
  120. <name>http://jabber.org/protocol/pubsub#since</name>
  121. <desc>
  122. The pubsub or PEP service sends interim notifications upon receiving
  123. initial presence containing the subscriber's last logout time.
  124. </desc>
  125. <doc>XEP-0312</doc>
  126. </var>
  127. ]]></code>
  128. </section2>
  129. </section1>
  130. <section1 topic='XML Schema' anchor='schema'>
  131. <code><![CDATA[
  132. <?xml version='1.0' encoding='UTF-8'?>
  133. <xs:schema
  134. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  135. targetNamespace='urn:xmpp:ago:0'
  136. xmlns='urn:xmpp:ago:0'
  137. elementFormDefault='qualified'>
  138. <xs:element name='ago'>
  139. <xs:complexType>
  140. <xs:simpleContent>
  141. <xs:extension base='empty'>
  142. <xs:attribute name='secs' type='xs:unsignedLong' use='required'/>
  143. </xs:extension>
  144. </xs:simpleContent>
  145. </xs:complexType>
  146. </xs:element>
  147. <xs:simpleType name='empty'>
  148. <xs:restriction base='xs:string'>
  149. <xs:enumeration value=''/>
  150. </xs:restriction>
  151. </xs:simpleType>
  152. </xs:schema>
  153. ]]></code>
  154. </section1>
  155. </xep>