%ents; ]>
Publish-Subscribe This document specifies an XMPP protocol extension for generic publish-subscribe functionality. &LEGALNOTICE; 0060 Draft Standards Track Standards XMPP Core XEP-0004 XEP-0030 XEP-0068 XEP-0082 XEP-0131 pubsub pubsub http://www.xmpp.org/schemas/pubsub.xsd pubsub#errors http://www.xmpp.org/schemas/pubsub-errors.xsd pubsub#event http://www.xmpp.org/schemas/pubsub-event.xsd pubsub#owner http://www.xmpp.org/schemas/pubsub-owner.xsd &pgmillard; &stpeter; &ralphm; 1.10pre7 in progress, last updated 2007-08-17 psa
  • In accordance with XMPP Council consensus, moved the auto-create, auto-subscribe, filtered-notifications, and last-published features from XEP-0163 to this specification
  • Clarified implications of auto-subscribe feature for handling of account owners, stable presence subscribers, and transient presence sharers
  • Updated filtered-notifications text and examples to track changes to XEP-0115
  • Added publish-options functionality
  • Added developer-friendly How It Works section
  • Split several long sections into smaller sub-sections.
  • Clarified that a pubsub service must generate an ItemID if the publisher does not provide one.
1.9 2006-09-13 psa
  • Replaced boolean send_item_subscribe node configuration option with more comprehensive send_last_published_item option per list discussion
  • Added deliver_notifications node configuration option to enable quiet nodes without notifications, if desired enabling pull-model item retrieval only.
  • Modified subscription and affiliation retrieval to return empty element if no results.
1.8 2006-06-27 psa
  • Defined five access models: open, presence, roster, authorize, and whitelist
  • Renamed pubsub#subscription_model feature to pubsub#access_model
  • Separated affiliations retrieval from subscriptions retrieval
  • Removed subscription information from affiliations management
  • Changed <entity/> element to <subscription/> element in response to subscription request
  • Clarified batch processing of item publication and item deletion
  • Added basic example to introduction
  • More fully specified node creation flows
  • More fully specified recommended behavior for caching last published item, including use of jabber:x:delay protocol
  • Specified that semantic meaning of NodeIDs must not be used to encapsulate hierarchy
  • More fully specified error conditions
  • Changed some feature-related conditions to <unsupported/> plus feature attribute
  • Changed some error conditions from <not-authorized/> to <forbidden/>
  • Harmonized error conditions for unsubscribe if entity is not subscribed (unexpected-request rather than not-found)
  • Further defined error conditions related to item publication
  • Specified structure of <affiliations/>, <delete/>, <purge/>, and <subscriptions/> elements qualified by pubsub#owner namespace
  • Changed retrieval of default configuration options to use <default/> element, not <configure/> element
  • Allowed caching of last published item
  • Added pubsub#deliver subscription option
  • Added meta-data fields for pubsub#owners and pubsub#contact
  • Changed element for retrieval of default node configuration options from <configure/> to <default/> to prevent ambiguity related to configuration of root collection node
  • Specified pubsub#node_type configuration field
  • Specified pubsub#collection SHIM header
  • Specified conformance with Resourceprep for nodes addressable as JIDs
  • Added pubsub#modify-affiliations feature
  • Added pubsub#digest_frequency field to subscribe_options FORM_TYPE
  • Added pubsub#roster_groups_allowed field to node_config FORM_TYPE
  • More clearly specified the requirements level (MUST, SHOULD, MAY) for each service discovery feature
  • Defined pubsub#include_body subscription option and the pubsub#body_xslt node configuration option to transform payload format into an XMPP message body, and clarified rules for inclusion of message bodies
  • Clarified nature of collections and association of a node to a collection
  • Specified that simultaneous subscriptions of type nodes and items are allowed to collection nodes
  • Added examples and further explanation of time-based and content-based subscriptions
  • Added Internationalization Considerations
  • Clarified terminology
  • Corrected and updated the schemas
1.7 2005-03-03 psa/rm
  • Reinstated pubsub#subscribe feature (deleted in error)
  • Added type attribute for the <create/> and <configure/> elements to differentiate between leaf nodes and collection nodes
  • In Section 8.1.7, changed affiliations retrieval support to SHOULD and added pubsub#retrieve-affiliations feature
  • In Section 8.1.10, removed two duplicate examples
  • In Section 8.1.12, clarified relationship between normal disco#info data and node meta-data (which uses a service discovery extension)
  • In Section 8.2.4, specified that node purgation MUST result in one event notification, not a notification per item
  • In Section 8.1.8, further specified handling of SubIDs
  • Clarified nature of the pubsub#type field
  • Mentioned that the forbidden error should be returned in response to certain operations requested by an outcast
  • Corrected datatype of max_items attribute from xs:string to xs:positiveInteger
  • Corrected <requesting-entity-not-subscribed/> error to <not-subscribed/> since the subscribed JID need not be that of the requesting entity
  • Added service discovery features for more optional use cases: retracting items, purging nodes, deleting nodes
  • Updated relevant registries
1.6 2004-07-13 pgm/psa

Added service discovery features for pubsub#meta-data, and pubsub#retrieve-items. Added pubsub#subscription_depth configuration option. Specified pubsub-specific error condition elements qualified by pubsub#errors namespace.

1.5 2004-07-07 pgm/psa

Fixed typos. Added more details to the section on collections. Added paragraph to create node use case to allow the service to change the requested node-id to something which it creates. Added text about bouncing publish requests when the request does not match the event-type for that node. Added disco features for the jabber registrar. Changed affiliation verbiage to allow publishers to remove any item. Tweaked verbiage for create node, eliminated extra example. Fully defined XMPP Registrar submissions. Corrected schemas.

1.4 2004-06-22 pgm

Added subid syntax in a variety of places. Added more information about disco#info and disco#items support. Added more info about subscription options. Added collection information. Added implementation notes about subscription leases, and content-based pubsub services.

1.3 2004-04-25 psa

Editorial review; added one implementation note.

1.2 2004-03-09 psa

Added XMPP error handling.

1.1 2004-01-14 psa

Added XMPP Registrar Considerations subsection for Service Discovery category/type registration.

1.0 2003-10-28 psa

Per a vote of the Jabber Council, advanced status to Draft.

0.16 2003-10-23 pgm

Clarified JID addressing usage for nodes. Added specific MAY requirement for disco usage. Added sentence about implementations verifying that an entity has a subscription before getting the current items.

0.15 2003-10-21 pgm

Fixed invalid XML in examples for subscription deny/allow.

0.14 2003-10-21 pgm

Clarified restrictions on addressing nodes by JID. Added section on Approving and Denying Subscription Requests. Changed get-pending to use Ad-Hoc Commands. Changed semantics when sending in a form type='cancel' for pending subscriptions.

0.13 2003-09-30 pgm

Removed item as a possible child of subscribe and unsubscribe and pubsub in the schemas. Removed retract as a possible child of item in the pubsub#event schema. Added verbiage to requirements for addressing nodes either via JIDs or disco nodes.

0.12 2003-08-13 pgm/psa

Defined public vs. private nodes; described how changes to existing nodes might trigger meta-node events (e.g., configuration changes); changed <x/> to <event/> for #events namespace; added meta-data about meta-nodes; fully defined XMPP Registrar considerations.

0.11 2003-06-25 pgm

Removed subscription notifications since they have inherent issues. Removed empty implementation note sub-section.

0.10 2003-06-11 pgm

Fixed error example when returning 501 from an items-get request. Added note about receiving subscription requests when an entity is already subscribed. Fixed some entity elements in various subscription examples. Many were missing the node attribute. Added subscription change notification verbiage and example. Added verbiage and example of subscription state notification being sent to the requesting entity. Added disco#items information for getting a list of item identifiers for a single node. Added verbiage for returning the current entity element when a curent subscriber attempts to subscribe again.

0.9 2003-04-30 pgm

Include JID attributes in the entity elements when receiving your affiliations. Changed error code 406 (which was wrong) to 404, which is correct. Changed many 405 errors to 401, and modified the error table to make it more implementable (rules are more concrete). Added subscribe-options element for indicating subscriptions may be configured.

0.8 2003-04-03 pgm

Clarified the affiliations table and the semantics around subscribing and unsubscribing. Added protocol to get all of your affiliations in the service. Added protocol for services informing subscribers that configurable subscription options are available. Added protocol for obtaining existing node configuration settings and for concatenating configuration and node creation requests into a single stanza. Added meta-node implementation notes and specified the interaction with the XMPP Registrar and the meta NodeIDs. Added authorization notes to subscription options.

0.7 2003-02-14 pgm

Clarified requirements around what affiliations must be supported. Moved requirements about specifying entities which can subscribe and publish out of the MUSTs to MAYs. Changed SHOULD to MAY when talking about allowing entities to create nodes. Added ability to send configuration requests in the same stanza as a creation request.

0.6 2003-02-06 pgm

Added more details and an example about publishing without NodeID. Added more implementation notes about NodeIDs and persistent storage.

0.5 2003-01-22 pgm

Fixed header for delete item example. Added examples showing subscribers being notified of deleted items. Added examples for notification of node deletion, and configuration for node deletion. Added Subscriber option semantics and examples. Added examples for 402 and 407 errors on subscribe and create respectively. Added clarification about ItemID handling to impl notes.

0.4 2003-01-21 pgm

Clarified in-band and out-of-band configuration requirement. Added Delete Item privilege for all affiliations to the table. Added Delete item protocol for publishers and owners. Added 401 error case for subscribing to an illegal jid. Changed subscription request form. Added defaults to configuration form, and clarified role of the XMPP Registrar for the features show. Added text explaining the max_items attribute. Changed "last items" to "most recent items". Removed default configuration acceptance -- owners should just cancel. Added the notify_retract configuration option. Clarified error handling for affiliation modifications.

0.3 2003-01-20 pgm

Added subscription attribute for entities. Removed subscriber from the affiliations table. Clarified configuration details. Clarified JabberID usages. Added XMPP Registrar Considerations. Added link to XEP-0068 about the FORM_TYPE element in subscription request notifications. Fixed some typos in examples. Added unsupported configuration namespace to example. Added a default configuration example.

0.2 2003-01-02 pgm

Added numerous implementation notes; added get-pending action with regard to subscriptions; added error table; changed purge and delete to use IQ type='set'.

0.1 2002-11-19 pgm

Initial version.

As Jabber/XMPP technologies have matured, the need for a generic publish-subscribe ("pubsub") mechanism has arisen in a number of domains. These include (but are not limited to): news feeds and content syndication, extended presence, avatar management, shared bookmarks, auction and trading systems, online catalogs, workflow systems, network management systems, NNTP gateways, profile management, and event notification.

In all of these domains, it is desirable for data communication to follow the classic "publish-subscribe" or "observer" design pattern: a person or application publishes information, and an event notification (without or without payload) is broadcasted to all authorized subscribers. In general, the relationship between the publisher and subscriber is mediated by a service that receives publication requests, broadcasts event notifications to subscribers, and enables privileged entities to manage lists of people or applications that are authorized to publish or subscribe. In most pubsub services, the focal point for publication and subscription is a "topic" or "node" to which publishers send data and from which subscribers receive notifications. Additionally, some nodes may also maintain a history of events and provide other services that supplement the pure pubsub model.

This document defines a single, cohesive, generic protocol that all forms of pubsub can use. While compliant implementations are not required to implement all of the features defined herein, this document addresses most use cases that may be requested of a pubsub service. (For information about which features are required and which are recommended or optional, consult the Feature Summary.) Other specifications may define "subsets" or "profiles" of publish-subscribe for use in specialized contexts (e.g., &xep0163;), but such profiles are out of scope for this document.

This specification is large. However, the basic idea behind pubsub is rather simple (see Publish an Item to a Node):

  1. An entity publishes information to a node at a publish-subscribe service.
  2. The pubsub service pushes a notification to all entities that are authorized to learn about the published information.

Perhaps the most popular application of pubsub-like functionality is content syndication, which has become familiar from the RSS and Atom (&rfc4287;) feeds associated with weblogs, news sites, and other frequently-updated information available on the Internet. Consider the example of a weblog published by <hamlet@denmark.lit>. When Hamlet writes a new weblog entry, his blogging software publishes the entry to a pubsub node hosted at <pubsub.shakespeare.lit>:

Soliloquy To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? tag:denmark.lit,2003:entry-32397 2003-12-13T18:30:02Z 2003-12-13T18:30:02Z ]]>

So that is the "pub" part of publish-subscribe.

Now the pubsub service notifies all the subscribers about the new blog entry:

[ ... ENTRY ... ] [ ... ENTRY ... ] [ ... ENTRY ... ] [ ... ENTRY ... ] ]]>

Here is an even simpler example: a transient node that sends only notifications without a payload:

]]>

Naturally, the entities involved may need to complete other use cases in order to enable full pubsub functionality -- for example, the publisher may need to create the node (see Create a Node) and subscribers may need to sign up for notifications (see Subscribe to a Node). These use cases are fully described in the remainder of this document. (For information about which features are required and which are recommended or optional, consult the Feature Summary.)

The following terms are used throughout this document to refer to elements, objects, or actions that occur in the context of a pubsub service. (Note: Some of these terms are specified in greater detail within the body of this document.)

Authorize Access ModelA node access model under which an entity can subscribe only through having a subscription request approved by a node owner (subscription requests are accepted but only provisionally) and only subscribers may retrieve items.
Address(1) A JID as defined in &xmppcore;, or (2) the combination of a JID and a &xep0030; node.
Collection NodeA type of node that contains nodes and/or other collections but no published items. Collections make it possible to represent hierarchial node structures.
EntityA JID-addressable Jabber entity (client, service, application, etc.).
EventA change in the state of a node.
Instant NodeA node whose NodeID is automatically generated by a pubsub service.
ItemAn XML fragment which is published to a node, thereby generating an event.
ItemIDA unique identifier for an item in the context of a specific node.
Leaf NodeA type of node that contains published items only. It is NOT a container for other nodes.
NodeA virtual location to which information can be published and from which event notifications and/or payloads can be received (in other pubsub systems, this may be labelled a "topic").
NodeIDThe unique identifier for a node within the context of a pubsub service. The NodeID is either supplied by the node creator or generated by the pubsub service (if the node creator requests an Instant Node). The NodeID MAY have semantic meaning, but such meaning is OPTIONAL.
NotificationA message sent to a subscriber informing them of an event.
OutcastAn entity that is disallowed from subscribing or publishing to a node.
OwnerThe manager of a node, of which there may be more than one; often but not necessarily the node creator.
PayloadThe full data associated with an event rather than just the event notification itself.
Open Access ModelA node access model under which any entity may subscribe and retrieve items without approval.
Personal EventingA simplified subset of Publish-Subscribe for use in the context of instant messaging and presence applications, whereby each IM user's JID is a virtual pubsub service; for details, see &xep0163;.
Presence Access ModelA node access model under which any entity that is subscribed to the owner's presence with a subscription of type "from" or "both" (see &rfc3921;) may subscribe to the node and retrieve items from the node; this access model applies mainly to instant messaging systems.
PublisherAn entity that is allowed to publish items to a node.
Pubsub ServiceAn XMPP server or component that adheres to the protocol defined herein.
Roster Access ModelA node access model under which any entity that is subscribed to the owner's presence and in the specified roster group(s) may subscribe to the node and retrieve items from the node; this access model applies mainly to instant messaging systems.
SubscriberAn entity that is subscribed to a node.
Whitelist Access ModelA node access model under which an entity can subscribe only through being added by a node owner (subscription requests are rejected) and only subscribers may retrieve items.

