Movatterモバイル変換
[0]ホーム
3.2.1.2.1. Subject The element contains human-readable XML character data that specifies the topic of the message. The element MUST NOT possess any attributes, with the exception of the 'xml:lang' attribute. Multiple instances of the element MAY be included for the purpose of providing alternate versions of the sameSaint-Andre Standards Track [Page 5]RFC 3921 XMPP IM October 2004 subject, but only if each instance possesses an 'xml:lang' attribute with a distinct language value. The element MUST NOT contain mixed content (as defined in Section 3.2.2 of [XML]).2.1.2.2. Body The element contains human-readable XML character data that specifies the textual contents of the message; this child element is normally included but is OPTIONAL. The element MUST NOT possess any attributes, with the exception of the 'xml:lang' attribute. Multiple instances of the element MAY be included but only if each instance possesses an 'xml:lang' attribute with a distinct language value. The element MUST NOT contain mixed content (as defined in Section 3.2.2 of [XML]).2.1.2.3. Thread The element contains non-human-readable XML character data specifying an identifier that is used for tracking a conversation thread (sometimes referred to as an "instant messaging session") between two entities. The value of the element is generated by the sender and SHOULD be copied back in any replies. If used, it MUST be unique to that conversation thread within the stream and MUST be consistent throughout that conversation (a client that receives a message from the same full JID but with a different thread ID MUST assume that the message in question exists outside the context of the existing conversation thread). The use of the element is OPTIONAL and is not used to identify individual messages, only conversations. A message stanza MUST NOT contain more than one element. The element MUST NOT possess any attributes. The value of the element MUST be treated as opaque by entities; no semantic meaning may be derived from it, and only exact comparisons may be made against it. The element MUST NOT contain mixed content (as defined in Section 3.2.2 of [XML]).2.2. Presence Syntax Presence stanzas are used qualified by the 'jabber:client' or 'jabber:server' namespace to express an entity's current network availability (offline or online, along with various sub-states of the latter and optional user-defined descriptive text), and to notify other entities of that availability. Presence stanzas are also used to negotiate and manage subscriptions to the presence of other entities.Saint-Andre Standards Track [Page 6]RFC 3921 XMPP IM October 20042.2.1. Types of Presence The 'type' attribute of a presence stanza is OPTIONAL. A presence stanza that does not possess a 'type' attribute is used to signal to the server that the sender is online and available for communication. If included, the 'type' attribute specifies a lack of availability, a request to manage a subscription to another entity's presence, a request for another entity's current presence, or an error related to a previously-sent presence stanza. If included, the 'type' attribute MUST have one of the following values: o unavailable -- Signals that the entity is no longer available for communication. o subscribe -- The sender wishes to subscribe to the recipient's presence. o subscribed -- The sender has allowed the recipient to receive their presence. o unsubscribe -- The sender is unsubscribing from another entity's presence. o unsubscribed -- The subscription request has been denied or a previously-granted subscription has been cancelled. o probe -- A request for an entity's current presence; SHOULD be generated only by a server on behalf of a user. o error -- An error has occurred regarding processing or delivery of a previously-sent presence stanza. For detailed information regarding presence semantics and the subscription model used in the context of XMPP-based instant messaging and presence applications, refer to Exchanging Presence Information (Section 5) and Managing Subscriptions (Section 6).2.2.2. Child Elements As described under extended namespaces (Section 2.4), a presence stanza MAY contain any properly-namespaced child element. In accordance with the default namespace declaration, by default a presence stanza is qualified by the 'jabber:client' or 'jabber:server' namespace, which defines certain allowable children of presence stanzas. If the presence stanza is of type "error", it MUST include an child; for details, see [XMPP-CORE]. If the presence stanza possesses no 'type' attribute, it MAY contain any ofSaint-Andre Standards Track [Page 7]RFC 3921 XMPP IM October 2004 the following child elements (note that the child MAY be sent in a presence stanza of type "unavailable" or, for historical reasons, "subscribe"): 1. 2. 3.2.2.2.1. Show The OPTIONAL element contains non-human-readable XML character data that specifies the particular availability status of an entity or specific resource. A presence stanza MUST NOT contain more than one element. The element MUST NOT possess any attributes. If provided, the XML character data value MUST be one of the following (additional availability types could be defined through a properly-namespaced child element of the presence stanza): o away -- The entity or resource is temporarily away. o chat -- The entity or resource is actively interested in chatting. o dnd -- The entity or resource is busy (dnd = "Do Not Disturb"). o xa -- The entity or resource is away for an extended period (xa = "eXtended Away"). If no element is provided, the entity is assumed to be online and available.2.2.2.2. Status The OPTIONAL element contains XML character data specifying a natural-language description of availability status. It is normally used in conjunction with the show element to provide a detailed description of an availability state (e.g., "In a meeting"). The element MUST NOT possess any attributes, with the exception of the 'xml:lang' attribute. Multiple instances of the element MAY be included but only if each instance possesses an 'xml:lang' attribute with a distinct language value.2.2.2.3. Priority The OPTIONAL element contains non-human-readable XML character data that specifies the priority level of the resource. The value MUST be an integer between -128 and +127. A presence stanza MUST NOT contain more than one element. The element MUST NOT possess any attributes. If no priority is provided,Saint-Andre Standards Track [Page 8]RFC 3921 XMPP IM October 2004 a server SHOULD consider the priority to be zero. For information regarding the semantics of priority values in stanza routing within instant messaging and presence applications, refer to Server Rules for Handling XML Stanzas (Section 11).2.3. IQ Syntax IQ stanzas provide a structured request-response mechanism. The basic semantics of that mechanism (e.g., that the 'id' attribute is REQUIRED) are defined in [XMPP-CORE], whereas the specific semantics required to complete particular use cases are defined in all cases by an extended namespace (Section 2.4) (note that the 'jabber:client' and 'jabber:server' namespaces do not define any children of IQ stanzas other than the common). This memo defines two such extended namespaces, one for Roster Management (Section 7) and the other for Blocking Communication (Section 10); however, an IQ stanza MAY contain structured information qualified by any extended namespace.2.4. Extended Namespaces While the three XML stanza kinds defined in the "jabber:client" or "jabber:server" namespace (along with their attributes and child elements) provide a basic level of functionality for messaging and presence, XMPP uses XML namespaces to extend the stanzas for the purpose of providing additional functionality. Thus a message or presence stanza MAY contain one or more optional child elements specifying content that extends the meaning of the message (e.g., an XHTML-formatted version of the message body), and an IQ stanza MAY contain one such child element. This child element MAY have any name and MUST possess an 'xmlns' namespace declaration (other than "jabber:client", "jabber:server", or "http://etherx.jabber.org/streams") that defines all data contained within the child element. Support for any given extended namespace is OPTIONAL on the part of any implementation (aside from the extended namespaces defined herein). If an entity does not understand such a namespace, the entity's expected behavior depends on whether the entity is (1) the recipient or (2) an entity that is routing the stanza to the recipient: Recipient: If a recipient receives a stanza that contains a child element it does not understand, it SHOULD ignore that specific XML data, i.e., it SHOULD not process it or present it to a user or associated application (if any). In particular:Saint-Andre Standards Track [Page 9]RFC 3921 XMPP IM October 2004 * If an entity receives a message or presence stanza that contains XML data qualified by a namespace it does not understand, the portion of the stanza that is in the unknown namespace SHOULD be ignored. * If an entity receives a message stanza whose only child element is qualified by a namespace it does not understand, it MUST ignore the entire stanza. * If an entity receives an IQ stanza of type "get" or "set" containing a child element qualified by a namespace it does not understand, the entity SHOULD return an IQ stanza of type "error" with an error condition of. Router: If a routing entity (usually a server) handles a stanza that contains a child element it does not understand, it SHOULD ignore the associated XML data by passing it on untouched to the recipient.3. Session Establishment Most instant messaging and presence applications based on XMPP are implemented via a client-server architecture that requires a client to establish a session on a server in order to engage in the expected instant messaging and presence activities. However, there are several pre-conditions that MUST be met before a client can establish an instant messaging and presence session. These are: 1. Stream Authentication -- a client MUST complete stream authentication as documented in [XMPP-CORE] before attempting to establish a session or send any XML stanzas. 2. Resource Binding -- after completing stream authentication, a client MUST bind a resource to the stream so that the client's address is of the form, after which the entity is now said to be a "connected resource" in the terminology of [XMPP-CORE]. If a server supports sessions, it MUST include a element qualified by the 'urn:ietf:params:xml:ns:xmpp-session' namespace in the stream features it advertises to a client after the completion of stream authentication as defined in [XMPP-CORE]:Saint-Andre Standards Track [Page 10]RFC 3921 XMPP IM October 2004 Server advertises session establishment feature to client: Upon being so informed that session establishment is required (and after completing resource binding), the client MUST establish a session if it desires to engage in instant messaging and presence functionality; it completes this step by sending to the server an IQ stanza of type "set" containing an empty child element qualified by the 'urn:ietf:params:xml:ns:xmpp-session' namespace: Step 1: Client requests session with server: Step 2: Server informs client that session has been created: Upon establishing a session, a connected resource (in the terminology of [XMPP-CORE]) is said to be an "active resource". Several error conditions are possible. For example, the server may encounter an internal condition that prevents it from creating the session, the username or authorization identity may lack permissions to create a session, or there may already be an active resource associated with a resource identifier of the same name. If the server encounters an internal condition that prevents it from creating the session, it MUST return an error.Saint-Andre Standards Track [Page 11]RFC 3921 XMPP IM October 2004 Step 2 (alt): Server responds with error (internal server error): If the username or resource is not allowed to create a session, the server MUST return an error (e.g., forbidden). Step 2 (alt): Server responds with error (username or resource not allowed to create session): If there is already an active resource of the same name, the server MUST either (1) terminate the active resource and allow the newly-requested session, or (2) disallow the newly-requested session and maintain the active resource. Which of these the server does is up to the implementation, although it is RECOMMENDED to implement case #1. In case #1, the server SHOULD send a stream error to the active resource, terminate the XML stream and underlying TCP connection for the active resource, and return a IQ stanza of type "result" (indicating success) to the newly-requested session. In case #2, the server SHOULD send a stanza error to the newly-requested session but maintain the XML stream for that connection so that the newly-requested session has an opportunity to negotiate a non-conflicting resource identifier before sending another request for session establishment. Step 2 (alt): Server informs existing active resource of resource conflict (case #1):Saint-Andre Standards Track [Page 12]RFC 3921 XMPP IM October 2004 Step 2 (alt): Server informs newly-requested session of resource conflict (case #2): After establishing a session, a client SHOULD send initial presence and request its roster as described below, although these actions are OPTIONAL. Note: Before allowing the creation of instant messaging and presence sessions, a server MAY require prior account provisioning. Possible methods for account provisioning include account creation by a server administrator as well as in-band account registration using the 'jabber:iq:register' namespace; the latter method is out of scope for this memo, but is documented in [JEP-0077], published by the Jabber Software Foundation [JSF].4. Exchanging Messages Exchanging messages is a basic use of XMPP and is brought about when a user generates a message stanza that is addressed to another entity. As defined under Server Rules for Handling XML Stanzas (Section 11), the sender's server is responsible for delivering the message to the intended recipient (if the recipient is on the same server) or for routing the message to the recipient's server (if the recipient is on a different server). For information regarding the syntax of message stanzas as well as their defined attributes and child elements, refer to Message Syntax (Section 2.1).4.1. Specifying an Intended Recipient An instant messaging client SHOULD specify an intended recipient for a message by providing the JID of an entity other than the sender in the 'to' attribute of the stanza. If the message is being sent in reply to a message previously received from an address of the form (e.g., within the context of a chat session), the value of the 'to' address SHOULD be of the form rather than of the form unless the sender has knowledge (via presence) that the intended recipient's resource is no longer available. If the message is being sentSaint-Andre Standards Track [Page 13]RFC 3921 XMPP IM October 2004 outside the context of any existing chat session or received message, the value of the 'to' address SHOULD be of the form rather than of the form.4.2. Specifying a Message Type As noted, it is RECOMMENDED for a message stanza to possess a 'type' attribute whose value captures the conversational context (if any) of the message (see Type (Section 2.1.1)). The following example shows a valid value of the 'type' attribute: Example: A message of a defined type: Wherefore art thou, Romeo?4.3. Specifying a Message Body A message stanza MAY (and often will) contain a child element whose XML character data specifies the primary meaning of the message (see Body (Section 2.1.2.2)). Example: A message with a body: Wherefore art thou, Romeo? PročeŽ jsi ty, Romeo?4.4. Specifying a Message Subject A message stanza MAY contain one or more child elements specifying the topic of the message (see Subject (Section 2.1.2.1)).Saint-Andre Standards Track [Page 14]RFC 3921 XMPP IM October 2004 Example: A message with a subject:I implore you!Úpěnlivě prosim! Wherefore art thou, Romeo? PročeŽ jsi ty, Romeo?4.5. Specifying a Conversation Thread A message stanza MAY contain a child element specifying the conversation thread in which the message is situated, for the purpose of tracking the conversation (see Thread (Section 2.1.2.3)). Example: A threaded conversation: Art thou not Romeo, and a Montague?e0ffe42b28561960c6b12b944a092794b9683a38 Neither, fair saint, if either thee dislike.e0ffe42b28561960c6b12b944a092794b9683a38 How cam'st thou hither, tell me, and wherefore?
[8]ページ先頭