原创作品,允许转载,转载时请务必以超链接形式标明文章
原始出处
、作者信息和本声明。否则将追究法律责任。
http://blog.csdn.net/love254443233/article/details/7821126
优先权
可选的(OPTIONAL)<priority/>元素包含非人类可读的XML字符数据指明资源的优先级别.
这个值必须(MUST)是一个介于-128和+127之间的数字.
一个出席信息小节不能(MUST NOT)包含超过一个的<priority/>元素.
<priority/>元素不能(MUST NOT)拥有任何属性.
如果没有优先权被提供,一个服务器应该(SHOULD)认为优先级是零.
关于即时消息和出席信息系统中节路由的优先级的语义, 参考 处理XML节的服务器规则Server Rules for Handling XML Stanzas(第十一章).
地址:http://rfc-ref.org/RFC-TEXTS/3920/chapter10.html
10. Server Rules for HandlingXML Stanzas
Compliant server implementations MUST ensure in-order processing of
XML stanzas between any two entities.
Beyond the requirement for in-order processing, each server
implementation will contain its own "delivery tree" for handling
stanzas it receives. Such a tree determines whether a stanza needs
to be routed to another domain, processed internally, or delivered to
a resource associated with a connected node. The following rules
apply:
10.1. No 'to'Address
If the stanza possesses no 'to' attribute, the server SHOULD process
it on behalf of the entity that sent it. Because all stanzas
received from other servers MUST possess a 'to' attribute, this rule
applies only to stanzas received from a registered entity (such as a
client) that is connected to the server. If the server receives a
presence stanza with no 'to' attribute, the server SHOULD broadcast
it to the entities that are subscribed to the sending entity's
presence, if applicable (the semantics of presence broadcast for
instant messaging and presence applications are defined in
[XMPP-IM]). If the server receives an IQ stanza of type "get" or
"set" with no 'to' attribute and it understands the namespace that
qualifies the content of the stanza, it MUST either process the
stanza on behalf of the sending entity (where the meaning of
"process" is determined by the semantics of the qualifying namespace)
or return an error to the sending entity.
10.2. ForeignDomain
If the hostname of the domain identifier portion of the JID contained
in the 'to' attribute does not match one of the configured hostnames
of the server itself or a subdomain thereof, the server SHOULD route
the stanza to the foreign domain (subject to local service
provisioning and security policies regarding inter-domain
communication). There are two possible cases:
A server-to-server stream already exists between the two domains: The
sender's server routes the stanza to the authoritative server for
the foreign domain over the existing stream
There exists no server-to-server stream between the two domains: The
sender's server (1) resolves the hostname of the foreign domain
(as defined under Server-to-Server Communications (Section 14.4)),
(2) negotiates a server-to-server stream between the two domains
(as defined under Use of TLS (Section 5) and Use of SASL (Section
6)), and (3) routes the stanza to the authoritative server for the
foreign domain over the newly-established stream
If routing to the recipient's server is unsuccessful, the sender's
server MUST return an error to the sender; if the recipient's server
can be contacted but delivery by the recipient's server to the
recipient is unsuccessful, the recipient's server MUST return an
error to the sender by way of the sender's server.
10.3. Subdomain
If the hostname of the domain identifier portion of the JID contained
in the 'to' attribute matches a subdomain of one of the configured
hostnames of the server itself, the server MUST either process the
stanza itself or route the stanza to a specialized service that is
responsible for that subdomain (if the subdomain is configured), or
return an error to the sender (if the subdomain is not configured).
10.4. MereDomainor Specific Resource
If the hostname of the domain identifier portion of the JID contained
in the 'to' attribute matches a configured hostname of the server
itself and the JID contained in the 'to' attribute is of the form
<domain> or <domain/resource>, the server (or a defined resource
thereof) MUST either process the stanza as appropriate for the stanza
kind or return an error stanza to the sender.
10.5.Nodein SameDomain
If the hostname of the domain identifier portion of the JID contained
in the 'to' attribute matches a configured hostname of the server
itself and the JID contained in the 'to' attribute is of the form
<node@domain> or <node@domain/resource>, the server SHOULD deliver
the stanza to the intended recipient of the stanza as represented by
the JID contained in the 'to' attribute. The following rules apply:
1. If the JID contains a resource identifier (i.e., is of the form
<node@domain/resource>) and there exists a connected resource
that matches the full JID, the recipient's server SHOULD deliver
the stanza to the stream or session that exactly matches the
resource identifier.
2. If the JID contains a resource identifier and there exists no
connected resource that matches the full JID, the recipient's
server SHOULD return a <service-unavailable/> stanza error to the
sender.
3. If the JID is of the form <node@domain> and there exists at least
one connected resource for the node, the recipient's server
SHOULD deliver the stanza to at least one of the connected
resources, according to application-specific rules (a set of
delivery rules for instant messaging and presence applications is
defined in [XMPP-IM]).