Requirements for a pubsub service can be driven by end-user needs as well as the needs of other components and services which can use the service. First, a pubsub service implemented using Jabber MUST provide the basic features that implement a pure publish-subscribe pattern:

Some of the possible uses of a Jabber-based pubsub service will require other features, but these features are OPTIONAL and therefore not mandatory for compliance with this specification. However, if these features are implemented, they MUST adhere to the protocol described herein in to be compliant. These features include:

To manage permissions, the protocol defined herein uses a hierarchy of affiliations, similiar to those introduced in &xep0045;.

Support for the "owner" and "none" affiliations is REQUIRED. Support for all other affiliations is RECOMMENDED. Particular kinds of pubsub services MAY enforce additional requirements.

Affiliation Subscribe Publish Items Purge Items Configure Node Delete Node Delete Item
Owner Yes Yes Yes Yes Yes Yes
Publisher Yes Yes No No No Yes/No *
None Yes No No No No No
Outcast No No No No No No

* Note: A service MAY allow any publisher to delete any item once it has been published to that node instead of allowing only the original publisher to remove it (this is discoverable via the "pubsub#delete-any" feature).

The ways in which an entity changes its affiliation with a node are well-defined. Typically, action by an owner is required to make an affiliation state transition. Affiliation changes and their triggering actions are specified in the following table.

  Outcast None Publisher Owner
Outcast -- Owner removes ban Owner adds entity to publisher list Owner adds entity to owner list
None Owner bans entity -- Owner adds entity to publisher list Owner adds entity to owner list
Publisher Owner bans entity Owner removes entity from publisher list -- Owner adds entity to owner list
Owner n/a Owner resigns n/a --

Subscriptions to a node may exist in several states.

Subscription State Description
None The node MUST NOT send event notifications or payloads to the Entity.
Pending An entity has requested to subscribe to a node and the request has not yet been approved by a node owner. The node MUST NOT send event notifications or payloads to the entity while it is in this state.
Unconfigured An entity has subscribed but its subscription options have not yet been configured. The node MAY send event notifications or payloads to the entity while it is in this state. The service MAY timeout unconfigured subscriptions.
Subscribed An entity is subscribed to a node. The node MUST send all event notifications (and, if configured, payloads) to the entity while it is in this state (subject to subscriber configuration and content filtering).

The requirements for the publish-subscribe protocol imply that there are two major dimensions along which we can measure events: persistent vs. transient, and pure notification vs. inclusion of payload. An implementation SHOULD enable an owner to configure a node along both of these dimensions.

No matter whether a node is configured for persistent or transient events, a service MAY cache the last item published to the node, in which case it SHOULD send that item to subscribers based on configuration of the "send_last_published_item" option (see the Item Caching section of this document); if the service supports the "http://jabber.org/protocol/pubsub#last-published" feature then the value of this option MUST default to "on_sub_and_presence" (though the service SHOULD allow the node owner to override the default).

A pubsub service MUST validate publish requests against the configuration of the node along both of these dimensions (see the Publish An Item to a Node section of this document for the relevant error conditions).

Whether an item must be provided by the publisher, and whether an item ID is provided by the publisher or generated by the pubsub service, depends on the type of event being published. We can summarize the relevant rules as follows:

 NotificationPayload
Persistent Publisher MUST include an &ITEM; element, which MAY be empty or contain a payload; if item ID is not provided by publisher, it MUST be generated by pubsub service Publisher MUST include an &ITEM; element that contains the payload; if item ID is not provided by publisher, it MUST be generated by pubsub service
Transient Publisher MUST NOT include an &ITEM; element (therefore item ID is neither provided nor generated) but the notification will include an empty &ITEMS; element Publisher MUST include an &ITEM; element that contains the payload, but the item ID is OPTIONAL

There are two types of nodes:

Node Type Description
Leaf A node that contains published items only. It is NOT a container for other nodes. This is the most common node type.
Collection A node that contains nodes and/or other collections but no published items. Collections make it possible to represent hierarchial node structures.

In order to make node creation simpler for clients, we define the following node access models (in order of openness):

Access Model Description
Open Any entity may subscribe to the node (i.e., without the necessity for subscription approval) and any entity may retrieve items from the node (i.e., without being subscribed); this SHOULD be the default access model for generic pubsub services.
Presence Any entity with a subscription of type "from" or "both" may subscribe to the node and retrieve items from the node; this access model applies mainly to instant messaging systems (see RFC 3921).
Roster Any entity in the specified roster group(s) may subscribe to the node and retrieve items from the node; this access model applies mainly to instant messaging systems (see RFC 3921).
Authorize The node owner must approve all subscription requests, and only subscribers may retrieve items from the node.
Whitelist An entity may be subscribed only through being added to a whitelist by the node owner (unsolicited subscription requests are rejected), and only subscribers may retrieve items from the node. In effect, the default affiliation is outcast. The node owner MUST automatically be on the whitelist. In order to add entities to the whitelist, the node owner SHOULD use the protocol specified in the Manage Affiliated Entities section of this document.

A generic publish-subscribe implementation SHOULD support all of the defined access models, although specialized publish-subscribe implementations MAY support only a subset of the access models. Which access models are provided in a particular deployment is a matter of service provisioning (e.g., some restricted deployments may wish to lock down permissions so that only the "authorize" and "whitelist" access models are provided, or even only the "whitelist" access model).

A node creator or owner can override the default access model by specifying an appropriate value for the 'pubsub#access_model' configuration field (see the Create a Node With Default Configuration and Configure a Node sections of this document).

If a pubsub node is addressable, it MUST be addressable either (1) as a JID or (2) as the combination of a JID and a node. These nodes are equivalent to those used in XEP-0030: Service Discovery.

If a pubsub node is addressable as a JID, the NodeID MUST be the resource identifier, and MUST NOT be specified by the "user" portion (node identifier) of the JID (e.g. "domain.tld/NodeID" and "user@domain.tld/NodeID" are allowed; "NodeID@domain.tld" is not allowed This rule does not apply to the root collection node, if any.). JID addressing SHOULD be used when interacting with a pubsub node using a protocol that does not support the node attribute. For example, when a service makes it possible for entities to subscribe to nodes via presence, it would address nodes as JIDs. If a pubsub node is addressable as a JID, the pubsub service MUST ensure that the NodeID conforms to the Resourceprep profile of Stringprep as described in RFC 3920.

Consider the following example, in which the pubsub service is located at the hostname pubsub.shakespeare.lit.

... ]]>

Now consider the following example, in which the pubsub service is located at pubsub@shakespeare.lit.

... ]]>

If a pubsub node is addressable as a JID plus node, the NodeID MUST be the value of both the Service Discovery 'node' attribute and the pubsub 'node' attribute; i.e., for discovery purposes, a pubsub node is equivalent to a Service Discovery node. If a pubsub node is addressable as a JID plus node, the pubsub service SHOULD ensure that the NodeID conforms to the Resourceprep profile of Stringprep as described in RFC 3920.

Consider the following example, in which the (virtual) pubsub service is located at hamlet@denmark.lit.

]]>

This section defines the use cases for and protocols to be used by any entity that wishes to interact with a publish-subscribe service, mainly focused on Service Discovery use cases.

A service MUST respond to service discovery information requests qualified by the 'http://jabber.org/protocol/disco#info' namespace. The "disco#info" result returned by a pubsub service MUST indicate the identity of the service and indicate which pubsub features are supported.

]]> ]]>

The possible pubsub features are noted throughout this document and have been registered as described in the XMPP Registrar Considerations section of this document. For information regarding which features are required, recommended, and optional, see the Feature Summary section of this document.

If a service implements a hierarchy of nodes (by means of Collection Nodes), it MUST also enable entities to discover the nodes in that hierarchy by means of the Service Discovery protocol, subject to the recommendations in XEP-0030 regarding large result sets (for which &xep0055; or some other protocol SHOULD be used). The following examples show the use of service discovery in discovering the nodes available at a hierarchical pubsub service.

Note: Node hierarchies and collection nodes are OPTIONAL. For details, refer to the NodeID Semantics and Collection Nodes sections of this document.

In the first example, an entity sends a service discovery items ("disco#items") request to the root node (i.e., the service itself), which is a Collection Node:

]]> ]]>

In the second example, an entity sends a disco#items request to one of the first-level nodes, which is also a collection node:

]]> ]]>

If a node is a leaf node rather than a collection node and items have been published to the node, the service MAY return one &ITEM; element for each published item as described in the Discover Items for a Node section of this document, however such items MUST NOT include a 'node' attribute (since they are published items, not nodes).

A pubsub service MUST allow entities to query individual nodes for the information associated with that node. The Service Discovery protocol MUST be used to discover this information. The "disco#info" result MUST include an identity with a category of "pubsub" and a type of either "leaf" or "collection".

Note: If a node has an identity type of "leaf", then it MUST NOT contain other nodes or collections (only items); if a node has an identity type of "collection", then it MUST NOT contain items (only other nodes or collections).

]]> ... ... ]]> ]]> ... ... ]]>

The "disco#info" result MAY include detailed meta-data about the node, encapsulated in the &xep0004; format as described in &xep0128;, where the data form context is specified by including a FORM_TYPE of "http://jabber.org/protocol/pubsub#meta-data" in accordance with &xep0068;. If meta-data is provided, it SHOULD include values for all configured options as well as "automatic" information such as the node creation date, a list of publishers, and the like.

]]> http://jabber.org/protocol/pubsub#meta-data http://www.w3.org/2005/Atom hamlet@denmark.lit 2003-07-29T22:56Z Princely Musings (Atom) Updates for Hamlet's Princely Musings weblog. en bard@shakespeare.lit hamlet@denmark.lit hamlet@denmark.lit 1066 ]]>

Note: Node meta-data can be set in many ways. Some of it is based on node configuration (e.g., the owner's JID) whereas some of it may be dynamic (e.g., the number of subscribers). Any static information to be provided in the node meta-data SHOULD be provided as fields in the node configuration form.

Much of the meta-data provided about a node maps directly to selected &DUBLINCORE; meta-data attributes; specifically:

Pubsub FieldDublin Core Meta-Data Attribute
pubsub#creation_dateDate The value SHOULD be a DateTime as defined in XEP-0082, and MUST conform to one of the profiles defined therein.
pubsub#creatorCreator
pubsub#descriptionDescription
pubsub#languageLanguage
pubsub#publisherPublisher
pubsub#titleTitle
pubsub#typeType The pubsub type SHOULD be the namespace that defines the payload (such as 'http://www.w3.org/2005/Atom'), if payloads are supported.

To discover the published items which exist on the service for a specific node, an entity MAY send a "disco#items" request to the node itself, and the service MAY return each item as a Service Discovery &ITEM; element. The 'name' attribute of each Service Discovery item MUST contain its ItemID and the item MUST NOT possess a 'node' attribute. This ItemID MAY then be used to retrieve the item using the protocol defined in the Retrieve Items from a Node section of this document.

]]>

An entity way want to query the service to retrieve its subscriptions for all nodes at the service. Support for this feature ("retrieve-subscriptions") is RECOMMENDED.

In order to make the request, the requesting entity MUST send an IQ-get whose &PUBSUB; child contains an empty <subscriptions/> element with no attributes.

]]>

If the service returns a list of subscriptions, it MUST return all subscriptions for all JIDs that match the bare JID (&BAREJID;) portion of the 'from' attribute on the request.

For each subscription, a <subscription/> element is returned specifying the NodeID, the JID that is affiliated (which MAY include a resource, depending on how the entity subscribed), and the current subscription state. If subscription identifiers are supported by the service, the 'subid' attribute MUST be present as well.

]]>

If the requesting entity has no subscriptions, the pubsub service MUST return an empty <subscriptions/> element.

]]>

If the service does not support subscriptions retrieval, the service MUST respond with a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "retrieve-subscriptions".

]]>

An entity may want to query the service to retrieve its affiliations for all nodes at the service. Support for this feature ("retrieve-affiliations") is RECOMMENDED.

In order to make the request, the requesting entity includes an empty <affiliations/> element with no attributes.

]]>

If the service returns a list of affiliations, it MUST return all affiliations for all JIDs that match the bare JID (&BAREJID;) portion of the 'from' attribute on the request.

For each affiliation, an <affiliation/> element is returned containing the NodeID and the affiliation state (owner, publisher, or outcast).

]]>

If the requesting entity has no affiliations, the pubsub service MUST return an empty <affiliations/> element.

]]>

If the service does not support affiliations retrieval, the service MUST respond with a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "retrieve-affiliations".

]]>

This section defines the use cases for and protocols to be used by potential and actual subscribers. (Note: The Implementation Notes section of this document describes many important factors and business rules which a pubsub service MUST observe. In addition, the examples throughout assume the existence of a separate pubsub component and include any relevant 'from' addresses as stamped by a server or network edge.)

When a Jabber entity wishes to subscribe to a node, it sends a subscription request to the pubsub service. The subscription request is an IQ-set where the <pubsub/> element contains one and only one <subscribe/> element. The <subscribe/> element MUST possess a 'node' attribute specifying the node to which the entity wishes to subscribe. The <subscribe/> element MUST also possess a 'jid' attribute specifying the exact XMPP address to be used as the subscribed JID -- often a bare JID (&BAREJID;) or full JID (&FULLJID;), although JIDs of the form &DOMAIN; or &DOMAINRES; may subscribe as well.

Here is an example of a subscription request.

]]>

If the subscription request is successfully processed, the server MUST inform the requesting entity that it is now subscribed (which MAY include a service-generated SubID).

]]>

There are several reasons why the subscription request might fail:

  1. The bare JID portions of the JIDs do not match.
  2. The node has an access model of "presence" and the requesting entity is not subscribed to the owner's presence.
  3. The node has an access model of "roster" and the requesting entity is not in one of the authorized roster groups.
  4. The node has an access model of "whitelist" and the requesting entity is not on the whitelist.
  5. The service requires payment for subscriptions to the node.
  6. The requesting entity is anonymous and the service does not allow anonymous entities to subscribe.
  7. The requesting entity has a pending subscription.
  8. The requesting entity is blocked from subscribing (e.g., because having an affiliation of outcast).
  9. The node does not support subscriptions.
  10. The node does not exist.

These error cases are described more fully in the following sections.

