Initial published version.
Added ofrom header to notifications.
First draft.
To enable lightweight repeaters for &xep0060; notifications, we need the ability to subscribe one pubsub node to another pubsub node. This specification defines a method for doing so, using &xep0050;.
+The owner of a pubsub node can subscribe that "local" node to a "remote" node using the flow described below. In these examples, the node owner is admin@consumer.tld, the local node is weatherbot@consumer.tld/Chicagoland, and the remote node has a NodeID of "OHR" at the pubsub service notify.weather.tld.
+Unless an error occurs, the service SHOULD return the appropriate form.
+When a chained pubsub node delivers notifications to its subscribers, it SHOULD include an &xep0033; header of "ofrom" (note: this header is not yet defined in XEP-0033).
+If a pubsub service supports Ad-Hoc Commands, it MUST advertise the commands it supports via &xep0030; (as described in XEP-0050: Ad-Hoc Commands); such commands exist as well-defined discovery nodes associated with the service. In particular, if a pubsub service supports chaining it MUST advertise a command of "http://jabber.org/protocol/pubsub#chaining".
+The ability to subscribe one node to another node introduces the possibility of exposing non-public information in a public way, since the access controls for the node that originates a notification might not be known or enforced by the downstream node. Therefore, the upstream node (or its owner) is advised to make a careful access decision before allowing a downstream node (or any other entity) to subscribe.
+Note: The upstream node can discover the identity of the downstream node by sending a service discovery information ("disco#info") request to the downstream node, and MAY cancel or decline the downstream node's subscription if it determines that the node has an identity of "pubsub/leaf" or "pubsub/collection".
+This document requires no interaction with &IANA;.
+The ®ISTRAR; shall include the following information in its registries.
+The XMPP Registrar shall include 'http://jabber.org/protocol/pubsub#chaining' in its registry of protocol namespaces (see &NAMESPACES;).
+&xep0068; defines a process for standardizing the fields used within &xep0004; scoped by a particular namespace (see &FORMTYPES;). The reserved fields for the 'http://jabber.org/protocol/pubsub#chaining' namespace are specified below.
+
+ http://jabber.org/protocol/pubsub#chaining
+ XEP-xxxx
+ Forms used for chaining of pubsub nodes.
+
+
+
+
+ ]]>
+ Thanks to Joe Hildebrand for his feedback.
+Initial published version.
Added more detailed error flows; added additional implementation notes.
First draft.
The &xep0060; extension to XMPP provides a comprehensive technology for alerts, notifications, data syndication, rich presence, and other real-time messaging use cases. In terms of traditional publish-subscribe systems like Java Message Service (JMS), the core XMPP PubSub specification covers the Observer design pattern only; however, traditional publish-subscribe systems often include support for a second design pattern, usually called the "point-to-point" or "queueing" pattern.
If a node has enabled support for the queueing mode, in response to a subscription request without configuration options it MUST return an IQ-error containing a subscription options form; this form MUST include the "queue_requests" field (which specifies the number of parallel requests a subscriber is willing to process).
+The subscriber would then send a new subscription request, this time with options.
+If the subscription request can be processed successfully, the service returns an IQ-result and includes the configuration options established during the negotiation.
+At any time, a publisher can push an item to the queue node.
+The item is published to one of the subscribers.
+When the subscriber that received the item has successfully processed it (whatever that means in the context of the queue), the subscriber deletes the item from the queue.
+In the context of a queue node, the service MUST treat a delete request from a subscriber that received the item as if the sender were a publisher; i.e., it MUST delete the item from the queue and notify only this subscriber that the item has been deleted.
+Note: The subscriber SHOULD NOT commit any pending transactions until it receives the delete notification.
+If the item does not exist, the service MUST return an ¬found; error as described in XEP-0060.
+If the entity that attempts to delete the item is not the subscriber that received the item, the service MUST return a &forbidden; error as described in XEP-0060.
+If the item is locked by another subscriber, the service MUST return a &conflict; error (this flow is not defined in XEP-0060.
+If the subscriber that received the item attempts to delete the item but the item is no longer locked by the subscriber (e.g., because of a race condition or a lost notification), the service MUST return an &unexpected; error (this flow is not defined in XEP-0060.
+The subscriber might determine that it cannot process the item (whatever that means in the context of the queue); if so, the subscriber unlocks the item.
+The service then MUST unlock the item and notify only this subscriber that the item has been unlocked.
+When an item is unlocked, the service would then send a publish notification to another subscriber according to application-specific logic for determining the "next" subscriber.
+If the item does not exist, the service MUST return an ¬found; error.
+If the entity that attempts to unlock the item is not the subscriber that received the item, the service MUST return a &forbidden; error.
+If the item is locked by another subscriber, the service MUST return a &conflict; error.
+If the subscriber that received the item attempts to unlock the item but the item is no longer locked by the subscriber (e.g., because of a race condition or a lost notification), the service MUST return an &unexpected; error.
+If a pubsub service supports the queueing mode, it MUST advertise support for the "urn:xmpp:pubsub:queueing:0" namespace in response to &xep0030; information requests.
+If the service receives unavailable presence from a subscriber, it SHOULD unlock all outstanding queue items associated with the subscriber and unsubscribe the subscriber to prevent delivery of further publish notifications.
+If a subscriber cannot process queue items because of an unrecoverable error (e.g., disk full), the subscriber SHOULD unsubscribe and then unlock all of its outstanding queue items.
+If the service does not receive a delete or unlock request from a subscriber that received a queue item in a configurable amount of time, it SHOULD timeout the request, send an unlock notification to the subscriber, and send a publish notification to the "next" subscriber.
+To follow.
+This document requires no interaction with &IANA;.
+This specification defines the following XML namespace:
+Upon advancement of this specification from a status of Experimental to a status of Draft, the ®ISTRAR; shall add the foregoing namespaces to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.
+If the protocol defined in this specification undergoes a major revision that is not fully backward-compatible with an older version, or that contains significant new features, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of XEP-0053.
+The ®ISTRAR; maintains a registry of service discovery features (see &DISCOFEATURES;), which includes a number of features that can be returned by pubsub services. The following registry submission supplements the existing list.
+
+ urn:xmpp:pubsub:queueing:0
+ The node or service supports the queueing mode.
+ XEP-xxxx
+
+ ]]>
+ Initial published version.
Removed <error/> child of geoloc element (arc minutes).
Added <accuracy/> (meters).
Updated notes on GPS data submitted in location query.
replaced language encoding 'en-UK' with 'en-US' to avoid UK/GB confusion
Corrected XML namespace; added country code reference.
First draft.
This document defines a format for querying a location server for information about an entity's geographical location. The query must contain some location characteristics that the server can process to derive this information. These can be in the form of geodetic coordinates (from GPS receivers or other positioning equipment), in which case the server will perform "reversed geocoding" to derive the information. Alternatively, the location can be characterized by a list of identifiable radio transmitters (from here on called 'beacons') observable from this location. Typical beacons include cellular telephone towers, wireless network access points and bluetooth devices. In this case the location server must match the supplied characteristics with stored knowledge about the beacons to derive the submitting entity's location. Client implementers are encouraged to supply both kinds of characteristics when available, as this can be utilized by self-learning location servers. The location information returned by the location server is structured according to &xep0080;, ensuring compatibility with systems using this standard for location information publishing.
+The location query is designed to be used as a one-shot request or as a continuous query-result dialogue. The latter form will allow location servers to analyze changes with time, which in most cases yields improved fidelity and the possibility to derive motion state information.
+The format defined herein was designed to address the following requirements:
+The basic principle behind this XMPP extension is as follows: An XMPP clients collects characteristics about its current location that is not directly suitable for presentation to a human user, but from which human readable location information can be derived. The client sends this information to a location server that derives this information and returns it to the querying client. Here "location server" means a XMPP server application that supports the locationquery stanza defined in this document. It can either be an integral part of the XMPP server, or run as a component on the same or a different machine from the XMPP server itself.
+ +Information about the radio beacons in the entity's surrounding, and its geodetic coordinates are provided by the entity and propagated on the network by the entity's associated application (usually a client). The information is structured by means of a <locationquery/> element that is qualified by the 'urn:xmpp:locationquery:0' namespace and nested with in a <iq> element with type set to get. The location result is provided by the location server and returned to the client in a <iq> element with type set to result. The location result is structured by means of a <geoloc/> element that is qualified by the 'http://jabber.org/protocol/geoloc' namespace (see XEP-0080).
+ +Element Name | +Datatype | +Definition | +Example | +Notes | +
---|---|---|---|---|
timestamp | +xs:datetime | +UTC timestamp specifying the moment when the reading was taken (MUST conform to the DateTime profile of &xep0082;. | +2004-02-19T21:12Z | +This is the only field that is required without exception. | +
publish | +xs:boolean | +A flag specifying whether or not the server should publish the location result to subscribers of the submitting user's XEP-0080 compatible geoloc pub-sub node instead of returning it directly to the submitting user. | +true | +Optional. If present and "true", the server shall publish the entity's location details whenever it changes (suitable for periodic queries) and respond to the query with an empty <iq> stanza with type set to "result". If not specified or "false" the server shall return the location results to the submitting user in the form of a geoloc stanza (XEP-0080) embedded in a <iq> with type set to "result". Default is "false" | +
lat | +xs:decimal | +Latitude in decimal degrees + North. | +39.75 | +Required if no radio beacon data present, otherwise optional. If present, this shall also be present in the result stanza. If not present, the location server SHOULD estimate a value based on submitted beacon data and return with result stanza. The location server is free to decide if the value of this field should be piped directly through to result, or if it should be modified based on beacon data or time history information. For instance: if the entity is indoors, the GPS signal will be inaccurate and unstable over time. If wifi beacons are submitted, the location server may decide that the entity is inside a known building, and return the latitude of this instead. | +
lon | +xs:decimal | +Longitude in decimal degrees + East | +-104.99 | +See notes for lat | +
alt | +xs:decimal | +Altitude in meters above or + below sea level | +1609 | +Optional. If present, this shall also be present in the result stanza with identical value. | +
bearing | +xs:decimal | +GPS bearing (direction in which + the entity is heading to reach its next waypoint), measured in + decimal degrees relative to true north | ++ | See notes for alt | +
datum | +xs:string | +GPS datum (See XEP-0080) | ++ | See notes for alt | +
accuracy | +xs:decimal | +Horizontal GPS accuracy in meters | +10 | +See notes for lat | +
speed | +xs:decimal | +The speed at which the entity is + moving, in meters per second | +52.69 | +See notes for alt | +
beacons | +locationquery:beacon | +A list of identifiable radio transmitters observed by the entity | ++ | Required if no lat and lon values specified, otherwise optional. See Table 2 for type definition. | +
Element Name | +Datatype | +Definition | +Example | +Notes | +
---|---|---|---|---|
id | +xs:string | +A world-wide unique beacon identifier. This SHALL be composed as follows: For cell towers: "MCC:MNC:LAC:CID" where MCC is the mobile country code For wireless access points and bluetooth devices: The device MAC address. |
+ 207:02:12643:78596 | +Required | +
type | +xs:string | +Beacon type. One of "cell", "wifi", "bluetooth", "wimax", "rfid" (?), "other" | +"cell" | +Required. | +
Element Name | +Datatype | +Definition | +Example | +Notes | +
---|---|---|---|---|
alt | +xs:decimal | +Altitude in meters above or + below sea level | +1609 | +Piped directly through from query alt field if set. | +
area | +xs:string | +A named area such as a campus or + neighborhood | +Central Park | ++ |
bearing | +xs:decimal | +GPS bearing (direction in which + the entity is heading to reach its next waypoint), measured in + decimal degrees relative to true north | ++ | Piped directly through from query bearing field if set. | +
building | +xs:string | +A specific building on a street + or in an area | +The Empire State Building | ++ |
country | +xs:string | +The nation where the user is + located | +USA | ++ |
datum | +xs:string | +GPS datum (See notes for XEP-0080) | ++ | Piped directly through from query datum field if set. | +
description | +xs:string | +A natural-language name for or + description of the location | +Bill's house | +If location is mapped to a place in a place oriented service, this should hold the place description. | +
accuracy | +xs:decimal | +Horizontal GPS accuracy in meters | +10 | +Piped directly through from query accuracy field or estimated by location server using based on the other information in query and, if possible, differences between several queries over time. | +
floor | +xs:string | +A particular floor in a building | +102 | ++ |
lat | +xs:decimal | +Latitude in decimal degrees + North | +39.75 | +Piped directly through from query lat field or estimated by location server based on the other information in query and, if possible, differences between several queries over time. | +
locality | +xs:string | +A locality within the + administrative region, such as a town or city | +New York City | ++ |
lon | +xs:decimal | +Longitude in decimal degrees + East | +-104.99 | +Piped directly through from query lon or estimated by location server based on the other information in query and, if possible, differences between several queries over time. | +
postalcode | +xs:string | +A code used for postal delivery | +10027 | ++ |
region | +xs:string | +An administrative region of the + nation, such as a state or province | +New York | ++ |
room | +xs:string | +A particular room in a building | +Observatory | ++ |
speed | +The speed at which the entity is + moving, in meters per second | +52.69 | +xs:decimal | +Piped directly through from query speed field or estimated by location server based on the other information in query and, if possible, differences between several queries over time. | +
street | +xs:string | +A thoroughfare within the + locality, or a crossing of two thoroughfares | +34th and Broadway | ++ |
text | +xs:string | +A catch-all element that + captures any other information about the location | +Northwest corner of the lobby | +Best practice tip: This field can be used by the server to combine several fields in a natural language style, suitable for simple one-line location presence text. Example: "Near Bob's place" (description + accuracy), "On the road in New York" (locality + speed) | +
timestamp | +xs:datetime | +UTC timestamp specifying the moment when the reading was taken (MUST conform to the DateTime profile of XEP-0082) | +2004-02-19T21:12Z | +Piped directly through from query timestamp field. | +
uri | +A URI or URL pointing to + information about the location | +http://beta.plazes.com/plazes/1940:jabber_inc | +xs:anyURI | +Only applicable to place-oriented services | +
NOTE: The datatypes specified above are defined in &w3xmlschema2;.
+ +The location results SHOULD be distributed means of &xep0060; or the subset thereof specified in &xep0163;. This can be done automatically by requesting the "publish" location query result format, in which case the location server will publish the results on the user's behalf. Alternatively the it can be done client side as outlined in XEP-0080.
+The does not have to determine a value for all fields of the <geoloc> stanza, but it SHOULD determine values for as many as possible. At the very least a value for 'country' should be set.
+If no GPS coordinate and accuracy information is submitted in the query, and the server determines location coordinates from submitted beacon data, a value for the returned geoloc 'accuracy' field SHOULD be returned. The magnitude of this should be derived based on the ranges of the beacons used to determine the location.
+The server should make no assumptions about how often a entity submits a query. It should support occasional manually triggered queries as well as periodic automated queries. In the latter case it should analyze changes over time, as this can greatly increase the fidelity of the result.
+Furthermore, no assumptions should be made about the number of beacons being logged in each query. Some handset manufacturers limit the access programmers have to cell tower and access point information. Some may only offer the currently connected cell ID, such that even if the handset can "see" many cell towers, only the one to which the handset is connected at the moment can be read. In this case the cell tower readings may not be constant, even if the querying entity is not moving. Rather it may jump round-robin style to each visible cell with variable time spent on each. The location server should account for this to avoid yielding results indicating that a user is running around in cell-sized circles when he is in fact stationary. Again, analysis of variation of submitted queries over time is recommended.
+As no guarantees can be made that a given radio beacon stays at one fixed physical location throughout it's lifetime, the server should implement means to detect this. Generally it can be assumed that cell towers seldom move (could happen when a network operator changes the way it allocates cell IDs or when a tower is physically moved to a different location). Wireless access points move a bit more frequently (for instance when their owners move, or if they are installed in moving vehicles such as busses or trains). Bluetooth devices can generally be assumed to be mobile and should, unless specific knowledge to the contrary exists, not be used to locate an entity to a specific physical location. Rather, bluetooth devices (and other mobile beacons) can be used to co-locate entities to other entities for which a physical location is known. An example: Entity A submits query with GPS coordinates and the ID of some bluetooth device. It is located based on its submitted coordinates. Entity B submits a query with the same bluetooth device ID, but no GPS coordinates. Given this, and the fact that bluetooth transmitters have a very limited range, the server can then derive that A and B are at the same physical location (it may add 10-20 m to the accuracy of the location of B to account for the bluetooth range).
+The "radio landscape" is by no means constant. New beacons are added continuously, and old ones are phased out. A location server will have to adapt to this shifting landscape, either by means of operator-supplied databases (in case of cell towers) or by means of user generated information. This standard was written with the latter in mind, and it is recommended that location servers utilize any queries with combined GPS and radio beacon information to "learn" the approximate physical location of the provided beacons. For server implementation that rely on user generated information only, it is also recommended to supply additional means for the users to feed back location context in cases where the client does not have any GPS access, or when the server produces the wrong results. One way to do this would be to let the users define "placemarks" (a name, street, city etc) that can be associated with the beacons seen by this user at the time of definition. This is however beyond the scope of this XEP.
+For the reasons mentioned above, it is recommended that the client supply both GPS coordinates as well as nearby radio beacon information when possible. Also it is recommended that the client submit queries frequently enough to allow the server to analyze changes over time (or lack thereof) to obtain a better result. When possible, the client should include wifi access points in the queries, as these yield much more precise results than cell towers alone (due to the much more limited range). This must however all be weighted against the increased power consumption resulting from keeping network sockets open, scanning for access points and driving a GPS receiver.
For optimal results, clients SHOULD post a location query any time when the set of observed beacons change (a new beacon is seen or an old one is not seen any more)
Because the character data contained in the location results is intended to be readable by humans, the location query SHOULD possess an 'xml:lang' attribute specifying the natural language of such character data &rfc4646;. If so, the server SHOULD equip the <geoloc/> element, of the result stanza with an identical attribute
+ +It is imperative to control access to location information, at least by default. Imagine that a stalker got unauthorized access to this information, with enough accuracy and timeliness to be able to find the target person. This scenario could lead to loss of life, so please take access control checks seriously. If an error is deliberately added to a location, the error SHOULD be the same for all receivers, to minimize the likelihood of triangulation. In the case of deliberate error, the <accuracy/> element SHOULD NOT be included.
+ +This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [7].
+ +This specification defines the following XML namespace:
+Upon advancement of this specification from a status of Experimental to a status of Draft, the ®ISTRAR; shall add the foregoing namespaces to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.
+If the protocol defined in this specification undergoes a major revision that is not fully backward-compatible with an older version, or that contains significant new features, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of XEP-0053.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]]>
+ Schema for the location results are given by XEP-0080.
+ +