git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@2487 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2008-11-05 17:38:55 +00:00
parent 0aed208c85
commit 7f44a6f941
1 changed files with 107 additions and 17 deletions

View File

@ -17,9 +17,16 @@
<dependencies/>
<supersedes/>
<supersededby/>
<shortname>N/A</shortname>
<shortname>profiles</shortname>
&infiniti;
&stpeter;
<registry/>
<revision>
<version>0.3</version>
<date>2008-11-05</date>
<initials>psa</initials>
<remark><p>For consistency, defined Metadata Profile; specified that the registrar shall create a registry for message stanza profiles.</p></remark>
</revision>
<revision>
<version>0.2</version>
<date>2008-10-01</date>
@ -102,8 +109,7 @@
<p>To clarify such matters, this document introduces the concept of "message stanza profiles". Each profile defines a set of elements that are allowed for use, and each message stanza must only be processed under the rules of a single profile. Therefore, at best, Juliet's client in the above example would process the message for just one of its many intended purposes. At worst, the message would be rejected by Juliet's client as invalid. Romeo's client should not be sending such a monstrosity.</p>
</section1>
<section1 topic='Elements' anchor='elements'>
<p>Elements used in a message stanza are either profile elements (for example, &lt;body&gt; or &lt;data xmlns='http://jabber.org/protocol/ibb'&gt;) or metadata elements (for example, &lt;error&gt; or &lt;amp xmlns='http://jabber.org/protocol/amp'&gt;). A message stanza SHOULD only contain profile elements that are part of the same profile. A message stanza MAY contain as many metadata elements as desired.</p>
<p>Metadata elements are included to define how the message stanza shall be routed, delivered, or processed in transit. Metadata elements shall not be used to determine which profile applies. If a message stanza includes only metadata elements, it can be considered to have no profile.</p>
<p>Elements used in a message stanza are either part of a standard profile (for example, &lt;body&gt; or &lt;data xmlns='http://jabber.org/protocol/ibb'&gt;) or the metadata profile (for example, &lt;error&gt; or &lt;amp xmlns='http://jabber.org/protocol/amp'&gt;). A message stanza SHOULD only contain profile elements that are part of the same profile. A message stanza MAY contain as many elements as necessary from the metadata profile.</p>
<p>A sender MAY mix elements of different profiles only for the purposes of fallback. For example, it may be useful to include a &lt;body&gt; element in a message that is not intended to be displayed as a text message, in case the recipient does not support the primary profile of the message.</p>
<example caption='Mixing profile elements'><![CDATA[
<message from='romeo@montague.lit' to='juliet@capulet.com' id='msg_1'>
@ -123,12 +129,12 @@
<p>We stipulate the following rules:</p>
<ol>
<li>A single profile applies to each message stanza (i.e., a message is not in two or more profiles).</li>
<li>Metadata elements do not affect the profile.</li>
<li>Each element is part of a defined profile.</li>
<li>Unknown elements have no affect on determining the profile.</li>
<li>Metadata elements have no effect on the profile-based handling of messages.</li>
<li>Unknown elements have no effect on determining the profile.</li>
<li>If a received message appears to conform to multiple profiles, the profile selected by the receiver is implementation-specific with one exception: the receiver MUST NOT select the IM profile unless that is the only profile it understands in the message.</li>
</ol>
<p>If a message stanza is received that combines multiple profiles, or the profile cannot be determined, the receiving client MAY return a stanza error, which SHOULD be &notacceptable;.</p>
<p>If a client receives a message stanza that combines multiple profiles, or the profile cannot be determined, the client MAY return a stanza error, which SHOULD be &notacceptable;.</p>
<example caption='Message not acceptable'><![CDATA[
<message from='juliet@capulet.com'
id='msg_1'
@ -139,9 +145,10 @@
</error>
</message>
]]></example>
<p>A client might determine that a message cannot be assigned to any profile (e.g., a message stanza that is empty or that contains only whitespace <note>A message stanza SHOULD NOT be empty or contain only whitespace, but some clients are known to generate such stanzas.</note>, or that contains only unknown elements).</p>
</section1>
<section1 topic='Profiles' anchor='profiles'>
<p>Profiles should be defined in whichever specifications define elements or processing behavior of message stanzas. However, a few profiles are defined here.</p>
<p>Profiles can be defined in whichever specifications define elements or processing behavior related to message stanzas. All such profiles SHOULD be registered in the Message Profiles Registry as described in the <link url='#registrar'>XMPP Registrar Considerations</link>. However, a few profiles are defined here, and this specification might be kept up to date as further registrations are created.</p>
<section2 topic='IM' anchor='profiles-im'>
<p>The instant messaging (IM) profile is the "default" profile for message stanzas. For example, if a message stanza includes only elements that are defined for the 'jabber:client' namespace then it is in the IM profile. If a message stanza includes both IM profile elements and other elements, the IM elements should be considered a fallback and the profile should be determined based on the other elements if supported (e.g., a data form). A sending entity should limit the elements it includes to IM profile elements, unless the IM elements are a fallback.</p>
<p>The extended content defined in the following specifications is considered to be in the IM profile:</p>
@ -173,16 +180,16 @@
<section2 topic='Stanza Session Negotiation' anchor='profiles-ssn'>
<p>Extended content elements defined in &xep0155; are considered to be in the Stanza Session Negotiation profile.</p>
</section2>
</section1>
<section1 topic='Metadata Elements' anchor='metadata'>
<p>Metadata elements should be defined in whichever specifications define elements or processing behavior of message stanzas. However, a few metadata elements are defined here.</p>
<p>The extended content elements defined in the following specifications are considered to be metadata elements:</p>
<ul>
<li>&xep0033;</li>
<li>&xep0079;</li>
<li>&xep0131;</li>
<li>&xep0203;</li>
</ul>
<section2 topic='Metadata' anchor='profiles-meta'>
<p>The metadata profile is handled differently than the other, "standard" profiles, but is defined as a profile for the purpose of consistency. Metadata elements are included to define how the message stanza shall be routed, delivered, or processed in transit or by the end recipient. Metadata elements shall not be used to determine which standard profile applies. If a message stanza includes only metadata elements, it can be considered to have no standard profile.</p>
<p>The extended content elements defined in the following specifications are considered to be metadata elements:</p>
<ul>
<li>&xep0033;</li>
<li>&xep0079;</li>
<li>&xep0131;</li>
<li>&xep0203;</li>
</ul>
</section2>
</section1>
<section1 topic='Implementation Notes' anchor='impl'>
<p>Since each message is unambiguously determined to be of a specific profile, implementations that use filtering to pass message stanzas to an appropriate handler (a very common XMPP implementation approach) need not be concerned with the filtering order. This is because only one handler should ever match on the filter expression.</p>
@ -195,5 +202,88 @@
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<p>A future version of this specification may call for the &REGISTRAR; to establish a registry of message stanza profiles, so that each relevant specification shall define which profile applies to extended content qualified by the relevant namespace.</p>
<section2 topic='Message Profiles Registry' anchor='registrar-profiles'>
<p>The XMPP Registrar shall maintain a registry of message profiles.</p>
<section3 topic='Process' anchor='registrar-profiles-process'>
&REGPROCESS;
<code><![CDATA[
<profile>
<name>the XML character data of the profile element</name>
<desc>a natural-language description of the message profile</desc>
<specs>
<spec>one "spec" element for each document that applies</spec>
</specs>
</profile>
]]></code>
</section3>
<section3 topic='Registration' anchor='registrar-methods-init'>
<code><![CDATA[
<profile>
<name>Data Forms</name>
<specs>
<spec>XEP-0004</spec>
</specs>
</profile>
<profile>
<name>Feature Negotiation</name>
<specs>
<spec>XEP-0020</spec>
</specs>
</profile>
<profile>
<name>HTTP Authentication</name>
<specs>
<spec>XEP-0070</spec>
</specs>
</profile>
<profile>
<name>IM</name>
<specs>
<spec>XMPP core</spec>
<spec>XEP-0045</spec>
<spec>XEP-0066</spec>
<spec>XEP-0071</spec>
<spec>XEP-0085</spec>
<spec>XEP-0144</spec>
<spec>XEP-0172</spec>
</specs>
</profile>
<profile>
<name>Metadata</name>
<specs>
<spec>XEP-0033</spec>
<spec>XEP-0079</spec>
<spec>XEP-0131</spec>
<spec>XEP-0203</spec>
</specs>
</profile>
<profile>
<name>RPC</name>
<specs>
<spec>XEP-0009</spec>
</specs>
</profile>
<profile>
<name>SOAP</name>
<specs>
<spec>XEP-0072</spec>
</specs>
</profile>
<profile>
<name>Stanza Session Negotiation</name>
<specs>
<spec>XEP-0155</spec>
</specs>
</profile>
]]></code>
</section3>
</section2>
</section1>
</xep>