If the specified JID is a bare JID or full JID, the service MUST at a minimum check the bare JID portion against the bare JID portion of the 'from' attribute on the received IQ request to make sure that the requesting entity has the same identity as the JID which is being requested to be added to the subscriber list.

If the bare JID portions of the JIDs do not match as described above and the requesting entity does not have some kind of admin or proxy privilege as defined by the implementation, the service MUST return a &badrequest; error, which SHOULD also include a pubsub-specific error condition of <invalid-jid/>.

]]>

Note: An implementation MAY enable the service administrator to configure a list of entities that are excluded from this check; those entities may be considered "trusted proxies" that are allowed to subscribe on behalf of other entities. In the same way, implementations MAY enable blacklisting of entities that are not allowed to perform specific operations (such as subscribing or creating nodes).

For nodes with an access model of "presence", if the requesting entity is not subscribed to the owner's presence then the pubsub service MUST respond with a ¬authorized; error, which SHOULD also include a pubsub-specific error condition of <presence-subscription-required/>.

]]>

For nodes with an access model of "roster", if the requesting entity is not in one of the authorized roster groups then the pubsub service MUST respond with a ¬authorized; error, which SHOULD also include a pubsub-specific error condition of <not-in-roster-group/>.

]]>

For nodes with a node access model of "whitelist", if the requesting entity is not on the whitelist then the service MUST return a ¬allowed; error, specifying a pubsub-specific error condition of <closed-node/>.

]]>

Commercial deployments may wish to link subscribers to a database of paying customers. If the subscriber needs to provide payment in order to subscribe to the node (e.g., if the subscriber is not in the customer database or the customer's account is not paid up), the service SHOULD return a &payment; error to the subscriber.

]]>

Some XMPP servers may allow authentication using SASL ANONYMOUS; however, because the resulting entity is unstable (the assigned JID may not be owned by the same principal in a persistent manner), a service MAY prevent anonymous entities from subscribing to nodes and SHOULD use service discovery to determine if an entity has an identity of "account/anonymous". If a requesting entity is anonymous but the service does not allow anonymous entities to subscribe, the service SHOULD return a &forbidden; error to the subscriber.

]]>

If the requesting entity has a pending subscription, the service MUST return a ¬authorized; error to the subscriber, specifying a pubsub-specific error condition of <pending-subscription/>.

]]>

If the requesting entity is blocked from subscribing (e.g., because having an affiliation of outcast), the service MUST return a &forbidden; error to the subscriber.

]]>

If the node does not allow entities to subscribe, the service SHOULD return a &feature; error to the subscriber, specifying a pubsub-specific error condition of <unsupported/> and a feature of "subscribe".

]]>

If the node does not exist, the service SHOULD return an ¬found; error to the subscriber.

]]>

For nodes with an access model of "authorize", subscription requests MUST be approved by one of the node owners; therefore the pubsub service sends a message to the node owner(s) requesting authorization (see the Manage Subscription Requests section of this document). Because the subscription request may or may not be approved, the service MUST return a pending notification to the subscriber.

]]>

If the entity must configure its subscription options (see the Configure Subscription Options section of this document) before receiving notifications, the service MUST so inform the entity. It SHOULD do so by returning an IQ-result to the requesting entity with a notation that configuration of subscription options is required.

]]>

Note: The node shall include the <required/> child element only if the subscriber must configure the subscription before receiving any notifications. A service MAY time out subscription requests if configuration is required and a configuration request is not submitted within a reasonable amount of time (which shall be determined by the service or node configuration).

Alternatively, if the service is unable to create the subscription without simultaneous configuration, the service MAY return a ¬acceptable; error, specifying a pubsub-specific error condition of <configuration-required/>.

http://jabber.org/protocol/pubsub#subscribe_options 1 0 false chat online away ]]>

If the <required/> element is not included and no error is returned, the subscription takes effect immediately and the entity may configure the subscription at any time (the service MAY indicate that subscription options are supported by including an empty <subscribe-options/> element in the IQ-result, as shown in the following example).

]]>

An entity may wish to subscribe using different subscription options, which it can do by subscribing multiple times to the same node. Support for this feature ("multi-subscribe") is OPTIONAL.

If multiple subscriptions for the same JID are allowed, the service MUST use the 'subid' attribute to differentiate between subscriptions for the same entity (therefore the SubID MUST be unique for each node+JID combination and the SubID MUST be present on the entity element any time it is sent to the subscriber). It is NOT RECOMMENDED for clients to generate SubIDs, since collisions might result; therefore a service SHOULD generate the SubID on behalf of the subscriber and MAY overwrite SubIDs if they are provided by subscribers. If the service does not allow multiple subscriptions for the same entity and it receives an additional subscription request, the service MUST return the current subscription state (as if the subscription was just approved).

When a subscription request is successfully processed, the service MAY send the last published item to the new subscriber. The message containing this item SHOULD be stamped with extended information qualified by the 'urn:xmpp:delay' namespace (see &xep0203;) to indicate it is are sent with delayed delivery. (Note that in this example the message notification is sent to the bare JID since that is the subscribed JID.)

Soliloquy To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? tag:denmark.lit,2003:entry-32397 2003-12-13T18:30:02Z 2003-12-13T18:30:02Z ]]>

If the service sends the last published item by default for all nodes (subject to overriding by node configuration), it MUST return a feature of "http://jabber.org/protocol/pubsub#last-published" in its responsess to disco#info requests.

To unsubscribe from a node, the subscriber sends an IQ-set whose &PUBSUB; child contains an <unsubscribe/> element that specifies the node and the subscribed JID.

]]>

If the request can be successfully processed, the service MUST return an IQ result.

]]>

There are several reasons why the unsubscribe request might fail:

  1. The requesting entity has multiple subscriptions to the node but does not specify a subscription ID.
  2. The request does not specify an existing subscriber.
  3. The requesting entity does not have sufficient privileges to unsubscribe the specified JID.
  4. The node does not exist.
  5. The request specifies a subscription ID that is not valid or current.

These error cases are described more fully in the following sections.

If the requesting entity has multiple subscriptions to the node but does not specify a subscription ID, the service MUST return a &badrequest; error, which SHOULD also include a pubsub-specific error condition of <subid-required/>.

]]>

If the value of the 'jid' attribute does not specify an existing subscriber, the pubsub service MUST return an error stanza, which SHOULD be &unexpected; and which SHOULD also include a pubsub-specific error condition of <not-subscribed/>.

]]>

If the requesting entity is prohibited from unsubscribing the specified JID, the service MUST return a &forbidden; error. The service MUST validate that the entity making the request is authorized to unsubscribe the entity. If the subscriber's JID is of the form &FULLJID;, a service MUST perform this check by comparing the &BAREJID; part of the two JIDs to ensure that they match. If the bare JID portions of the JIDs do not match and the requesting entity is not authorized to unsubscribe the JID (e.g., because it is not a service-wide admin or authorized proxy), the service MUST return a &forbidden; error.

]]>

If the node does not exist, the pubsub service MUST return an ¬found; error.

]]>

If a subscription identifier is associated with the subscription, the unsubscribe request MUST include an appropriate 'subid' attribute. If the unsubscribe request includes a SubID but SubIDs are not supported for the node (or the subscriber did not subscribe using a SubID in the first place), the service SHOULD ignore the SubID and simply unsubscribe the entity. If the subscriber originally subscribed with a SubID but the unsubscribe request includes a SubID that is not valid or current for the subscriber, the service MUST return a ¬acceptable; error, which SHOULD also include a pubsub-specific error condition of <invalid-subid/>.

]]>

An implementation MAY allow subscribers to configure subscription options. Implementations SHOULD use the Data Forms protocol to accomplish this configuration (however, an out-of-band mechanism such as a web interface could be offered as well).

If a service supports subscription options it MUST advertise that fact in its response to a "disco#info" query by including a feature whose 'var' attribute is "pubsub#subscription-options".

... ... ]]>

A subscriber requests the subscription options by including an <options/> element inside an IQ-get stanza.

]]>

If the request can be successfully processed, the service MUST respond with the options.

http://jabber.org/protocol/pubsub#subscribe_options 1 0 false chat online ]]>

Note: The foregoing example shows some (but by no means all) of the possible configuration options that MAY be provided. If an implementation provides these options using the Data Forms protocol, it MUST use the field variables that are registered with the XMPP Registrar in association with the 'http://jabber.org/protocol/pubsub' namespace (a preliminary representation of those field variables is shown above and in the pubsub#subscribe_options FORM_TYPE section of this document, but MUST NOT be construed as canonical since the XMPP Registrar may standardize additional fields at a later date without changes to this document).

Note: Many of the relevant data form fields are of type "boolean" and MUST be handled accordingly. &BOOLEANNOTE;

There are several reasons why the options request might fail:

  1. The requesting entity does not have sufficient privileges to modify subscription options for the specified JID.
  2. The requesting entity (or specified subscriber) is not subscribed.
  3. The request does not specify both the NodeID and the subscriber's JID.
  4. The request does not specify a subscription ID but one is required.
  5. The request specifies a subscription ID that is not valid or current.
  6. Subscription options are not supported.
  7. The node does not exist.

These error cases are described more fully in the following sections.

When requesting subscription options, the subscriber MUST specify the JID that is subscribed to the node and SHOULD specify a node (if no node is specified, the service MUST assume that the requesting entity wishes to request subscription options for its subscription to the root collection node; see the Root Collection Node section of this document for details).

The service MUST validate that the entity making the request is authorized to set the subscription options for the subscribed entity. If the subscriber's JID is of the form &FULLJID;, a service MUST perform this check by comparing the &BAREJID; part of the two JIDs to ensure that they match. If the bare JID portions of the JIDs do not match and the requesting entity is not authorized to modify subscription options for the JID (e.g., because it is not a service-wide admin or authorized proxy), the service MUST return a &forbidden; error.

]]>

If the requesting entity (or specified subscriber, if different) is not subscribed, the service MUST return an &unexpected; error, which SHOULD also include a pubsub-specific error condition of <not-subscribed/>.

]]>

If the subscriber does not specify a JID, the service MUST return a &badrequest; error, which SHOULD also include a pubsub-specific error condition of <jid-required/>.

]]>

If a subscription identifier is associated with the subscription, the 'subid' attribute MUST be present on the request in order for the service to differentiate subscriptions for the same entity. If the 'subid' is required but not provided, the service MUST return a &badrequest; error, which SHOULD also include a pubsub-specific error condition of <subid-required/>.

]]>

If a subscription identifier is associated with the subscription but the request includes a SubID that is not valid or current for the subscriber, the service MUST return a ¬acceptable; error, which SHOULD also include a pubsub-specific error condition of <invalid-subid/>.

]]>

If the node or service does not support subscription options, the service MUST respond with a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "subscription-options".

]]>

If the node does not exist, the pubsub service MUST return an ¬found; error.

]]>

After receiving the configuration form, the requesting entity SHOULD submit the form in order to update the entity's subscription options for that node.

http://jabber.org/protocol/pubsub#subscribe_options 1 0 false chat online away ]]>

If the service can successfully process the submission, it MUST respond with success.

]]>

If the subscriber attempts to set an invalid group of options, the service MUST respond with a &badrequest; error.

http://jabber.org/protocol/pubsub#subscribe_options 1 0 false chat online away ]]>

The other errors already mentioned for getting subscription options also apply to setting subscription options.

As noted, if a service supports subscription options, an entity MAY subscribe and provide the subscription options in the same stanza.

Note: The <options/> element MUST follow the <subscribe/> element and MUST NOT possess a 'node' attribute or 'jid' attribute, since the value of the <subscribe/> element's 'node' attribute specifies the desired NodeID and the value of the <subscribe/> element's 'jid' attribute specifies the subscriber's JID; if any of these rules are violated, the service MUST return a &badrequest; error.

http://jabber.org/protocol/pubsub#subscribe_options 1 0 false chat online away ]]>

Implementations of pubsub that choose to persist items MAY allow entities to request existing items from a node (e.g., an entity may wish to do this after successfully subscribing in order to receive all the items in the publishing history for the node).

The service MUST conform to the node's access model in determining whether to return items to the entity that requests them. Specifically:

  • If the access model is "open", the service SHOULD allow any entity (whether or not it is subscribed) to retrieve items.

  • If the access model is "presence", the service SHOULD allow any entity that is subscribed to the owner's presence to retrieve items.

  • If the access model is "roster", the service SHOULD allow any entity that is subscribed to the owner's presence and contained in the relevant roster group(s) to retrieve items.

  • If the access model is "authorize" or "whitelist", the service MUST allow only subscribed entities to retrieve items.

The only exception foreseen to the SHOULD requirements for the foregoing access models is the enforcement of local privacy and security policies as specified more fully in the Security Considerations section of this document. (In addition, a service MUST always allow the node owner to retrieve items from a node and SHOULD always allow a publisher to do so.)

The subscriber may request all items by specifying only the Node ID without restrictions.

]]>

The service then SHOULD return all items published to the node, although it MAY truncate the result set if a large number of items has been published.

The Uses of This World O, that this too too solid flesh would melt Thaw and resolve itself into a dew! tag:denmark.lit,2003:entry-32396 2003-12-12T17:47:23Z 2003-12-12T17:47:23Z Ghostly Encounters O all you host of heaven! O earth! what else? And shall I couple hell? O, fie! Hold, hold, my heart; And you, my sinews, grow not instant old, But bear me stiffly up. Remember thee! tag:denmark.lit,2003:entry-32396 2003-12-12T23:21:34Z 2003-12-12T23:21:34Z Alone Now I am alone. O, what a rogue and peasant slave am I! tag:denmark.lit,2003:entry-32396 2003-12-13T11:09:53Z 2003-12-13T11:09:53Z Soliloquy To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? tag:denmark.lit,2003:entry-32397 2003-12-13T18:30:02Z 2003-12-13T18:30:02Z ]]>

Even if the service or node does not support persistent items, it MAY return the last published item.

Soliloquy To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? tag:denmark.lit,2003:entry-32397 2003-12-13T18:30:02Z 2003-12-13T18:30:02Z ]]>

A service MAY return event notifications without payloads (e.g., to conserve bandwidth). If so, the client MAY request a specific item (using the ItemID) in order to retrieve the payload. When an entity requests items by ItemID, implementations MUST allow multiple items to be specified in the request.

]]> The Uses of This World O, that this too too solid flesh would melt Thaw and resolve itself into a dew! tag:denmark.lit,2003:entry-32396 2003-12-12T17:47:23Z 2003-12-12T17:47:23Z Alone Now I am alone. O, what a rogue and peasant slave am I! tag:denmark.lit,2003:entry-32396 2003-12-13T11:09:53Z 2003-12-13T11:09:53Z ]]>

A service MAY allow entities to request the most recent N items by using the 'max_items' attribute. When max_items is used, implementations SHOULD return the N most recent (as opposed to the N oldest) items. (Note: A future version of this specification may recommend the use of &xep0059; instead of the 'max_items' attribute.)

]]> Alone Now I am alone. O, what a rogue and peasant slave am I! tag:denmark.lit,2003:entry-32396 2003-12-13T11:09:53Z 2003-12-13T11:09:53Z Soliloquy To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? tag:denmark.lit,2003:entry-32397 2003-12-13T18:30:02Z 2003-12-13T18:30:02Z ]]>

There are several reasons why the items retrieval request might fail:

  1. The requesting entity has multiple subscriptions to the node but does not specify a subscription ID.
  2. The requesting entity is subscribed but specifies an invalid subscription ID.
  3. The node does not return items to unsubscribed entities and the requesting entity is not subscribed.
  4. The service or node does not support persistent items and does not return the last published item.
  5. The service or node does not support item retrieval.
  6. The node has an access model of "presence" and the requesting entity is not subscribed to the owner's presence.
  7. The node has an access model of "roster" and the requesting entity is not in one of the authorized roster groups.
  8. The node has an access model of "whitelist" and the requesting entity is not on the whitelist.
  9. The service or node requires payment for item retrieval.
  10. The requesting entity is blocked from retrieving items from the node (e.g., because having an affiliation of outcast).
  11. The node does not exist.

These error cases are described more fully in the following sections.

If the requesting entity has multiple subscriptions to the node but does not specify a subscription ID, the service MUST return a &badrequest; error to the subscriber, which SHOULD also include a pubsub-specific error condition of <subid-required/>.

]]>

If the requesting entity is subscribed but specifies an invalid subscription ID, the service MUST return a ¬acceptable; error to the subscriber, which SHOULD also include a pubsub-specific error condition of <invalid-subid/>.

]]>

If the node does not return items to unsubscribed entities and the requesting entity is not subscribed (which includes having a pending subscription), the service MUST return a ¬authorized; error to the subscriber, which SHOULD also include a pubsub-specific error condition of <not-subscribed/>.

]]>

If the service or node does not support persistent items and does not return the last published item, the service MUST return a &feature; error to the subscriber, specifying a pubsub-specific error condition of <unsupported/> and a feature of "persistent-items".

]]>

If the service or node does not support item retrieval (e.g., because the node is a collection node), the service MUST return a &feature; error to the subscriber, specifying a pubsub-specific error condition of <unsupported/> and a feature of "retrieve-items".

]]>

For nodes with an access model of "presence", if the requesting entity is not subscribed to the owner's presence then the pubsub service MUST respond with a ¬authorized; error, which SHOULD also include a pubsub-specific error condition of <presence-subscription-required/>.

]]>

For nodes with an access model of "roster", if the requesting entity is not in one of the authorized roster groups then the pubsub service MUST respond with a ¬authorized; error, which SHOULD also include a pubsub-specific error condition of <not-in-roster-group/>.

]]>

For nodes with a node access model of "whitelist", if the requesting entity is not on the whitelist then the service MUST return a ¬allowed; error, specifying a pubsub-specific error condition of <closed-node/>.

]]>

Commercial deployments may wish to link subscribers to a database of paying customers. If the subscriber needs to provide payment in order to retrieve items from the node (e.g., if the subscriber is not in the customer database or the customer's account is not paid up), the service SHOULD return a &payment; error to the subscriber.

]]>

If the requesting entity is blocked from subscribing (e.g., because having an affiliation of outcast), the service MUST return a &forbidden; error to the subscriber.

]]>

If the node does not exist, the service SHOULD return an ¬found; error to the subscriber.

]]>

Any entity that is allowed to publish items to a node (i.e., a publisher or an owner) may do so at any time by sending an IQ-set to the service containing a pubsub element with a <publish/> child.

The syntax is as follows:

  • The <publish/> element MUST possess a 'node' attribute, specifying the NodeID of the node.
  • Depending on the node configuration, the <publish/> element MAY contain no &ITEM; elements, one &ITEM; element, or (for Batch Processing) more than one &ITEM; element. It is not necessary for a publication request to include a payload or even an &ITEM; element in order to trigger a notification. For example, the result of publishing to a transient, notification-only node will be a notification that does not include even an &ITEM; element. However, for the sake of convenience we refer to the act of publication as "publishing an item" (rather than, say, "triggering a notification") even though a publication request will not always contain an &ITEM; element.
  • The <item/> element provided by the publisher MAY possess an 'id' attribute, specifying a unique ItemID for the item. If an ItemID is not provided in the publish request, the pubsub service MUST generate one and MUST ensure that it is unique for that node.

An example follows.

Soliloquy To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? tag:denmark.lit,2003:entry-32397 2003-12-13T18:30:02Z 2003-12-13T18:30:02Z ]]>

If the pubsub service can successfully process the request, it MUST inform the publisher of success.

]]>

The pubsub service MUST send then one &MESSAGE; stanza containing a pubsub event notification to each approved subscriber. Each &MESSAGE; stanza generated by a pubsub service SHOULD possess an 'id' attribute with a unique value so that the service can properly track any notification-related errors that may occur (see the Handling Notification-Related Errors section of this document). Depending on the node configuration, the event notification either will or will not contain the payload, as shown below.

Note: In order to facilitate authorization for item removal as described in the Delete an Item from a Node section of this document, implementations that support persistent items SHOULD store the item (if the node is so configured) and maintain a record of the publisher.

If the node is configured to include payloads, the subscribers will receive payloads with the event notifications.

Soliloquy To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? tag:denmark.lit,2003:entry-32397 2003-12-13T18:30:02Z 2003-12-13T18:30:02Z Soliloquy To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? tag:denmark.lit,2003:entry-32397 2003-12-13T18:30:02Z 2003-12-13T18:30:02Z Soliloquy To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? tag:denmark.lit,2003:entry-32397 2003-12-13T18:30:02Z 2003-12-13T18:30:02Z Soliloquy To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? tag:denmark.lit,2003:entry-32397 2003-12-13T18:30:02Z 2003-12-13T18:30:02Z ]]>

If the node is configured to not include payloads, the subscribers will receive event notifications only. (If payloads are not included, subscribers may request the published item via the protocol defined in the Retrieve Items from a Node section of this document.)

]]>

If a single entity is subscribed to a node multiple times, the service SHOULD notate the event notification so that the entity can determine which subscription identifier(s) generated this event. If these notations are included, they MUST use the &xep0131; format and SHOULD be included after the event notification information (i.e., as the last child of the &MESSAGE; stanza).

123-abc
004-yyy
]]>

There are several reasons why the publish request might fail:

  1. The requesting entity does not have sufficient privileges to publish.
  2. The node does not support item publication.
  3. The node does not exist.
  4. The payload size exceeds a service-defined limit.
  5. The item contains more than one payload element or the namespace of the root payload element does not match the configured namespace for the node.
  6. The request does not match the node configuration.

These error cases are described more fully in the following sections.

Note: If a publisher publishes an item with an Item ID and the ItemID matches that of an existing item, the pubsub service MUST NOT fail the publication but instead MUST overwrite the existing item and generate a new event notification (i.e., re-publication is equivalent to modification).

If the requesting entity does not have sufficient privileges to publish, the service MUST return a &forbidden; error.

... PAYLOAD ... ]]>

If the node does not support item publication (because it is a Collection Node), the service MUST return a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "publish".

... PAYLOAD ... ]]>

If the requesting entity attempts to publish an item to a node that does not exist and the service does not support the "auto-create" feature (see Automatic Node Creation), the service MUST return an ¬found; error.

... PAYLOAD ... ]]>

If the payload size exceeds a service-defined limit, the service MUST return a ¬acceptable; error, which SHOULD also include a pubsub-specific error condition of <payload-too-big/>.

... HUGE PAYLOAD ... ]]>

If the &ITEM; element contains more than one payload element or the namespace of the root payload element does not match the configured namespace for the node, the service MUST bounce the request with a &badrequest; error, which SHOULD also include a pubsub-specific error condition of <invalid-payload/>.

... INVALID PAYLOAD ... ]]>

If the request does not conform to the configured event type for the node, the service MAY bounce the request with a &badrequest; error, which SHOULD also include a pubsub-specific error condition. The following rules apply:

  • If the event type is persistent (either notification or payload) and the publisher does not specify an ItemID, the service MUST generate the ItemID and MUST NOT bounce the publication request.
  • If the event type is persistent (either notification or payload) and the publisher does not include an item, the service MUST bounce the publication request with a &badrequest; error and a pubsub-specific error condition of <item-required/>.
  • If the event type is payload (either persistent or transient) and the publisher does not include a payload, the service SHOULD bounce the publication request with a &badrequest; error and a pubsub-specific error condition of <payload-required/>.
  • If the event type is notification + transient and the publisher provides an item, the service MUST bounce the publication request with a &badrequest; error and a pubsub-specific error condition of <item-forbidden/>.

Examples of these errors are shown below.

]]> ]]> ]]>

A pubsub service MAY automatically create a node when it receives a publish request sent to a node that does not exist (instead of returning an ¬found; error). When doing so, the service SHOULD apply the default node configuration. If a service supports this functionality, it MUST advertise that fact by including a feature of "http://jabber.org/protocol/pubsub#auto-create" in its disco#info responses.

A pubsub service MAY support the ability to specify options along with a publish request (if so, it MUST advertise support for the "http://jabber.org/protocol/pubsub#publish-options" feature). Here is an example:

Soliloquy To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them? tag:denmark.lit,2003:entry-32397 2003-12-13T18:30:02Z 2003-12-13T18:30:02Z http://jabber.org/protocol/pubsub#publish-options presence ]]>

The <publish-options/> element SHOULD contain a data form (see XEP-0004), whose FORM_TYPE SHOULD be "http://jabber.org/protocol/pubsub#publish-options" (see XEP-0068).

How the fields are to be handled is up to the the pubsub service, which in the language of XEP-0004 functions as a form-processing entity.

For example, the service may treat the field as a precondition, in which case the service should proceed as follows:

  1. If the node exists and the precondition is not met, then the publish shall fail with a &conflict; error condition and a pubsub-specific condition of <precondition-not-met/>.
  2. If the node exists and the precondition is met, then the publish succeeds.
  3. If the node does not exist and the service supports the "auto-create" feature, then the service shall auto-create the node with default configuration in all respects except those specified in the preconditions, and the publish succeeds.
  4. If the node does not exist and the service does not support the "auto-create" feature, then the publish shall fail.

A publisher may want to delete an item once it has been published to a node that supports persistent items. Support for this feature ("delete-any") is RECOMMENDED.

To delete an item, the publisher sends a retract request as shown in the following examples. The <retract/> element MUST possess a 'node' attribute, MAY possess a 'notify' attribute, and SHOULD contain one &ITEM; element (but MAY contain more than one &ITEM; element for Batch Processing of item retractions); the &ITEM; element MUST be empty and MUST possess an 'id' attribute.

]]>

If no error occurs, the service MUST delete the item.

]]>

If no error occurs and the <retract/> element included a 'notify' attribute with a value of "true" or "1" &BOOLEANNOTE;, then the service MUST delete the item and MUST send message notifications to all subscribers as shown below. The syntax is identical to publish notifications except that instead of an &ITEM; element, the notification includes a <retract/> element.

]]>

If a single entity is subscribed to the node multiple times, the service SHOULD notate the notification of item deletion so that the entity can determine which subscription identifier(s) generated this event. As above, if these notations are included, they MUST use the Stanza Headers and Internet Metadata (SHIM) protocol and SHOULD be included after the event notification information (i.e., as the last child of the &MESSAGE; stanza).

123-abc
004-yyy
]]>

There are several reasons why the item retraction request might fail:

  1. The publisher does not have sufficient privileges to delete the requested item.
  2. The node or item does not exist.
  3. The request does not specify a node.
  4. The request does not include an &ITEM; element or the &ITEM; element does not specify an ItemID.
  5. The node does not support persistent items.
  6. The service does not support the deletion of items.

These error cases are described more fully in the following sections.

If the requesting entity does not have sufficient privileges to delete the item, the service MUST return a &forbidden; error.

]]>

If the node or item does not exist, the service MUST return an ¬found; error.

]]>

If the request does not specify a node, the service MUST return a &badrequest; error, which SHOULD also include a pubsub-specific error condition of <node-required/>.

]]>

If the request does not include an &ITEM; element or the &ITEM; element does not specify an ItemID, the service MUST return a &badrequest; error, which SHOULD also include a pubsub-specific error condition of <item-required/>.

]]>

If the node does not support persistent items (e.g., because it is a collection node or a transient node that does not deliver payloads), the service MUST return a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "persistent-items".

]]>

If the service does not support item deletion, it MUST return a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "delete-nodes".

]]>

An entity may want to create a new node. Support for this feature ("create-nodes") is RECOMMENDED. However, a service MAY disallow creation of nodes based on the identity of the requesting entity, or MAY disallow node creation altogether (e.g., reserving that privilege to a service-wide administrator).

There are two ways to create a node:

  1. Create a node with default configuration for the specified node type.
  2. Create and configure a node simultaneously.

These methods, along with method-specific error conditions, are explained more fully in the following sections.

In addition to method-specific error conditions, there are several general reasons why the node creation request might fail:

  • The service does not support node creation.
  • Only entities that are registered with the service are allowed to create nodes but the requesting entity is not registered.
  • The requesting entity does not have sufficient privileges to create nodes.
  • The requested NodeID already exists.
  • The request did not include a NodeID and "instant nodes" are not supported.

These general error cases are described more fully below.

If the service does not support node creation, it MUST respond with a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "create-nodes".

]]>

If only entities that are registered with the service may create nodes but the requesting entity has not yet registered, the service MUST respond with a ®istration; error.

]]>

If the requesting entity does not have sufficient privileges to create nodes, the service MUST respond with a &forbidden; error.

]]>

If the requested NodeID already exists, the service MUST respond with a &conflict; error.

]]>

If the node creator does not specify a NodeID but the service does not support instant nodes, the service MUST return a ¬acceptable; error, specifying a pubsub-specific error condition of <nodeid-required/>.

]]>

If the node creator does not specify a NodeID but the service supports instant nodes, the service SHOULD generate a NodeID that is unique within the context of the service on behalf of the node creator.

]]>

If no error occurs, the pubsub service SHOULD create the node, generate a NodeID that is unique within the context of that service, and inform the user of success (including the NodeID in the response).

]]>

Note: When a service successfully creates a node on behalf of the requesting entity, it MUST return an IQ result. If the node creation request did not specify a NodeID and the service supports creation of instant nodes, the service MUST specify the created NodeID in the IQ result. Similarly, if the node creation request specified a NodeID but the service modified the NodeID before creating the node as described in the Collection Nodes section of this document, the service MUST also specify the modified node in the IQ result. In all other cases, the service MUST NOT specify the NodeID in the IQ result (since the node creator can determine which node was created by tracking the 'id' attribute that it specified for the IQ-set).

As explained above, each node type has its own default configuration. By asking the service to create a node with default configuration, the node creator accepts the default configuration. If the service allows node configuration, the owner may reconfigure the node after creating the node (as described in the Configure a Node section of this document). In addition, a service MAY allow entities to determine the default configuration options for a given node type before creating a node (as described in the Request Default Configurations section of this document).

In order to create a node with default configuration, the node creator MUST include an empty <configure/> child element in the creation request. The node creator MAY specify values for the 'pubsub#node_type' and 'pubsub#access_model' configuration fields or MAY accept the defaults, which are "leaf" for the 'pubsub#node_type' field and the value represented by the 'pubsub#access_model' field (i.e., "authorize", "open", "presence", "roster", or "whitelist").

In the following example, the node creator requests a leaf node (the default type) with an open access model (assumed to be the default type for this service).

]]>

In order to request an access model other than the default for the service, the node creator MUST include a Data Form in the node creation request that specifies a non-default value for the 'pubsub#node_type' field.

http://jabber.org/protocol/pubsub#node_config whitelist ]]>

If the access model is supported and none of the general or method-specific errors has occurred, the service SHOULD create the node and inform the requesting entity of success.

]]>

If service does not support the specified access model, it MUST return a ¬acceptable; error, specifying a pubsub-specific error condition of <unsupported-access-model/>.

http://jabber.org/protocol/pubsub#node_config whitelist ]]>

(For error handling if the service does not support the specified node type, see the Collection Node section of this document.)

If an implementation allows node configuration (see the Configure a Node section of this document), it SHOULD allow node creation requests to contain the desired node configuration in the node creation request.

Note: The <configure/> element MUST follow the <create/> element and MUST NOT possess a 'node' attribute, since the value of the <create/> element's 'node' attribute specifies the desired NodeID; if any of these rules are violated, the service MUST return a &badrequest; error.

http://jabber.org/protocol/pubsub#node_config Princely Musings (Atom) 1 1 1 10 open publishers never false 0 0 0 1028 http://www.w3.org/2005/Atom http://jabxslt.jabberstudio.org/atom_body.xslt ]]> ]]>

If a service supports this "create-and-configure" feature, it MUST advertise that fact by returning a feature of "http://jabber.org/protocol/pubsub#create-and-configure" in response to service discovery information requests. If the create-and-configure option is not supported but the requesting entity sends such a request anyway, the service SHOULD ignore the configuration part of the request and proceed as if it had not been included.

After creating a new node, the node owner may want to modify the node configuration. Support for this feature is RECOMMENDED.

]]>

If no error occurs, the server MUST return an empty configuration form to the node owner.

Note: The following example shows some of the possible configuration options that MAY be provided. If an implementation implements these features using the Data Forms protocol, that implementation MUST use the fields that are registered with the XMPP Registrar in association with the 'http://jabber.org/protocol/pubsub' namespace (a preliminary representation of those field variables is shown below and in the pubsub#node_config FORM_TYPE section of this document, but MUST NOT be construed as canonical, since the XMPP Registrar may standardize additional fields at a later date without changes to this document). An implementation MAY choose to specify different labels, values, and even field types, but MUST conform to the defined variable naming scheme.

http://jabber.org/protocol/pubsub#node_config true true 0 false false 1 10 1 open publishers 1028 never 0 http://www.w3.org/2005/Atom ]]>

There are several reasons why the node configuration request might fail:

  1. The service does not support node configuration.
  2. The requesting entity does not have sufficient privileges to configure the node.
  3. The request did not specify a node.
  4. The node has no configuration options.
  5. The specified node does not exist.

These error cases are described more fully in the following sections.

If the service does not support node configuration, the service MUST return a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "config-node".

]]>

If the requesting entity does not have sufficient privileges to configure the node, the service MUST respond with a &forbidden; error.

]]>

If the request did not specify a node, the service SHOULD return a &badrequest; error. It is possible that by not including a NodeID, the requesting entity is asking to configure the root node; however, if the requesting entity is not a service-level admin, it makes sense to return &badrequest; instead of &forbidden;.

]]>

If no configuration options are available (e.g., because node configuration is "locked down"), the service MUST return a ¬allowed; error to the owner.

]]>

If the node does not exist, the service MUST return an ¬found; error.

]]>

After receiving the configuration form, the owner SHOULD submit a completed configuration form.

http://jabber.org/protocol/pubsub#node_config Princely Musings (Atom) 1 1 1 10 open publishers never false 0 0 0 1028 http://www.w3.org/2005/Atom http://jabxslt.jabberstudio.org/atom_body.xslt ]]>

Alternatively, the owner MAY cancel the configuration process, in which case the existing configuration MUST be applied.

]]>

If the form can be successfully processed, the service MUST return an IQ-result.

]]>

If the requested node configuration change cannot be processed (e.g., because the node owner has attempted to change the configuration so that there are no node owners), the service MUST return a ¬acceptable; error to the owner.

]]>

If the "pubsub#notify_config" option is set to true, the service MUST send a notification of configuration change to all subscribers. (A service SHOULD support this option for leaf nodes and MUST support it for Collection Nodes.) If the node configuration is set to event notifications only, the notification MUST consist of an empty <configuration/> element whose 'node' attribute is set to the NodeID of the node; if the node configuration is set to full payloads, the <configuration/> element MUST in addition contain the node configuration as represented via the Data Forms protocol.

]]> http://jabber.org/protocol/pubsub#node_config Princely Musings (Atom) 1 1 0 0 0 1 10 1 open publishers 9216 never 0 http://www.w3.org/2005/Atom http://jabxslt.jabberstudio.org/atom_body.xslt ]]>

An entity way want to request information about the default node configuration, e.g. in order to determine whether to perform create-and-configure as previously described. Support for this feature is OPTIONAL.

To get the options, the entity MUST send an empty <default/> element to the service with no NodeID; in response, the service SHOULD return the default node options.

]]>

If no error occurs, the service MUST return the default configuration options.

http://jabber.org/protocol/pubsub#node_config true 1 0 0 0 1 10 1 open publishers 9216 never 0 ]]>

There are several reasons why the default node configuration options request might fail:

  1. The service does not support node configuration.
  2. The service does not support retrieval of default node configuration.

These error cases are described more fully in the following sections.

If the service does not support node configuration, it MUST return a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "config-node".

]]>

If the service does not support retrieval of default node configuration options, it MUST return a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "retrieve-default".

]]>

The default configuration options may be different for a collection node vs. a leaf node. In order to specifically request the default configuration options for collection nodes, an entity MUST include a Data Form with a 'pubsub#node_type' field whose value is "collection" in the request (since the default value for the 'pubsub#node_type' field is "leaf").

http://jabber.org/protocol/pubsub#node_config collection ]]>

If the service does not support collection nodes, it MUST return a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "collections".

http://jabber.org/protocol/pubsub#node_config collection ]]>

If a service supports node creation, it MUST support node deletion. If an implementation persists items, it MUST remove all items from persistent storage before the node itself is deleted.

In order to delete a node, a node owner MUST send a node deletion request, consisting of a <delete/> element whose 'node' attribute specifies the NodeID of the node to be deleted.

]]>

If no error occurs, the service MUST inform the owner of success.

]]>

In addition, the service MUST also send notification of node deletion to all subscribers (which SHOULD include pending and unconfigured subscriptions).

]]>

If the deleted node is a Collection Node, the implementation MAY associate the "orphaned" leaf nodes with the root collection node or associate them with no collection node.

There are several reasons why the node deletion request might fail:

  1. The requesting entity does not have sufficient privileges to delete the node.
  2. The node is the root collection node, which cannot be deleted.
  3. The specified node does not exist.

These error cases are described more fully in the following sections.

If the requesting entity does not have sufficient privileges to delete the node (e.g., is not an owner), the service MUST return a &forbidden; error.

]]>

If the requesting entity attempts to delete the root collection node, the service MUST return a ¬allowed; error.

]]>

If the requesting entity attempts to delete a node that does not exist, the service MUST return an ¬found; error.

]]>

If a service persists published items, a node owner may want to purge the node of all published items (thus removing all items from the persistent store, with the exception of the last published item, which MAY be cached). It is OPTIONAL for a service to implement this feature.

In order to purge a node of all items, a node owner sends a node purge request consisting of a <purge/> element whose 'node' attribute specifies the NodeID of the node to be purged.

]]>

If no error occurs, the service MUST purge the node and inform the owner of success.

]]>

If the node or service has been configured to notify subscribers on deletion of items, a purge request MUST NOT result in sending the same notifications as are sent when deleting items (since purging a node with many persisted items could result in a large number of notifications); instead, the node MUST send a single notification to each subscriber, containing an empty <purge/> child element.

]]>

There are several reasons why the node purge request might fail:

  1. The node or service does not support node purging.
  2. The requesting entity does not have sufficient privileges to purge the node.
  3. The node is not configured to persist items.
  4. The specified node does not exist.

These error cases are described more fully in the following sections.

If the node or service does not support node purging, it MUST return a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "purge-nodes".

]]>

If the requesting entity does not have sufficient privileges to purge the node (e.g., because it is not a node owner), the service MUST return a &forbidden; error.

]]>

If the service or node does not persist items (e.g., because the node is a collection node), it MUST return a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "persistent-items".

]]>

If the node does not exist, the service MUST return an ¬found; error.

]]>

A service MAY send subscription approval requests to the node owner(s) at any time. An approval request consists of a message stanza containing a Data Form scoped by the "http://jabber.org/protocol/pubsub#subscribe_authorization" FORM_TYPE. The form MUST contain a boolean field that has a 'var' attribute of "pubsub#allow", which is the field that designates whether or not to allow the subscription request. The form SHOULD include fields that specify the node identifier, the subscription id (if applicable), and the JID of the pending subscriber. The message MAY include a &BODY; element that contains natural-language text explaining that the message contains a pending subscription form.

PubSub subscriber request To approve this entity's subscription request, click the OK button. To deny the request, click the cancel button. http://jabber.org/protocol/pubsub#subscribe_authorization 123-abc princely_musings horatio@denmark.lit false ]]>

In order to approve the request, the owner shall submit the form and set the "pubsub#allow" field to a value of "1" or "true"; for tracking purposes the message MUST reflect the 'id' attribute originally provided.

http://jabber.org/protocol/pubsub#subscribe_authorization 123-abc princely_musings horatio@denmark.lit true ]]>

The service then SHOULD send notification to the approved subscriber (see the Notification of Subscription State Changes section of this document).

]]>

In order to deny the request, the owner shall submit the form and set the "pubsub#allow" field to a value of "0" or "false"; as above, the message MUST reflect the 'id' attribute originally provided.

http://jabber.org/protocol/pubsub#subscribe_authorization 123-abc princely_musings horatio@denmark.lit false ]]>

The service then SHOULD send notification to the denied subscriber (see the Notification of Subscription State Changes section of this document).

]]>

In order to cancel the form submission, the owner shall reply with the form's 'type' attribute set to "cancel".

http://jabber.org/protocol/pubsub#subscribe_authorization ]]>

The service MUST check the "pubsub#allow" field to see if the subscription should be allowed or denied. If the owner cancels the Data Form, then the subscription request MUST remain in the pending state.

A node owner may want to request all of the pending subscription requests for all of their nodes at a service. It is OPTIONAL for a service to implement this feature.

This feature MUST be implemented using the &xep0050; protocol, where the command name ('node' attribute of the command element) MUST have a value of "http://jabber.org/protocol/pubsub#get-pending".

]]>

If no error occurs, the service SHOULD return a data form for managing subscription requests, which MUST contain a single field with a 'var' attribute value of "node" whose <option/> elements specify the nodes for which the requesting entity has subscription approval privileges (as an optimization, the service MAY specify only the nodes that have subscription requests pending).

]]>

There are several reasons why the pending subscription approval request might fail:

  1. The service does not support the ad-hoc commands protocol.
  2. The service supports ad-hoc commands but does not support the "get-pending" feature.
  3. The requesting entity does not have sufficient privileges to approve subscription requests.
  4. The specified node does not exist.

These error cases are described more fully in the following sections.

If the service does not support the ad-hoc commands protocol, it MUST respond with a &unavailable; error.

]]>

If the service does not support the "get-pending" feature, it MUST respond with a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "get-pending".

]]>

If the requesting entity does not have sufficient privileges to approve subscription requests, the service MUST respond with a &forbidden; error.

]]>

If the requested node does not exist, the service MUST respond with an ¬found; error.

]]>

Upon receiving the data form for managing subscription requests, the owner then MAY request pending subscription approval requests for a given node.

princely_musings ]]>

If no error occurs, the service shall respond with success.

]]>

The service shall then send one subscription approval message for each pending subscription request, as shown above for a single pending subscription request.

Note: A service SHOULD conform to its affiliation policies in maintaining the list of pending subscriptions. In particular, if the affiliation of an entity with a pending subscription is modified to owner or publisher, the service SHOULD automatically approve the subscription request and remove the entity's previous request from the pending list. Similarly, if the affiliation of an entity with a pending subscription is modified to outcast, the service SHOULD automatically reject the subscription request and remove the entity's previous request from the pending list. (If an entity's subscription request is denied, the service SHOULD send a &MESSAGE; to the entity, where the message conforms to the format described in the Notification of Subscription Denial or Cancellation section of this document.)

A node owner may want to edit the list of subscriptions associated with a given node. Support for this feature ("pubsub#manage-subscriptions") is OPTIONAL.

Note: This feature enables a node owner to set subscriptions for new entities; for nodes of type "whitelist", this enables the node owner to add subscribers.

In order to request a list of all subscriptions, a node owner MUST send a subscriptions request, consisting of a <subscriptions/> element whose 'node' attribute specifies the NodeID of the relevant node.

]]>

If no error occurs, the service MUST return the list of subscriptions for entities whose subscription state is "subscribed" or "unconfigured" (it MUST NOT return entities whose subscription state is "none" and SHOULD NOT return entities whose subscription state is "pending"). The result MAY specify multiple <subscription/> elements for the same entity (JID), but each element MUST possess a distinct value of the 'subid' attribute (as shown below).

]]>

There are several reasons why the manage subscriptions request might fail:

  1. The service does not support subscription management.
  2. The requesting entity does not have sufficient privileges to manage subscriptions.
  3. The specified node does not exist.

These error cases are described more fully in the following sections.

If an implementation does not support subscription management, it MUST return a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "manage-subscriptions".

]]>

If the requesting entity is not a node owner, the service MUST return a &forbidden; error.

]]>

If the node does not exist, the service MUST return an ¬found; error.

]]>

Upon receiving the subscriptions list, the node owner MAY modify subscription states. The owner MUST send only modified subscription states (i.e., a "delta"), not the complete list. (Note: If the 'subscription' attribute is not specified in a modification request, then the value MUST NOT be changed.)

]]> ]]>

In order to remove an entity from the subscriptions list, the owner MUST set the value of the 'subscription' attribute to "none" and the service MUST remove that entity from the subscriptions list and not return it in response to future list requests.

The owner MAY change multiple subscriptions in a single request. If one of the entity elements specified is invalid, the service MUST return an IQ error (which SHOULD be ¬acceptable;) with the invalid entries, where the subscription returned is the original, un-altered subscription.

]]> ]]>

If errors occur during a modification request for multiple entities, the pubsub service MUST return any <subscription/> element(s) which caused the error. Returned entities which failed to be modified MUST include the existing 'subscription' attribute. Any entity elements which are not returned in an IQ error case MUST be treated as successful modifications. The owner MAY specify multiple <subscription/> elements for the same entity, but each element MUST possess a distinct value of the 'subid' attribute.

An implementation SHOULD send notification to an entity whose subscription has changed (see the Notification of Subscription State Changes section of this document).

]]>

A node owner may want to edit the affiliations of entities associated with a given node and to set affiliations for new entities. Support for this feature ("pubsub#modify-affiliations") is OPTIONAL.

In order to request a list of all affiliated entities, a node owner MUST send an affiliations request, consisting of an <affiliations/> element whose 'node' attribute specifies the NodeID of the relevant node.

]]>

If no error occurs, the service MUST return the list of entities whose affiliation is "owner", "publisher", or "outcast" (it MUST NOT return entities whose affiliation is "none").

]]>

There are several reasons why the affiliated entities request might fail:

  1. The service does not support modification of affiliations.
  2. The requesting entity does not have sufficient privileges to modify affiliations.
  3. The specified node does not exist.

These error cases are described more fully in the following sections.

If an implementation does not support modification of affiliations, it MUST return a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "modify-affiliations".

]]>

If the requesting entity is not a node owner, the service MUST return a &forbidden; error.

]]>

If the node does not exist, the service MUST return an ¬found; error.

]]>

Upon receiving the affiliations list, the node owner MAY modify affiliations. The owner MUST send only modified affiliations (i.e., a "delta"), not the complete list. (Note: If the 'affiliation' attribute is not specified in a modification request, then the value MUST NOT be changed.)

]]> ]]>

In order to remove an entity from the affiliations list, the owner MUST set the value of the 'affiliation' attribute to "none" and the service MUST remove that entity from the affiliations list and not return it in response to future list requests.

The owner MAY change multiple affiliations in a single request. If one of the entity elements specified is invalid, the service MUST return an IQ error (which SHOULD be ¬acceptable;) with the invalid entries, where the affiliation returned is the original, un-altered affiliation.

The following example shows an entity attempting to make the owner something other than an affiliation of "owner", an action which MUST NOT be allowed if there is only one owner.

]]> ]]>

The state chart at the beginning of this document is a MUST-IMPLEMENT set of rules for checking possible state transitions. Implementations MAY enforce other (more strict) rules. If errors occur during a modification request for multiple entities, the pubsub service MUST return any <affiliation/> element(s) which caused the error. Returned entities which failed to be modified MUST include the existing 'affiliation' attribute. Any entity elements which are not returned in an IQ error case MUST be treated as successful modifications. The owner MUST NOT specify multiple <affiliation/> elements for the same entity; otherwise the service MUST return a &badrequest; error.

An implementation MAY send a message to an entity whose affiliation has changed, which MAY contain a &BODY; element specifying natural-language text regarding the affiliation change and which SHOULD contain the modified affiliation data.

]]>

A pubsub service MAY support collection nodes as well as leaf nodes. Collections enable nodes to be grouped together in any way, including hierarchies and directed acyclic graphs. Collections MUST contain only leaf nodes and/or other collections. Collections MUST NOT contain published items, since only leaf nodes are allowed to contain items (therefore a collection MUST NOT support the "publish" feature or related features such as "persistent-items"). If collections are supported, a service MUST advertise that fact in its "disco#info" responses by including a feature of "pubsub#collections" and MUST support service discovery of child nodes as described in the Discover Nodes section of this document.

A service that implements collection nodes SHOULD allow entities to subscribe to collection nodes (subject to access models and local security policies).

In addition to the subscription configuration options already defined, there are two subscription configuration options specific to collection nodes:

  • pubsub#subscription_type

    This subscription option enables the subscriber to subscribe either to items or to nodes.

    If the subscription type is "items", the subscriber shall be notified whenever any node contained in the collection generates a notification (e.g., when an item is published or deleted), as modified by the value of the "pubsub#subscription_depth" option.

    If the subscription type is "nodes", the subscriber shall be notified whenever a new node is added to the collection, as modified by the value of the "pubsub#subscription_depth" option.

    The default value of this subscription option MUST be "nodes".

  • pubsub#subscription_depth

    This subscription option enables the subscriber to specify whether it wants to receive notifications only from first-level children of the collection (a value of "1") or from all descendents (a value of "all").

    For subscriptions of type "items", this enables the subscriber to be informed only when an item is published to a leaf node that is a direct child of the collection node to which it has subscribed, or to be informed whenever an item is published to any leaf node in the "tree" that begins at the level of the collection to which it has subscribed.

    For subscriptions of type "nodes", this enables the subscriber to be informed only when a new node is added in the specific collection to which it has subscribed, or to be informed whenever a node is added anywhere in the "tree" that begins at the level of the collection to which it has subscribed.

    The default value of this subscription option MUST be "1".

In order to subscribe to a collection node, an entity MUST send a subscription request to the node; the subscription request MAY include subscription options, but this is not strictly necessary (especially if the entity does not wish to override the default settings for the "pubsub#subscription_type" and "pubsub#subscription_depth" options).

]]>

The subscriber will now receive notification of new first-level nodes created within the "blogs" collection.

http://jabber.org/protocol/pubsub#subscribe_options items all ]]>

The subscriber will now receive item notifications from nodes at any depth within the "blogs" collection.

Depending on the nature of the node "tree", a subscription type of "items" and depth of "all" may result in an extremely large number of notifications. Therefore, a service MAY disallow such a combination of subscription options, in which case it MUST return a ¬allowed; error to the requesting entity.

A service MAY allow an entity to subscribe to a collection node in two ways, once with a subscription of type "nodes" (to receive notification of any new nodes added to the collection or the entire tree) and once with a subscription of type "items" (to receive all items published within the tree). However, a service SHOULD NOT allow an entity to subscribe twice to a collection node (once with a subscription depth of "1" and once with a subscription depth of "all") for the same subscription type, since two such subscriptions are unnecessary (a depth of "all" includes by definition a depth of "1"); in this case the service SHOULD return a &conflict; error to the requesting entity.

A service that implements collections SHOULD support a root collection. The root collection shall be identified by the lack of a node identifier (i.e., the address of the pubsub service itself, such as "pubsub.shakespeare.lit").

Subscribing to this node with a subscription of type "nodes" and a depth of "1" enables an entity to be notified whenever a new first-level node is created at the pubsub service. Subscribing to this node with a subscription of type "nodes" and a depth of "all" enables an entity to be notified whenever a new node is created anywhere at the pubsub service.

]]>

In order to send notification of new nodes, the service shall send an event that contains a <collection/> element that in turns contains a <node/> element whose 'id' attribute specifies the NodeID of the new node.

]]>

The notification event MAY also include the node meta-data, formatted using the Data Forms protocol.

http://jabber.org/protocol/pubsub#meta-data 2003-07-29T22:56Z hamlet@denmark.lit Atom feed for my blog. en bard@shakespeare.lit hamlet@denmark.lit Princely Musings (Atom). http://www.w3.org/2005/Atom ]]>

To create a new collection node, the requesting entity MUST include a Data Form containing a 'pubsub#node_type' field whose <value/> is "collection".

http://jabber.org/protocol/pubsub#node_config collection ]]> ]]>

In addition to the errors already defined for leaf node creation, there are several reasons why the collection node creation request might fail:

  1. The service does not support collection nodes.
  2. The service does not support creation of collection nodes.
  3. The requesting entity does not have sufficient privileges to create collection nodes.

These error cases are described more fully in the following sections.

If the service does not support collection nodes, it MUST respond with a &feature; error, specifying a pubsub-specific error condition of <unsupported/> and a feature of "collections".

]]>

If the service supports collection nodes but does not allow new collection nodes to be created, it MUST respond with a ¬allowed; error.

]]>

If the requesting entity has insufficient privileges to create new collections, the service MUST respond with a &forbidden; error.

]]>

A service MAY offer some node configuration options that are specific to collection nodes and not provided in configuration forms related to leaf nodes. The following are RECOMMENDED:

  • pubsub#children_association_policy -- the policy regarding who may associate child nodes with the collection (values: all, owner, whitelist).
  • pubsub#children_association_whitelist -- the whitelist of entities that may associate child nodes with the collection.
  • pubsub#children_max -- the maximum number of child nodes that may be associated with a collection.

To create a new node and associate it with an existing collection, the node configuration protocol MUST be used in the node creation request (see the Create and Configure a Node section of this document). In order to specify the associated collection(s), the form MUST include a 'pubsub#collection' field.

Note: Inclusion of the node configuration form is not necessary if the node is being created as a first-level child of the root collection node, since every such child is automatically affiliated with the root collection node (if any).

Note: For the protocol used to associate an existing node with a collection, refer to the Associate an Existing Node with a Collection section of this document.

announcements ]]>

Note: If the node is a collection node and the requesting entity wishes to request the default configuration, the requesting entity MUST include only the "pubsub#collection" and "pubsub#node_type" fields in the configuration form.

If no error occurs, the service MUST create the node and associate it with the collection.

There are several reasons why the request might fail:

  1. The request specified more than one collection node, but the service allows a node to be associated with only one collection node.
  2. The requesting entity does not have sufficient privileges to associate a node with the specified collection node.
  3. No additional nodes can be associated with the collection node.
  4. The specified collection node is actually a leaf node.
  5. The specified collection node does not exist.

These error cases are described more fully in the following sections.

An implementation MAY allow a node to be associated with more than one collection node and therefore MAY specify a type of "text-multi" for the "pubsub#collection" field. However, in order to reduce the complexity of implementation, it is RECOMMENDED to allow only one parent collection node for each node and therefore it is RECOMMENDED to specify a type of "text-single" for the "pubsub#collection" field. If a service supports associating a node with multiple collections, it MUST advertise support for the "multi-collection" feature (if that feature is not advertised, entities SHOULD assume that the service allows a node to be associated with only one collection). If the request specifies more than one collection node but the service allows a node to be associated with only one collection node, the service MUST return a &badrequest; error.

announcements news collection ]]>

If the requesting entity does not have sufficient privileges to associate a node with the specified collection node, the service MUST return a &forbidden; error.

announcements ]]>

If no additional nodes can be associated with the collection node because a configurable limit of associated nodes has been reached, the service MUST return a &conflict; error, which SHOULD also include a pubsub-specific error condition of <max-nodes-exceeded/>.

announcements ]]>

If the specified collection node is actually a leaf node, the service MUST return an ¬allowed; error.

announcements ]]>

If the specified collection node does not exist, the service MUST return an ¬found; error.

announcements ]]>

Although a node can be associated with a collection when it is created (as described above), it can also be associated with a collection after it has been created. This can be done in two ways:

  • By modifying the node's "pubsub#collection" configuration field.
  • By modifying the collection node's "pubsub#children" configuration field.

These methods are described below.

In order to modify the (child) node's "pubsub#collection" configuration field, the owner of the node shall submit a request to edit the node's configuration, receive a configuration form from the service, and then submit a modified configuration form:

http://jabber.org/protocol/pubsub#node_config ... blogs ... ]]>

In order to modify the (parent) node's "pubsub#children" configuration field, the owner of the node shall submit a request to edit the node's configuration, receive a configuration form from the service, and then submit a modified configuration form:

http://jabber.org/protocol/pubsub#node_config ... princely_musings kingly_ravings starcrossed_stories moorish_meanderings ... ]]>

A node can be disassociated from a collection after it has been associated (whether at creation time or afterward). This can be done in two ways:

  • By modifying the node's "pubsub#collection" configuration field.
  • By modifying the collection node's "pubsub#children" configuration field.

These methods are described below.

In order to modify the (child) node's "pubsub#collection" configuration field, the owner of the node shall submit a request to edit the node's configuration, receive a configuration form from the service, and then submit a modified configuration form:

http://jabber.org/protocol/pubsub#node_config ... ... ]]>

Note: To disassociate the node from all collection nodes, the node owner MUST submit an empty <value/> element within the 'pubsub#collection' field as shown in the foregoing example.

In order to modify the (parent) node's "pubsub#children" configuration field, the owner of the node shall submit a request to edit the node's configuration, receive a configuration form from the service, and then submit a modified configuration form:

http://jabber.org/protocol/pubsub#node_config ... kingly_ravings starcrossed_stories moorish_meanderings ... ]]>

If a node is disassociated from a collection node and a new association is not formed, the implementation MAY associate the node with the root collection node or associate it with no collection node.

Note: The combination of associating and disassociating a node with a collection can be used to move a node from one collection to another.

If an item is published to a node which is also included by a collection, and an entity is subscribed to that collection with a subscription type of "items", then the notifications generated by the service MUST contain additional information. The &ITEMS; element contained in the notification message MUST specify the node identifier of the node that generated the notification (not the collection) and the &ITEM; element MUST contain a SHIM header that specifies the node identifier of the collection.

...
blogs
...
blogs
. . . ]]>

Publish-subscribe functionality can be integrated into existing instant messaging and presence services (see RFC 3921), such that each registered account functions as a virtual pubsub service (sometimes called "pubsub-on-a-JID"). In such deployments, the root pubsub node for each virtual pubsub service has the same address as the bare JID (&BAREJID;) of the account, which is typically associated with an IM user (e.g., <hamlet@denmark.lit>). Since an IM user typically has a roster of "buddies" and shares presence information with those buddies, the virtual pubsub service can use roster and presence information to provide some helpful shortcuts for subscribers, in particular the auto-subscribe and filtered-notifications features described in this section.

When a contact is affiliated with the account owner through sharing of XMPP presence, the "auto-subscribe" feature greatly simplifies the subscription process. In particular, support for the "auto-subscribe" has the following implications:

Because the account owner itself is implicitly subscribed to its own XMPP presence (e.g., each XMPP resource receives presence information from all of the account owner's resources), a service MUST consider the account owner to have a pubsub subscription to the account owner's root collection node with a subscription_type of "items" and a subscription_depth of "all". This is true for all access models.

If an entity (i.e., an IM contact) has an XMPP presence subscription to the account owner's bare JID (&BAREJID;), a service MUST consider the contact to have a pubsub subscription to the account owner's root collection node with a subscription_type of "items" and a subscription_depth of "all" if:

  1. The node has an access model of "open".
  2. The node has an access model of "presence".
  3. The node has an access model of "roster" and the contact is in the specified roster group.

Note: When an IM contact has a subscription to the account owner's presence, the automated pubsub subscription MUST be based on the JID contained in the 'from' address of the presence subscription request, which for an IM contact will be a bare JID (&BAREJID;).

If the node has an open access model, the pubsub service SHOULD also consider an entity to be (temporarily) subscribed to the node if the entity sends presence to the account owner in the absence of a presence subscription. In this case, the subscription SHOULD be based on the 'from' address of the presence stanza, which will be a full JID (&FULLJID;). When the service receives unavailable presence from the full JID, it MUST consider cancel the (temporary) subscription.

A contact may not want to receive notifications for all payload types. A contact SHOULD signal its preferences to the account owner's server by including XEP-0115 information that specifies the namespaces for which the contact wishes to receive notifications (if any). This information is used by a pubsub service that supports the "filtered-notifications" feature to send only those payload types that the subscriber wishes to receive.

In order to make this possible, all possible payload namespaces can be appended with the string "+notify" to indicate that the contact wishes to receive notifications for the payload format. Thus if Romeo wants to receive notifications for location data and tune data but not activity data, his client would advertise support for the following namespaces in the disco#info results it sends: Including, say, the 'http://jabber.org/protocol/geoloc' namespace indicates that the client understands the geolocation namespace, whereas including the 'http://jabber.org/protocol/geoloc+notify' namespace indicates that the client wishes to receive notifications related to geolocation.

  • http://jabber.org/protocol/geoloc+notify
  • http://jabber.org/protocol/tune+notify

This set of namespaces would then be advertised by including the namespace in the identity+features hash encapsulated via the 'ver' attribute as described in XEP-0115.

]]>

It is the responsibility of the account owner's server to cache XEP-0115 information. When the server receives presence from a contact, it MUST check that presence information for entity capabilities data and correlate that data with the desired namespaces for the contact's client. The server MUST NOT send notifications related to any data formats that the contact's client has not asked for via the relevant "namespace+notify" disco#info feature. This enables a client to turn off all notifications (e.g., because of bandwidth restrictions) and to easily receive all desired data formats simply by adding support for the appropriate "namespace+notify" combination in its disco#info results and client capabililies. However, it also implies that a client can request notifications only on a global basis and cannot request, say, mood information only from certain contacts in the user's roster. Community consensus is that this is an acceptable tradeoff. Also, note that this works only if the account owner has a presence subscription to the contact and the contact has a presence subscription to the account owner.

Some examples may help to illustrate the concept of notification filtering. Here we show presence generated by two of the contacts listed above (benvolio@montague.lit does not have any presence subscriptions to or from juliet@capulet.lit and therefore is not involved in these protocol flows).

]]>

We assume that Juliet's server doesn't know anything about these capabilities, so it sends service discovery information requests to each of the clients on Juliet's behalf (realistically, the capulet.lit server will quickly build up a cache of client capabilities, with the result that it will not need to send these service discovery requests):

]]>

The server shall also query the identity+features for <romeo@montague.lit>:

]]>

(As noted in XEP-0115, the server MUST check the hash provided in the 'ver' attribute against the generation method to ensure that no poisoning has occurred.)

Now we revisit account owner publication and server generation of notifications, with filtering enabled because the server has caps information:

  • If Juliet publishes a tune item to the presence-access "http://jabber.org/protocol/tune" node, her server will send notifications to <nurse@capulet.lit/chamber> and <romeo@montague.lit/orchard> (full JIDs).

  • If Juliet publishes an activity item to the presence-access "http://jabber.org/protocol/activity" node, her server will send notifications only to <nurse@capulet.lit/chamber>.

  • If Juliet publishes a geolocation item to the roster-access "http://jabber.org/protocol/geoloc" node, her server will send notifications only to <romeo@montague.lit/orchard>.

This section summarizes the features described herein, specifies the appropriate requirements level for each feature (REQUIRED, RECOMMENDED, or OPTIONAL), and provides cross-references to the section of this document in which each feature is described.

Note: The feature names are all of the form "http://jabber.org/protocol/pubsub#name", where "name" is the text specified in the first column below.

Name Description Support Section
access-authorize The default access model is "authorize". OPTIONAL Nodes Access Models
access-open The default access model is "open". OPTIONAL Nodes Access Models
access-presence The default access model is "presence". OPTIONAL Nodes Access Models
access-roster The default access model is "roster". OPTIONAL Nodes Access Models
access-whitelist The default access model is "whitelist". OPTIONAL Nodes Access Models
auto-create The service supports auto-creation of nodes on publish to a non-existent node. OPTIONAL Automatic Node Creation
auto-subscribe The service supports auto-subscription to a nodes based on presence subscription. RECOMMENDED Auto-Subscribe
collections Collection nodes are supported. RECOMMENDED Collection Nodes
config-node Configuration of node options is supported. RECOMMENDED Configure a Node
create-and-configure Simultaneous creation and configuration of nodes is supported. RECOMMENDED Create and Configure a Node
create-nodes Creation of nodes is supported. RECOMMENDED Create a Node
delete-any Any publisher may delete an item (not only the originating publisher). OPTIONAL Delete an Item from a Node
delete-nodes Deletion of nodes is supported. RECOMMENDED Delete a Node
filtered-notifications Notifications are filtered based on Entity Capabilities data. RECOMMENDED Filtered Notifications
get-pending Retrieval of pending subscription approvals is supported. OPTIONAL Manage Subscription Requests
instant-nodes Creation of instant nodes is supported. RECOMMENDED Create a Node
item-ids Publishers may specify item identifiers. RECOMMENDED  
last-published By default the last published item is sent to new subscribers and on receipt of available presence from existing subscribers. RECOMMENDED Event Types
leased-subscription Time-based subscriptions are supported. OPTIONAL Time-Based Subscriptions (Leases)
manage-subscriptions Node owners may manage subscriptions. OPTIONAL Manage Subscribers
meta-data Node meta-data is supported. RECOMMENDED  
modify-affiliations Node owners may modify affiliations. OPTIONAL Manage Affiliations
multi-collection A single leaf node may be associated with multiple collections. OPTIONAL Create a Node Associated with a Collection and Associate an Existing Node with a Collection
multi-subscribe A single entity may subscribe to a node multiple times. OPTIONAL Multiple Subscriptions
outcast-affiliation The outcast affiliation is supported. RECOMMENDED Affiliations
persistent-items Persistent items are supported. RECOMMENDED  
presence-notifications Presence-based delivery of event notifications is supported. OPTIONAL  
presence-subscribe Authorized contacts are automatically subscribed to a user's virtual pubsub service. RECOMMENDED Auto-Subscribe
publish Publishing items is supported (note: not valid for collection nodes). REQUIRED Publish an Item to a Node
publish-options Publishing an item with options is supported. OPTIONAL Publishing Options
publisher-affiliation The publisher affiliation is supported. OPTIONAL  
purge-nodes Purging of nodes is supported. OPTIONAL Purge All Node Items
retract-items Item retraction is supported. OPTIONAL Delete an Item from a Node
retrieve-affiliations Retrieval of current affiliations is supported. RECOMMENDED Retrieve Affiliations
retrieve-default Retrieval of default node configuration is supported. RECOMMENDED Request Default Configuration Options
retrieve-items Item retrieval is supported. RECOMMENDED Retrieve Items from a Node
retrieve-subscriptions Retrieval of current subscriptions is supported. RECOMMENDED Retrieve Subscriptions
subscribe Subscribing and unsubscribing are supported. REQUIRED Subscribe to a Node and Unsubscribe from a Node
subscription-options Configuration of subscription options is supported. OPTIONAL Configure Subscription Options
subscription-notifications Notification of subscription state changes is supported. OPTIONAL Notification of Subscription State Changes
Condition Description
&conflict; The node already exists.
&feature; The operation being attempted on a node (or the system) has failed because the service or node does not support the operation; the error SHOULD also specify which feature is unsupported.
&forbidden; An entity does not have sufficient privileges to perform the action, is requesting an operation for another Jabber ID (e.g., francisco@denmark.lit attempts to subscribe bernardo@denmark.lit to a node), or the requesting entity has an affiliation of "outcast".
¬found; The node or item specified for some operation does not exist.
¬allowed; An entity has attempted to perform an action which the service implements; however the service-wide admin or the node owner has disabled the action for that service or node.
¬authorized; An entity has attempted to subscribe to or retrieve items from a node but is not authorized to see the account owner's presence, is not in the appropriate roster group, or is not on the whitelist for subscriptions.
&payment; Subscriptions and item retrieval are based on some kind payment service. Payments would be done out-of-band using some agreed-upon method (not defined herein).
®istration; Entities are required to register before node creation is allowed.

Note: Refer to &xep0086; for more information regarding error syntax.

When a pubsub service generates notifications, it MUST adhere to the delivery rules implicit in the subscription option configuration for each subscriber. In particular, the 'to' address SHOULD be that of the subscribed JID only. The service SHOULD NOT attempt to guess at the most available resource associated with the subscribed JID (e.g., in the context of instant messaging systems).

As noted above, a pubsub service SHOULD ensure that the &MESSAGE; stanza for each event notification it generates possesses an 'id' attribute with a unique value. (This notification ID is not to be confused with either the node ID or the item ID.) This ID MUST be unique within the context of the pubsub service in order to ensure proper tracking of any delivery-related errors.

Exactly how a service shall handle delivery-related errors is a matter of implementation. In general, such handling is effectively similar to the bounce processing performed by other message delivery systems, such as mail transfer agents and mailing list software. The following are some suggested guidelines regarding the handling of XMPP-specific error conditions in relation to pubsub event notifications (see RFC 3920 and XEP-0086 regarding XMPP error condition semantics):

  • If the XMPP error is of type "cancel" (e.g., ¬found;), or the error condition is &gone;, the pubsub service SHOULD terminate the subscription of the entity to that node and MAY terminate the subscription of that entity to all nodes hosted at the service.
  • If the XMPP error is of type "auth" (e.g., ®istration;) or "wait" (e.g., &timeout;), or the error condition is &badrequest;, &redirect;, or ¬acceptable;, the pubsub service SHOULD increment a bounce counter for that entity and MAY attempt to resend the event notification after some configurable amount of time. The service MAY terminate the subscription of the entity to that node if the bounce counter has reached some configurable limit.

Implementations of pubsub MAY deliver event notifications only when the subscriber is online. In these cases, the option may be a node configuration option as shown in the examples above. To facilitate this, the pubsub service needs to subscribe to the subscriber's presence and check the subscriber's current presence information before sending any event notifications (as described in RFC 3921). Presence subscriptions MUST be based on the subscribed JID.

Sending events to users of existing Jabber servers may force event notifications to be routed to offline storage for later delivery (as described in &xep0160;). This may not always be desirable. The possible ways of preventing this behavior include:

  • Use presence-based subscription options as described above.
  • Use delivery semantics as defined by &xep0079;.
  • Specify a message type of "headline", which in most existing server implementations will prevent offline storage.

If a service understands the semantics for a particular payload type and an entity's subscription is so configured (via the "pubsub#include_body" option), the service SHOULD include an appropriate XMPP &BODY; child element along with the payloads it sends in event notifications for a given node, where the body's XML character data summarizes or represents the information contained in the payload (this enables clients that do not understand the payload format to present the appropriate information to an end user). For example, the Atom <summary/> element (see RFC 4287) could be mapped to the XMPP &BODY; element. A service MUST NOT provide the "pubsub#include_body" subscription option for a node if it does not have a defined way to transform part or all of the payload format into a sensible message body. A node owner MAY define an XSLT for transforming the payload format into a message body, via the "pubsub#body_xslt" node configuration option.

If the service does not understand the semantics for a particular payload type, it MAY include a <body/> child whose XML character data informs the subscriber that the message contains an event notification (e.g., text such as "This message contains an event notification" would be appropriate).

NodeIDs MUST be treated as unique identifiers within the context of a particular pubsub service.

If item identifiers are used, they MUST be treated as unique within the scope of the node. The combination of the NodeID + ItemID MUST be unique within a given service, and MUST specify a single published item at a single node.

If a publisher publishes an item and the ItemID matches that of an existing item, the pubsub service MUST overwrite the existing item and generate a new event notification.

Because it is possible for a node's configuration to change such that ItemIDs are required (e.g., a change from transient to persistent), a service SHOULD use ItemIDs for internal tracking purposes even if it does not include them with the notifications it generates prior to the configuration change.

A service MAY cache the last item published to a node, even if the node is configured for transient publication (i.e., configured to not persist items). The last published item SHOULD be sent to new subscribers upon successful processing of a subscription request or approval by a node owner.

Note: If a publisher requests Batch Processing of item publications, the concept of "last published item" is undefined; therefore, if information coherence is needed, a publisher SHOULD publish items in separate requests rather than in batch mode.

Note: Particular profiles of the generic publish-subscribe protocol MAY define more stringent requirements regarding the "cache-last-item" feature.

A publisher MAY include multiple &ITEM; elements in a publish request and MAY include multiple &ITEM; elements in a retract request. This results in "batch processing" of publications or retractions. If the service cannot process any one of the items to be published or retracted, the entire batch MUST fail. Also note that batch publication renders the concept of "last published item" problematic; therefore, if information coherence is needed, a publisher SHOULD publish items in separate requests rather than in batch mode.

A service MUST allow owners and publishers to subscribe to a node, and to retrieve items from a node even if they are not subscribed. A service MAY auto-subscribe owners and publishers if they are not already subscribed, in which case it SHOULD generate a subscription ID if necessary for the subscription and SHOULD send a notification of successful subscription as described in the Notification of Subscription State Changes section of this document.

How subscription requests are sent to node owners is a matter of implementation. Possibilities include:

  • Send requests to all owners (these may be placed in offline storage as described in XEP-0160) and first approval wins.
  • The service could subscribe to owner presence, and send only to the owners that are online.
  • All owners vote on the new subscriber.
  • Any owner is allowed to veto the subscriber.

An implementation MAY use any of these methods, or some other method not defined herein.

Various actions and events may result in changes to a subscription state:

  • Approval or denial of a subscription request as described in the Manage Subscription Requests use case

  • Cancellation of an existing subscription, for which many "triggers" are possible:

    • The entity simply unsubscribes from the node
    • The node is of type "presence" and the underlying presence subscription is cancelled
    • The node is of type "roster" and the entity is moved to an unauthorized roster group

When a subscription state change occurs, a service SHOULD send a message to the (new, former, or denied) subscriber informing it of the change, where the message contains an <event/> element with a single <subscription/> child that specifies the node, JID, and subscription state. The notification MAY contain a &BODY; element specifying natural-language text regarding the subscription change. Examples are shown below.

]]> ]]>

If the service has knowledge of the (former or denied) subscriber's presence, it SHOULD send the message to all of the subscriber's resources; if not, it MUST send the message to the subscriber's affiliated JID.

If a service or node supports this feature, it MUST return a feature of "subscription-notifications" in its response to service discovery information requests.

NodeIDs MAY have semantic meaning in particular profiles, implementations, or deployments of pubsub. However, it is STRONGLY RECOMMENDED that such semantic meaning not be used to encapsulate the hierarchical structure of nodes; instead, node hierarchy SHOULD be encapsulated using collections and their associated child nodes.

A user may publish information that adheres to a certain profile at multiple pubsub nodes, and a potential subscriber may want to discover all of these pubsub nodes. The user may make a list of pubsub nodes publicly available for querying even when the user is offline by using the Service Discovery mechanism for "publishing" items (see Section 4 of XEP-0030). The potential subscriber may then send a "disco#items" request to the user's bare JID (<user@host>), including the 'node' attribute set to the value of the namespace to which the desired information adheres. The user's server then returns a list of pubsub nodes that meet that criterion (with each pubsub node being a separate Service Discovery item). Here is an example.

]]>

Alternatively, a user may be registered with a server that offers personal eventing services, in which case the user will have one node per namespace as described in XEP-0163.

When SubIDs are used, Stanza Headers and Internet Metadata (SHIM) headers are to be included in order to differentiate notifications sent regarding a particular subscription. The relevant use cases and scenarios are:

  • Sending notifications regarding newly-published items as described in the Publish an Item to a Node use case.
  • Sending notifications regarding deleted items as described in the Delete an Item from a Node use case.

The SHIM headers are generated by the node to which the subscriber has a subscription, which may be either a leaf node or a collection node.

SHIM headers are not to be included when the content does not differ based on subscription ID, e.g., when a node sends notification of a configuration change to the node itself, notification that the node has been purged, or notification that the node has been deleted.

An implementation MAY enable the node configuration to specify an association between the event notification and the entity to which the published information pertains, but such a feature is OPTIONAL. Here are some possible examples:

  • In the context of a geolocation notification service using &xep0080;, the user may generate the geolocation information or the information may be generated by an automated service (e.g., a service offered by a mobile telephony provider), but in either case the information is about the user's geolocation and therefore all replies should go to the user (who is probably the node owner).
  • In the context of a group weblog, different users might publish to the weblog and replies might go to the publisher of an entry rather than to the weblog owner.
  • In the context of an integrated pubsub and multi-user chat system, the node owner might be the room owner but all replies need to be sent to the room rather than to the owner.

Therefore we define three node configuration options:

  • pubsub#itemreply -- the per-item policy for replies (the value is "owner" or "publisher").
  • pubsub#replyto -- the specific user JID(s) to which replies should be sent.
  • pubsub#replyroom -- the multi-user chat room to which replies should be sent.

A node owner MUST NOT define more than one of these options.

An example is shown below.

Venice 45.44 12.33
]]>

Alternatively, if a service implements the personal eventing subset of this protocol, the virtual pubsub service is the account owner's bare JID and notifications are sent from that JID; for details, refer to XEP-0163.

The word "chaining" refers to the practice of subscribing one node to another node. For instance, consider a scenario in which the node <pubsub@example.net/NewsBroadcaster> wants to distribute information received from the node "NewsFeed" at <pubsub.example.com>. While it is theoretically possible for <pubsub@example.net/NewsBroadcaster> to directly subscribe to the NewsFeed node (since the former node is directly addressable as a JID), implementations MUST NOT chain nodes in this fashion. Instead, implementations MUST subscribe from the address of the pubsub service rather than the node (in the example shown here, the subscription would be sent from <pubsub@example.net> rather than <pubsub@example.net/NewsBroadcaster>).

In some systems it may be desirable to provide a subscription "leasing" feature in order to expire old or stale subscriptions. Leases can be implemented using configurable subscription options; specifically, when an entity subscribes, the service would require configuration of subscription options and the configuration form would contain a field of "pubsub#expire". This field MUST contain a dateTime (as specified in &xep0082;).

The leasing process is shown below.

http://jabber.org/protocol/pubsub#subscribe_options ... ... http://jabber.org/protocol/pubsub#subscribe_options ... 2006-02-28T11:59Z ... ]]>

The service MAY send a message to the subscriber when the lease is almost over (e.g., 24 hours before the end of the lease term). This SHOULD be done by sending a &MESSAGE; containing an empty pubsub <event/> element and a SHIM header named "pubsub#expire".

2006-02-28T23:59Z
]]>

When the subscriber wants to renew the lease, it would get the current subscription options, change the value of the "pubsub#expire" field, and submit the new subscription options back to the service. If the new expire value exceeds the maximum value allowed for subscription leases, the service MUST change the value of the field to be the current date/time plus the maximum allowed lease period.

http://jabber.org/protocol/pubsub#subscribe_options ... ... http://jabber.org/protocol/pubsub#subscribe_options ... 2006-03-31T23:59Z ... ]]>

A service MAY enable entities to subscribe to nodes and apply a filter to notifications (e.g., keyword matching such as "send me all news entries from Slashdot that match the term 'Jabber'"). Such a content-based service SHOULD allow an entity to subscribe more than once to the same node and, if so, MUST use subscription identifiers (SubIDs) to distinguish between multiple subscriptions. In order to prevent collisions, a service that supports content-based subscriptions using SubIDs SHOULD generate SubIDs on behalf of subscribers rather than allowing subscribers to set their own SubIDs. Another way to implement content-based subscriptions is to host one node per keyword or other filter; however, this is likely to require an extremely large number of nodes.

Content-based services SHOULD use subscription options to specify the filter(s) to be applied. Because there many possible filtering mechanisms (many of which may be application-specific), this document does not define any such method. However, filtering mechanisms may be defined in separate specifications.

A fictional example of the subscription options configuration process for content-based pubsub is shown below.

http://jabber.org/protocol/pubsub#subscribe_options ... ... http://jabber.org/protocol/pubsub#subscribe_options ... peasant ... ]]>

The subscriber will then be notified about events that match the keyword.

Alone Now I am alone. O, what a rogue and peasant slave am I! tag:denmark.lit,2003:entry-32396 2003-12-13T11:09:53Z 2003-12-13T11:09:53Z
991d7fd1616fd041015064133cd097a10030819e
]]>

The Data Forms shown in this specification include English-language labels for various fields; implementations that will display such forms to human users SHOULD provide localized label text for fields that are defined for the registered FORM_TYPEs.

Because the data published to a pubsub node may contain sensitive information (e.g., a user's geolocation), node owners SHOULD exercise care in approving subscription requests. Security considerations regarding particular kinds of information are the responsbility of the using protocol.

A service MUST NOT allow non-owners or other unauthorized entities to complete any actions defined under the Owner Use Cases section of this document.

A service MUST adhere to the defined access model in determining whether to send event notifications or payloads to an entity, or allow an entity to retrieve items from a node. A service MAY enforce additional privacy and security policies when determining whether an entity is allowed to subscribe to a node or retrieve items from a node; however, any such policies shall be considered specific to an implementation or deployment and are out of scope for this document.

This document does not require interaction with &IANA;.

The ®ISTRAR; includes the following namespaces in its registry of protocol namespaces (see &NAMESPACES;):

  • http://jabber.org/protocol/pubsub
  • http://jabber.org/protocol/pubsub#errors
  • http://jabber.org/protocol/pubsub#event
  • http://jabber.org/protocol/pubsub#owner

The XMPP Registrar includes a category of "pubsub" in its registry of Service Discovery identities (see &DISCOCATEGORIES;), as well as three specific types within that category:

collection A pubsub node of the "collection" type.
leaf A pubsub node of the "leaf" type.
service A pubsub service that supports the functionality defined in XEP-0060. Prior to version 1.5 of XEP-0060, this type was called "generic".

The registry submission is as follows:

pubsub Services and nodes that adhere to XEP-0060. collection A pubsub node of the "collection" type. XEP-0060 leaf A pubsub node of the "leaf" type. XEP-0060 service A pubsub service that supports the functionality defined in XEP-0060. XEP-0060 ]]>

Future submissions to the XMPP Registrar may register additional types.

The XMPP Registrar maintains a registry of service discovery features (see &DISCOFEATURES;), which includes a number of features that may be returned by pubsub services. The following registry submission has been provided to the XMPP Registrar for that purpose.

http://jabber.org/protocol/pubsub#auto-create The service supports automatic creation of nodes on first publish. XEP-0163 http://jabber.org/protocol/pubsub#auto-subscribe The service supports automatic subscription to a nodes based on presence subscription. XEP-0163 http://jabber.org/protocol/pubsub#collections Collection nodes are supported. XEP-0060 http://jabber.org/protocol/pubsub#config-node Configuration of node options is supported. XEP-0060 http://jabber.org/protocol/pubsub#create-and-configure Simultaneous creation and configuration of nodes is supported. XEP-0060 http://jabber.org/protocol/pubsub#create-nodes Creation of nodes is supported. XEP-0060 http://jabber.org/protocol/pubsub#delete-any Any publisher may delete an item (not only the originating publisher). XEP-0060 http://jabber.org/protocol/pubsub#delete-nodes Deletion of nodes is supported. XEP-0060 http://jabber.org/protocol/pubsub#filtered-notifications The service supports filtering of notifications based on Entity Capabilities. XEP-0163 http://jabber.org/protocol/pubsub#get-pending Retrieval of pending subscription approvals is supported. XEP-0060 http://jabber.org/protocol/pubsub#instant-nodes Creation of instant nodes is supported. XEP-0060 http://jabber.org/protocol/pubsub#item-ids Publishers may specify item identifiers. XEP-0060 http://jabber.org/protocol/pubsub#last-published The service supports sending of the last published item to new subscribers and to newly available resources. XEP-0163 http://jabber.org/protocol/pubsub#leased-subscription Time-based subscriptions are supported. XEP-0060 http://jabber.org/protocol/pubsub#meta-data Node meta-data is supported. XEP-0060 http://jabber.org/protocol/pubsub#manage-subscription Node owners may manage subscriptions. XEP-0060 http://jabber.org/protocol/pubsub#modify-affiliations Node owners may modify affiliations. XEP-0060 http://jabber.org/protocol/pubsub#multi-collection A single leaf node may be associated with multiple collections. XEP-0060 http://jabber.org/protocol/pubsub#multi-subscribe A single entity may subscribe to a node multiple times. XEP-0060 http://jabber.org/protocol/pubsub#outcast-affiliation The outcast affiliation is supported. XEP-0060 http://jabber.org/protocol/pubsub#persistent-items Persistent items are supported. XEP-0060 http://jabber.org/protocol/pubsub#presence-notifications Presence-based delivery of event notifications is supported. XEP-0060 http://jabber.org/protocol/pubsub#publish Publishing items is supported. XEP-0060 http://jabber.org/protocol/pubsub#publish-options Publication with publish options is supported. XEP-0060 http://jabber.org/protocol/pubsub#publisher-affiliation The publisher affiliation is supported. XEP-0060 http://jabber.org/protocol/pubsub#purge-nodes Purging of nodes is supported. XEP-0060 http://jabber.org/protocol/pubsub#retract-items Item retraction is supported. XEP-0060 http://jabber.org/protocol/pubsub#retrieve-affiliations Retrieval of current affiliations is supported. XEP-0060 http://jabber.org/protocol/pubsub#retrieve-default Retrieval of default node configuration is supported. XEP-0060 http://jabber.org/protocol/pubsub#retrieve-items Item retrieval is supported. XEP-0060 http://jabber.org/protocol/pubsub#retrieve-subscriptions Retrieval of current subscriptions is supported. XEP-0060 http://jabber.org/protocol/pubsub#subscribe Subscribing and unsubscribing are supported. XEP-0060 http://jabber.org/protocol/pubsub#subscription-options Configuration of subscription options is supported. XEP-0060 http://jabber.org/protocol/pubsub#subscription-notifications Notification of subscription state changes is supported. XEP-0060 ]]>

XEP-0068 defines a process for standardizing the fields used within Data Forms scoped by a particular namespace, and the XMPP Registrar maintains a registry of such FORM_TYPES (see &FORMTYPES;). Within pubsub, there are four uses of such forms:

  1. Authorization of subscriptions using the 'http://jabber.org/protocol/pubsub#subscribe_authorization' namespace.
  2. Configuration of subscription options using the 'http://jabber.org/protocol/pubsub#subscribe_options' namespace.
  3. Configuration of a node using the 'http://jabber.org/protocol/pubsub#node_config' namespace.
  4. Setting of meta-data information using the 'http://jabber.org/protocol/pubsub#meta-data' namespace.

The registry submissions associated with these namespaces are defined below.

Note: There is no requirement that configuration fields need to be registered with the XMPP Registrar. However, as specified in Section 3.4 of XEP-0068, names of custom (unregistered) fields MUST begin with the characters "x-" if the form itself is scoped by a registered FORM_TYPE.

http://jabber.org/protocol/pubsub#subscribe_authorization XEP-0060 Forms enabling authorization of subscriptions to pubsub nodes ]]> http://jabber.org/protocol/pubsub#subscribe_options XEP-0060 Forms enabling configuration of subscription options for pubsub nodes ]]> http://jabber.org/protocol/pubsub#node_config XEP-0060 Forms enabling configuration of pubsub nodes true 1 ]]> http://jabber.org/protocol/pubsub#meta-data XEP-0060 Forms enabling setting of meta-data information about pubsub nodes ]]> http://jabber.org/protocol/pubsub#publish-options XEP-0060 Forms enabling publication with options; each field must specify whether it defines METADATA to be attached to the item, a per-item OVERRIDE of the node configuration, or a PRECONDITION to be checked against the node configuration. ]]>

The XMPP Registrar includes "pubsub#collection", "pubsub#expire", and "pubsub#subid" in its registry of SHIM headers (see &SHIMHEADERS;). The registry submission is as follows:

pubsub#collection The collection via which a notification was received from the originating node. XEP-0060
pubsub#expire The DateTime at which a pubsub leased subscription will end or has ended. XEP-0060
pubsub#subid A subscription identifer within the pubsub protocol. XEP-0060
]]>

Future submissions to the XMPP Registrar may register additional SHIM headers that can be used in relation to the pubsub protocol, and such submission may occur without updating this specification.

As authorized by &xep0147;, the XMPP Registrar maintains a registry of queries and key-value pairs for use in XMPP URIs (see &QUERYTYPES;).

The "pubsub" querytype is defined herein for interaction with pubsub services, with two keys: (1) "action" (whose defined values are "subscribe" and "unsubscribe") and (2) "node" (to specify a pubsub node).

]]> ]]>

The following submission registers the "pubsub" querytype.

pubsub http://jabber.org/protocol/pubsub enables interaction with a publish-subscribe service XEP-0060 action the pubsub action subscribe enables subscribing to a pubsub node unsubscribe enables unsubscribing from a pubsub node node the pubsub node ]]>
The protocol documented by this schema is defined in XEP-0060: http://www.xmpp.org/extensions/xep-0060.html ]]> This namespace is used for error reporting only, as defined in XEP-0060: http://www.xmpp.org/extensions/xep-0060.html ]]> The protocol documented by this schema is defined in XEP-0060: http://www.xmpp.org/extensions/xep-0060.html ]]> The protocol documented by this schema is defined in XEP-0060: http://www.xmpp.org/extensions/xep-0060.html ]]>

Thanks to Bob Wyman, Gaston Dombiak, and Matt Tucker for their feedback.

Peter Millard, primary author of this specification from version 0.1 through version 1.7, died on April 26, 2006. The remaining co-authors are indebted to him for his many years of work on publish-subscribe technologies.