XEP-0060: Publish-Subscribe
XEP-0060: Publish-Subscribe
Abstract
This specification defines an XMPP protocol extension for generic publish-subscribe functionality. The protocol enables XMPP entities to create nodes (topics) at a pubsub service and publish information at those nodes; an event notification (with or without payload) is then broadcasted to all entities that have subscribed to the node. Pubsub therefore adheres to the classic Observer design pattern and can serve as the foundation for a wide variety of applications, including news feeds, content syndication, rich presence, geolocation, workflow systems, network management systems, and any other application that requires event notifications.
Authors
Peter Millard
Peter Saint-Andre
Ralph Meijer
SEE LEGAL NOTICES
Status
Stable
NOTICE: The protocol defined herein is a
Stable Standard
of the XMPP Standards Foundation. Implementations are encouraged and the protocol is appropriate for deployment in production systems, but some changes to the protocol are possible before it becomes a Final Standard.
Type
Standards Track
Version
1.30.0 (2025-11-11)
Document Lifecycle
Experimental
Proposed
Stable
Final
1.
Introduction
1.1 Overview
The XMPP publish-subscribe extension defined in this document provides a framework for a wide variety of applications, including news feeds, content syndication, extended presence, geolocation, avatar management, shared bookmarks, auction and trading systems, workflow systems, network management systems, NNTP gateways, profile management, and any other application that requires event notifications.
This technology uses the classic "publish-subscribe" or "observer" design pattern: a person or application publishes information, and an event notification (with 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. The focal point for publication and subscription is a "node" to which publishers send data and from which subscribers receive event notifications. Nodes can also maintain a history of events and provide other services that supplement the pure pubsub model.
This document defines a generic protocol that all pubsub applications can use. Compliant implementations are not required to implement all of the features defined here (see the
Feature Summary
.) Other specifications may define "subsets" or "profiles" of publish-subscribe for use in specialized contexts, but such profiles are out of scope for this document.
1.2 How It Works
Although this specification is large because it defines many side use cases and possible error flows, the basic idea is simple:
An entity publishes information to a node at a publish-subscribe service.
The pubsub service pushes an event 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 (
RFC 4287
]) feeds associated with weblogs, news sites, and other frequently-updated information available on the Internet. Consider the example of a weblog published by . When Hamlet writes a new weblog entry, his blogging software publishes the entry to a pubsub node hosted at :
Example 1.
Publisher Publishes a New Weblog Entry
from='hamlet@denmark.lit/blogbot'
to='pubsub.shakespeare.lit'
id='pub1'>




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?

href='http://denmark.lit/2003/12/13/atom03'/>
tag:denmark.lit,2003:entry-32397
2003-12-13T18:30:02Z
2003-12-13T18:30:02Z





So that is the "pub" part of pubsub.
Now the pubsub service notifies all the subscribers about the new blog entry:
Example 2.
Service Notifies Subscribers




[ ... ENTRY ... ]







[ ... ENTRY ... ]







[ ... ENTRY ... ]







[ ... ENTRY ... ]




Here is an even simpler example: a transient node that sends only event notifications without a payload:
Example 3.
A Transient Notification





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 event 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
.)
2.
Glossary
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 Model
A 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
XMPP Core
], or (2) the combination of a JID and a
Service Discovery (XEP-0030)
] node.
Collection Node
A type of node that contains nodes and/or other collections but no published items. Collections make it possible to represent more sophisticated relationships among nodes. Collection nodes are defined in
PubSub Collection Nodes (XEP-0248)
].
Entity
A JID-addressable XMPP entity (client, service, application, etc.).
Event
A change in the state of a node.
Instant Node
A node whose NodeID is automatically generated by a pubsub service.
Item
An XML fragment which is published to a node, thereby generating an event.
ItemID
A unique identifier for an item in the context of a specific node.
Leaf Node
A type of node that contains published items only. It is NOT a container for other nodes.
Node
A 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").
NodeID
The 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 (e.g., in some systems or in pubsub profiles such as PEP the NodeID might be an XML namespace for the associated payload), but such meaning is OPTIONAL. If a document defines a given NodeID as unique within the realm of XMPP pubsub systems, it MUST specify the XML namespace of the associated payload.
Notification
A message sent to a subscriber informing them of an event.
Outcast
An entity that is disallowed from subscribing or publishing to a node.
Owner
The manager of a node, of which there may be more than one; often but not necessarily the node creator.
Open Access Model
A node access model under which any entity may subscribe and retrieve items without approval.
Payload
The XML data that is contained within the element of a publication request or an event notification. A given payload is defined by an XML namespace and associated schema. A document that defines a payload format SHOULD specify whether the payload can be used only for a NodeID whose value is the same as the XML namespace, or whether the payload can be used for any NodeID. Such a document also SHOULD specify whether it is suggested that node at which such payloads are published are best configured as
Singleton Nodes
Personal Eventing
A 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
Personal Eventing Protocol (XEP-0163)
].
Presence Access Model
A node access model under which any entity that is subscribed to the owner's presence with a subscription of type "from" or "both" (see
RFC 3921
]) may subscribe to the node and retrieve items from the node; this access model applies mainly to instant messaging systems.
Publisher
An entity that is allowed to publish items to a node and that is automatically subscribed to the node.
Publish-Only
An entity that is allowed to publish items to a node but that is not allowed to receive notifications. (This affiliation is useful in the context of nodes that do not have an open access model when automated entities need to generate notifications on behalf of the owner.)
Pubsub Service
An XMPP server or component that adheres to the protocol defined herein.
Roster Access Model
A 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.
Subscriber
An entity that is subscribed to a node.
Whitelist Access Model
A node access model under which an entity may subscribe and retrieve items only if explicitly allowed to do so by the node owner (subscription requests from unauthorized entities are rejected).
3.
Requirements
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 XMPP MUST provide the basic features that implement a pure publish-subscribe pattern:
An entity MUST be able to publish events to a service such that all subscribers to a node receive notification of the event. See
Publish an Item to a Node
An entity MUST be able to subscribe to a node (or be informed that subscription is not allowed). See
Subscribe to a Node
An entity MUST be allowed to be affiliated with a node. Allowable affiliations are member, none, outcast, owner, publish-only, and publisher. Implementations MUST support affiliations of none and owner, and MAY support affiliations of member, outcast, publisher, and publish-only. See
Affiliations
An entity MUST be allowed to query the pubsub service (or a specific node) to determine what optional features of this specification the service (or node) implements. This query MUST use the Service Discovery (disco#info) protocol. See
Discover Node Information
Some of the possible uses of an XMPP-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:
A service MAY cache the last item published to a node (even if the "persistent-items" option is set to false); if it does default "cache-last-item" to true, it SHOULD send the last published item (or notification thereof) to subscribed entities based on configuration of the "send_last_published_item" field.
A node owner SHOULD be able to specify who may subscribe to a node.
A node owner SHOULD be able to specify who may publish to a node.
A node MAY be configured to deliver the published payload inside the event notification.
A node MAY be configured to persist published items to some persistent storage mechanism.
A node MAY be configured to persist only a limited number of items.
A service MAY support collections as described in
PubSub Collection Nodes (XEP-0248)
].
A service or node MAY support extended service discovery information (metadata).
4.
Preliminaries
4.1 Affiliations
To manage permissions, the protocol defined herein uses a hierarchy of affiliations, similiar to those introduced in
Multi-User Chat (XEP-0045)
].
All affiliations MUST be based on a bare JID ( or ) instead of a full JID ( or ).
Support for the "owner" and "none" affiliations is REQUIRED. Support for all other affiliations is RECOMMENDED. For each non-required affiliation supported by an implementation, it SHOULD return a service discovery feature of "name-affiliation" where "name" is the name of the affiliation, such as "member", "outcast", or "publisher" (see the
Feature Summary
). Particular kinds of pubsub services MAY enforce additional requirements (e.g., requiring support for a given non-required affiliation or for all affiliations).
Table 1:
Affiliations and their Privileges
Affiliation
Retrieve Items
Publish Items
Delete Single Item
Purge Node
Configure Node
Delete Node
Owner
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Publisher
Yes
Yes
Yes
Yes *
Yes *
No
No
Publish-Only
No
No
Yes
Yes *
No *
No
No
Member
Yes
Yes
No
No
No
No
No
None
Yes
No
No
No
No
No
No
Outcast
No
No
No
No
No
No
No
* Note: A service MAY allow any publisher to delete / purge any item once it has been published to that node instead of allowing only the original publisher to remove it. This behavior is NOT RECOMMENDED for the publish-only affiliation, which SHOULD be allowed to delete only items that the publish-only entity has published.
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.
Table 2:
Affiliation State Chart
Outcast
None
Member
Publisher
Owner
Outcast
--
Owner removes ban
Owner adds entity to member list
Owner adds entity to publisher list
Owner adds entity to owner list
None
Owner bans entity
--
Owner adds entity to member list
Owner adds entity to publisher list
Owner adds entity to owner list
Member
Owner bans entity
Owner removes entity from member list
--
Owner adds entity to publisher list
Owner adds entity to owner list
Publisher
Owner bans entity
Owner removes entity from publisher list
n/a
--
Owner adds entity to owner list
Owner
n/a
Owner resigns
n/a
n/a
--
4.2 Subscription States
Subscriptions to a node may exist in several states.
Table 3:
Subscription 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).
4.3 Event Types
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 event 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).
Note: The "on_sub_and_presence" setting relates to the
subscriber's
presence, not the publisher's presence.
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).
The node configuration and desired event type determine whether an item must be provided by the publisher, whether the item includes a payload in the publish request or event notification, and whether an item ID is provided by the publisher or generated by the pubsub service. We can summarize the relevant rules as follows:
Table 4:
Items, Payloads, and Item IDs
Notification-Only Node *
Payload-Included Node *
Persistent Node **
Publish request MUST include an element, which MAY be empty or MAY contain a payload; even if publish request contains a payload, pubsub service MUST NOT include the payload in event notifications; if publish request did not include item ID, pubsub service MUST generate item ID
Publish request MUST include an element, which SHOULD contain a payload; if publish request included a payload, event notifications MUST include the payload; if publish request did not include item ID, pubsub service MUST generate item ID
Transient Node **
Publish request MUST NOT include an element; payload is not included in publish request or event notifications, although event notifications MUST include an empty element; item ID is neither provided in publish request nor generated by pubsub service
Publish request MUST include an element, which SHOULD contain a payload; if publish request included a payload, event notifications MUST include the payload; pubsub service MAY generate an item ID
* Note: Whether the node is notification-only or includes payloads is determined by the "pubsub#deliver_payloads" configuration field.
** Note: Whether the node is persistent or transient is determined by the "pubsub#persist_items" configuration field.
4.4 Node Types
There are two types of nodes:
Table 5:
Node Types
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 more sophisticated relationships among nodes. For details, refer to
PubSub Collection Nodes (XEP-0248)
].
4.5 Node Access Models
In order to make node creation simpler for clients, we define the following node access models (in order of openness):
Table 6:
Node Access Models
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 subscribe or retrieve items only if on a whitelist managed by the node owner. 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, specifically by setting the affiliation to "member".
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).
4.6 Addressing
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. [
4.6.1 JID
JID addressing SHOULD only 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 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 [
]). The pubsub service MUST ensure that the NodeID conforms to the Resourceprep profile of Stringprep as described in
RFC 3920
10
].
Consider the following example, in which the pubsub service is located at the hostname pubsub.shakespeare.lit.
Example 4.
Node addressed as domain.tld/NodeID

...

Now consider the following example, in which the pubsub service is located at pubsub@shakespeare.lit.
Example 5.
Node addressed as user@domain.tld/NodeID

...

4.6.2 JID+NodeID
JID plus Node addressing SHOULD be used when interacting with a pubsub node using a protocol that support the node attribute (e.g. Service Discovery).
If a pubsub node is addressable as a JID plus node, the NodeID MUST be the value of both the protocol's '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
10
].
Consider the following example, in which the (virtual) pubsub service is located at hamlet@denmark.lit.
Example 6.
Node addressed as JID+NodeID



5.
Entity Use Cases
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.
5.1 Discover Features
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.
Example 7.
Entity Queries Pubsub Service Regarding Supported Features
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='feature1'>


Example 8.
Pubsub Service Returns Set of Supported Features
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='feature1'>





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.
Note: The value 'http://jabber.org/protocol/pubsub' is historically commonly advertised as a feature for a pubsub service. Although it has been used in examples of previous versions of this specification, it is not a feature that was previously normatively defined. It is RECOMMENDED that services include that value as feature for compatibility, but entities should not depend on it being advertised. To identify a pubsub service, entities can depend on the advertised service discovery identity.
5.2 Discover Nodes
The service discovery items ("disco#items") protocol enables an entity to query a service for a list of associated items, which, in the case of a pubsub service would consist of its nodes that, subject to local policies and configuration, are accessible to the requesting entity. A service SHOULD enable entities to discover the nodes by means of the
Service Discovery
protocol, subject to the recommendations in
Service Discovery (XEP-0030)
] regarding large result sets (for which
Jabber Search (XEP-0055)
11
] or some other protocol SHOULD be used). The following examples show the use of service discovery in discovering the nodes available at a pubsub service.
Example 9.
Entity requests node discovery
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='disco1'>


Example 10.
Service responds with nodes
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='disco1'>

name='Letters to my Beloved'
jid='pubsub.shakespeare.lit'/>
name='A Rose by Another Name'
jid='pubsub.shakespeare.lit'/>


If a node is a leaf node and items have been published to the node, the service MAY return one 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).
5.3 Discover Node Information
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
an appropriate type
as registered by the XMPP registrar (e.g. "leaf").
Example 11.
Entity queries leaf node for information
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='info1'>
node='princely_musings'/>

Example 12.
Service responds with identity of pubsub/leaf
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='info1'>
node='princely_musings'>
...

...


5.4 Discover Node Metadata
The "disco#info" result MAY include detailed metadata about the node, encapsulated in the
Data Forms (XEP-0004)
12
] format as described in
Service Discovery Extensions (XEP-0128)
13
], where the data form context is specified by including a FORM_TYPE of "http://jabber.org/protocol/pubsub#meta-data" in accordance with
Field Standardization for Data Forms (XEP-0068)
14
]. If metadata 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.
Example 13.
Entity queries a node for information
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='meta1'>
node='princely_musings'/>

Example 14.
Service responds with information and metadata
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='meta1'>
node='princely_musings'>




http://jabber.org/protocol/pubsub#meta-data


urn:example:e2ee:bundle


hamlet@denmark.lit


2003-07-29T22:56:10Z


Princely Musings (Atom)


Updates for Hamlet's Princely Musings weblog.


en


bard@shakespeare.lit


open


publishers


120


hamlet@denmark.lit


hamlet@denmark.lit


1066




Note: Node metadata 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 metadata SHOULD be provided as fields in the node configuration form.
Note: The pubsub#language field SHOULD be list-single so that the pubsub service can present an appropriate list of languages and language codes.
5.5 Discover Items for a Node
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 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.
Example 15.
Entity requests all of the items for a node
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='items1'>
node='princely_musings'/>

from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>
node='princely_musings'>






Note: when the service uses
JID addressing
(as opposed to (
JID+NodeID addressing
), the response to a request to Discover Items for a node (as described here) may be indistinguishable from the response to a request to
Discover Nodes
. Therefore
JID+NodeID addressing
SHOULD be used.
5.6 Retrieve Subscriptions
An entity may 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 child contains an empty element with no attributes.
Example 16.
Entity requests all current subscriptions
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='subscriptions1'>




If the service returns a list of subscriptions, it MUST return all subscriptions for all JIDs that match the bare JID ( or ) portion of the 'from' attribute on the request.
For each subscription, a 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.
Example 17.
Service returns all current subscriptions
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit'
id='subscriptions1'>










If the requesting entity has no subscriptions, the pubsub service MUST return an empty element.
Example 18.
No subscriptions
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='subscriptions1'>




If the service does not support subscriptions retrieval, the service MUST respond with a error, specifying a pubsub-specific error condition of and a feature of "retrieve-subscriptions".
Example 19.
Subscriptions retrieval not supported
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='subscriptions1'>


feature='retrieve-subscriptions'/>


An entity MAY also request all of its subscriptions at a specific node (e.g., if it has subscriptions with multiple SubIDs) by including a 'node' attribute on the element.
Example 20.
Entity requests current subscriptions from a specific node
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='subscriptions2'>




The service would then return only the entity's subscriptions to that specific node; this acts as a filter on the entity's subscriptions.
Example 21.
Service returns all current subscriptions to a specific node
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit'
id='subscriptions2'>







5.7 Retrieve Affiliations
An entity may want to query the service to retrieve its affiliations for all nodes at the service, or query a specific node for its affiliation with that node. Support for this feature ("retrieve-affiliations") is RECOMMENDED.
In order to make the request of the service, the requesting entity includes an empty element with no attributes.
Example 22.
Entity requests all current affiliations
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='affil1'>




If the service returns a list of affiliations, it MUST return all affiliations for all JIDs that match the bare JID ( or ) portion of the 'from' attribute on the request.
For each affiliation, an element is returned containing the NodeID and the affiliation state (owner, publisher, publish-only, member, or outcast).
Example 23.
Service replies with all current affiliations
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit'
id='affil1'>









If the requesting entity has no affiliations, the pubsub service MUST return an empty element.
Example 24.
No affiliations
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='affil1'>




If the service does not support affiliations retrieval, the service MUST respond with a error, specifying a pubsub-specific error condition of and a feature of "retrieve-affiliations".
Example 25.
Affiliations retrieval not supported
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='affil1'>


feature='retrieve-affiliations'/>


In order to make an affiliations request of a specific node, the requesting entity includes an empty element with a 'node' attribute.
Example 26.
Entity requests affiliation at a specific node
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='affil2'>




Example 27.
Service replies with current affiliation
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit'
id='affil2'>






6.
Subscriber Use Cases
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.)
6.1 Subscribe to a Node
6.1.1 Request
When an XMPP 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 element contains one and only one element. The element SHOULD possess a 'node' attribute specifying the node to which the entity wishes to subscribe. The element MUST also possess a 'jid' attribute specifying the exact XMPP address to be used as the subscribed JID -- often a bare JID ( or ) or full JID ( or ).
Here is an example of a subscription request.
Example 28.
Entity subscribes to a node
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='sub1'>

node='princely_musings'
jid='francisco@denmark.lit'/>


6.1.2 Success Case
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).
Example 29.
Service replies with success
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>

node='princely_musings'
jid='francisco@denmark.lit'
subid='ba49252aaa4f5d320c24d3766f0bdcade78c78d3'
subscription='subscribed'/>


6.1.3 Error Cases
There are several reasons why the subscription request might fail:
The bare JID portions of the JIDs do not match.
The node has an access model of "presence" and the requesting entity is not subscribed to the owner's presence.
The node has an access model of "roster" and the requesting entity is not in one of the authorized roster groups.
The node has an access model of "whitelist" and the requesting entity is not on the whitelist.
The service requires payment for subscriptions to the node.
The requesting entity is anonymous and the service does not allow anonymous entities to subscribe.
The requesting entity has a pending subscription.
The requesting entity is blocked from subscribing (e.g., because having an affiliation of outcast).
The requesting entity has attempted to establish too many subscriptions.
The node does not support subscriptions.
The node has moved.
The node does not exist.
These error cases are described more fully in the following sections.
6.1.3.1 JIDs Do Not Match
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 error, which SHOULD also include a pubsub-specific error condition of .
Example 30.
JIDs do not match
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>





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 listing of entities that are not allowed to perform specific operations (such as subscribing or creating nodes).
6.1.3.2 Presence Subscription Required
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 error, which SHOULD also include a pubsub-specific error condition of .
Example 31.
Entity is not authorized to create a subscription (presence subscription required)
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>





6.1.3.3 Not in Roster Group
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 error, which SHOULD also include a pubsub-specific error condition of .
Example 32.
Entity is not authorized to create a subscription (not in roster group)
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>





6.1.3.4 Not on Whitelist
For nodes with a node access model of "whitelist", if the requesting entity is not on the whitelist then the service MUST return a error, specifying a pubsub-specific error condition of .
Example 33.
Node has whitelist access model
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>





6.1.3.5 Payment Required
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 error to the subscriber.
Example 34.
Payment is required for a subscription
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>




6.1.3.6 Anonymous Subscriptions Not Allowed
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 error to the subscriber.
Example 35.
Requesting entity is anonymous
from='pubsub.shakespeare.lit'
to='anonymous@denmark.lit/foo'
id='sub1'>




6.1.3.7 Subscription Pending
If the requesting entity has a pending subscription, the service MUST return a error to the subscriber, specifying a pubsub-specific error condition of .
Example 36.
Requesting entity has pending subscription
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>





6.1.3.8 Blocked
If the requesting entity is blocked from subscribing (e.g., because having an affiliation of outcast), the service MUST return a error to the subscriber.
Example 37.
Requesting entity is blocked
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>




6.1.3.9 Too Many Subscriptions
If the requesting entity has attempted to establish too many subscriptions (where the definition of "too many" is a matter of local service policy), the service MUST return a error to the subscriber, specifying a pubsub-specific error condition of .
Example 38.
Requesting entity has exceeded limit on number of subscriptions
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>





The service can match on bare JID or full JID in determining which subscribing entities match for the purpose of determining if an entity has requested too many subscriptions.
6.1.3.10 Subscriptions Not Supported
If the node does not allow entities to subscribe, the service SHOULD return a error to the subscriber, specifying a pubsub-specific error condition of and a feature of "subscribe".
Example 39.
Subscribing not supported
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>


feature='subscribe'/>


6.1.3.11 Node Has Moved
If the node has, the service SHOULD return a error (if the node has moved permanently) or a error (if the node has moved temporarily).
Example 40.
Node has moved
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>


xmpp:pubsub.shakespeare.lit?;node=some-other-node



6.1.3.12 Node Does Not Exist
If the node does not exist, the service SHOULD return an error to the subscriber.
Example 41.
Node does not exist
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>




6.1.4 Approval Required
For nodes with an access model of "authorize", subscription requests MUST be approved by one of the node owners unless service policy allows entities with affiliations other than "none" to auto-subscribe (e.g., members and publishers might be allowed to auto-subscribe); 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.
Example 42.
Service replies with pending
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>

node='princely_musings'
jid='francisco@denmark.lit'
subscription='pending'/>


6.1.5 Configuration Required
If the entity must configure its subscription options (see the
Configure Subscription Options
section of this document) before receiving event 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.
Example 43.
Service replies with success and indicates that subscription configuration is required
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>

node='princely_musings'
jid='francisco@denmark.lit'
subscription='unconfigured'>






Note: The node shall include the child element only if the subscriber must configure the subscription before receiving any event 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 error, specifying a pubsub-specific error condition of .
Example 44.
Service returns error specifying that subscription configuration is required
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>

node='princely_musings'
jid='francisco@denmark.lit'/>



http://jabber.org/protocol/pubsub#subscribe_options

1
0
false

chat
online
away









If the 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 element in the IQ-result, as shown in the following example).
Example 45.
Service replies with success and indicates that subscription options are supported but not required
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>

node='princely_musings'
jid='francisco@denmark.lit'
subscription='unconfigured'>




6.1.6 Multiple Subscriptions
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 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 the pubsub service generates event notifications, it SHOULD send only one event notification to an entity that has multiple subscriptions, rather than one event notification for each subscription. By "entity" here is meant the JID specified for the subscription, whether bare JID or full JID; however, if the same bare JID has multiple subscriptions but those subscriptions are for different full JIDs (e.g., one subscription for user@domain.tld./foo and another subscription for user@domain.tld/bar), the service MUST treat those as separate JIDs for the purpose of generating event notifications.
6.1.7 Receiving the Last Published Item
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
Delayed Delivery (XEP-0203)
15
]) to indicate it is sent with delayed delivery. (Note that in this example the event notification is sent to the bare JID since that is the subscribed JID.)
Example 46.
Service sends 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?

href='http://denmark.lit/2003/12/13/atom03'/>
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.
6.2 Unsubscribe from a Node
6.2.1 Request
To unsubscribe from a node, the subscriber sends an IQ-set whose child contains an element that specifies the node and the subscribed JID.
Example 47.
Entity unsubscribes from a node
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='unsub1'>

node='princely_musings'
jid='francisco@denmark.lit'/>


6.2.2 Success Case
If the request can be successfully processed, the service MUST return an IQ result and MAY include a child element with the updated element for that node. If subscription identifiers are supported by the service, the 'subid' attribute MUST be present as well.
Example 48.
Service replies with success
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='unsub1'>

node='princely_musings'
jid='francisco@denmark.lit'
subscription='none'
subid='ba49252aaa4f5d320c24d3766f0bdcade78c78d3'/>


6.2.3 Error Cases
There are several reasons why the unsubscribe request might fail:
The requesting entity has multiple subscriptions to the node but does not specify a subscription ID.
The request does not specify an existing subscriber.
The requesting entity does not have sufficient privileges to unsubscribe the specified JID.
The node does not exist.
The request specifies a subscription ID that is not valid or current.
These error cases are described more fully in the following sections.
6.2.3.1 No Subscription ID
If the requesting entity has multiple subscriptions to the node but does not specify a subscription ID, the service MUST return a error, which SHOULD also include a pubsub-specific error condition of .
Example 49.
Entity did not specify SubID
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='unsub1'>





6.2.3.2 No Such Subscriber
If the value of the 'jid' attribute does not specify an existing subscriber, the pubsub service MUST return an error stanza, which SHOULD be and which SHOULD also include a pubsub-specific error condition of .
Example 50.
Requesting entity is not a subscriber
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='unsub1'>





6.2.3.3 Insufficient Privileges
If the requesting entity is prohibited from unsubscribing the specified JID, the service MUST return a 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 ( or ), a service MUST perform this check by comparing the ( or ) 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 error.
Example 51.
Requesting entity is prohibited from unsubscribing entity
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='unsub1'>




6.2.3.4 Node Does Not Exist
If the node does not exist, the pubsub service MUST return an error.
Example 52.
Node does not exist
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='unsub1'>




6.2.3.5 Bad Subscription ID
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 error, which SHOULD also include a pubsub-specific error condition of .
Example 53.
Invalid subscription identifier
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='unsub1'>





6.3 Configure Subscription Options
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).
6.3.1 Advertising Support
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".
Example 54.
Pubsub service indicates support for subscription options
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='feature1'>

...

...


6.3.2 Request
A subscriber requests the subscription options by including an element inside an IQ-get stanza.
Example 55.
Subscriber requests subscription options form
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='options1'>




6.3.3 Success Case
If the request can be successfully processed, the service MUST respond with the options.
Example 56.
Service responds with the options form
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='options1'>




http://jabber.org/protocol/pubsub#subscribe_options

label='Enable delivery?'>
1

label='Receive digest notifications (approx. one per day)?'>
0

label='Receive message body in addition to payload?'>
false

var='pubsub#show-values'
type='list-multi'
label='Select the presence types which are
allowed to receive event notifications'>





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. [
16
6.3.4 Error Cases
There are several reasons why the options request might fail:
The requesting entity does not have sufficient privileges to modify subscription options for the specified JID.
The requesting entity (or specified subscriber) is not subscribed.
The request does not specify both the NodeID and the subscriber's JID.
The request does not specify a subscription ID but one is required.
The request specifies a subscription ID that is not valid or current.
Subscription options are not supported.
The node does not exist.
These error cases are described more fully in the following sections.
6.3.4.1 Insufficient Privileges
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, i.e. via node="", the service MUST assume that the requesting entity wishes to request subscription options for its subscription to the root collection node; refer to
PubSub Collection Nodes (XEP-0248)
] 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 ( or ), a service MUST perform this check by comparing the ( or ) 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 error.
Example 57.
Requesting entity does not have sufficient privileges to modify subscription options
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>




6.3.4.2 No Such Subscriber
If the requesting entity (or specified subscriber, if different) is not subscribed, the service MUST return an error, which SHOULD also include a pubsub-specific error condition of .
Example 58.
No such subscriber
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='options1'>





6.3.4.3 Subscriber JID Required
If the subscriber does not specify a subscriber JID, the service MUST return a error, which SHOULD also include a pubsub-specific error condition of .
Example 59.
Subscriber JID not specified
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='options1'>





6.3.4.4 Subscription ID 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 error, which SHOULD also include a pubsub-specific error condition of .
Example 60.
SubID required
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>





6.3.4.5 Invalid Subscription ID
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 error, which SHOULD also include a pubsub-specific error condition of .
Example 61.
Invalid subscription identifier
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='unsub1'>





6.3.4.6 Subscription Options Not Supported
If the node or service does not support subscription options, the service MUST respond with a error, specifying a pubsub-specific error condition of and a feature of "subscription-options".
Example 62.
Subscription options not supported
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='options1'>


feature='subscription-options'/>


6.3.4.7 Node Does Not Exist
If the node does not exist, the pubsub service MUST return an error.
Example 63.
Node does not exist
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='options1'>




6.3.5 Form Submission
After receiving the configuration form, the requesting entity SHOULD submit the form in order to update the entity's subscription options for that node.
Example 64.
Subscriber submits completed options form
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='options2'>




http://jabber.org/protocol/pubsub#subscribe_options

1
0
false

chat
online
away





6.3.6 Form Processing
6.3.6.1 Success
If the service can successfully process the submission, it MUST respond with success.
Example 65.
Service responds with success
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='options2'/>
6.3.6.2 Failure
If the subscriber attempts to set an invalid group of options, the service MUST respond with a error.
Example 66.
Service responds with Bad Request for invalid options
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='options2'>





The other errors already mentioned for getting subscription options also apply to setting subscription options.
6.3.7 Subscribe and Configure
As noted, if a service supports subscription options, an entity MAY subscribe and provide the subscription options in the same stanza.
Note: The element MUST follow the element and MUST NOT possess a 'node' attribute or 'jid' attribute, since the value of the element's 'node' attribute specifies the desired NodeID and the value of the element's 'jid' attribute specifies the subscriber's JID; if any of these rules are violated, the service MUST return a error.
Example 67.
Entity subscribes to node and sets configuration options
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='sub1'>





http://jabber.org/protocol/pubsub#subscribe_options

1
0
false

chat
online
away





When the service informs the client of success, it SHOULD include a data form of type "result" informing the client of the resulting configuration options.
Example 68.
Service replies with success (including configuration options)
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='sub1'>

node='princely_musings'
jid='francisco@denmark.lit'
subid='ba49252aaa4f5d320c24d3766f0bdcade78c78d3'
subscription='subscribed'/>



http://jabber.org/protocol/pubsub#subscribe_options

1
0
false

chat
online
away





6.4 Request Default Subscription Configuration Options
An entity might want to request information about the default subscription configuration. Support for this feature is OPTIONAL.
6.4.1 Request
To get the default subscription options for a node, the entity MUST send an empty element to the node; in response, the node SHOULD return the default subscription options.
Example 69.
Entity requests default subscription configuration options
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='def1'>




Note: Here the namespace is 'http://jabber.org/protocol/pubsub' (not 'http://jabber.org/protocol/pubsub#owner' as for retrieval of the default node configuration options).
The service itself MAY also have default subscription configuration options. To get the default subscription configuration options all (leaf) nodes at a service, the entity MUST send an empty element but not specifiy a node; in response, the service SHOULD return the default subscription options.
Example 70.
Entity requests default subscription configuration options
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='def2'>




6.4.2 Success Case
If no error occurs, the node MUST return the default subscription configuration options.
Example 71.
Service responds with default subscription configuration options
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='def1'>




http://jabber.org/protocol/pubsub#subscribe_options

1
0
false

chat
online
away





6.4.3 Error Cases
There are several reasons why the default subscription configuration options request might fail:
The service does not support subscription configuration.
The service does not support retrieval of default subscription configuration.
These error cases are described more fully in the following sections.
6.4.3.1 Node Configuration Not Supported
If the node does not support subscription configuration, it MUST return a error, specifying a pubsub-specific error condition of and a feature of "subscription-options".
Example 72.
Service does not support subscription configuration
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='def1'>


feature='subscription-options'/>


6.4.3.2 Default Subscription Configuration Retrieval Not Supported
If the node does not support retrieval of default subscription configuration options, it MUST return a error, specifying a pubsub-specific error condition of and a feature of "retrieve-default-sub".
Example 73.
Service does not support retrieval of default subscription configuration options
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='def1'>


feature='retrieve-default-sub'/>


6.5 Retrieve Items from a Node
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).
6.5.1 Permissions
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.)
6.5.2 Requesting All Items
The subscriber may request all items by specifying only the Node ID without restrictions.
Example 74.
Subscriber requests all items
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='items1'>




6.5.3 Returning All Items
The service then SHOULD return all available items at the node, although it MAY truncate the result set if a large number of items has been published (see next section) and naturally it cannot return items that have been deleted, expired, etc.
Example 75.
Service returns all items
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>




The Uses of This World

O, that this too too solid flesh would melt
Thaw and resolve itself into a dew!

href='http://denmark.lit/2003/12/13/atom03'/>
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!

href='http://denmark.lit/2003/12/13/atom03'/>
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!

href='http://denmark.lit/2003/12/13/atom03'/>
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?

href='http://denmark.lit/2003/12/13/atom03'/>
tag:denmark.lit,2003:entry-32397
2003-12-13T18:30:02Z
2003-12-13T18:30:02Z





6.5.4 Returning Some Items
A node may have a large number of items associated with it, in which case it may be problematic to return all of the items in response to an items request. In this case, the service SHOULD return some of the items and note that the list of items has been truncated by including a
Result Set Management (XEP-0059)
17
] notation.
A Pubsub entity supporting
Result Set Management (XEP-0059)
17
] SHOULD include a feature of "http://jabber.org/protocol/pubsub#rsm" in its disco#info response, to make it clear that the RSM feature is for PubSub, and not for e.g.,
Message Archive Management (XEP-0313)
18
].
Example 76.
Service returns some items via result set management
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>




The Uses of This World

O, that this too too solid flesh would melt
Thaw and resolve itself into a dew!

href='http://denmark.lit/2003/12/13/atom03'/>
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!

href='http://denmark.lit/2003/12/13/atom03'/>
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!

href='http://denmark.lit/2003/12/13/atom03'/>
tag:denmark.lit,2003:entry-32396
2003-12-13T11:09:53Z
2003-12-13T11:09:53Z




368866411b877c30064a5f62b917cffe
4e30f35051b7b8b42abe083742187228
19



6.5.5 Returning the Last Published Item
Even if the service or node does not support persistent items, it MAY return the last published item.
Example 77.
Service returns last published item
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>




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?

href='http://denmark.lit/2003/12/13/atom03'/>
tag:denmark.lit,2003:entry-32397
2003-12-13T18:30:02Z
2003-12-13T18:30:02Z





6.5.6 Returning Notifications Only
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.
Example 78.
Subscriber requests specific items by ItemID
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='items3'>







Example 79.
Service sends requested item(s)
from='pubsub.shakespeare.lit'
id='items3'>




The Uses of This World

O, that this too too solid flesh would melt
Thaw and resolve itself into a dew!

href='http://denmark.lit/2003/12/13/atom03'/>
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!

href='http://denmark.lit/2003/12/13/atom03'/>
tag:denmark.lit,2003:entry-32396
2003-12-13T11:09:53Z
2003-12-13T11:09:53Z





6.5.7 Requesting the Most Recent Items
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
Result Set Management (XEP-0059)
17
] instead of the 'max_items' attribute.)
Example 80.
Subscriber requests two most recent items
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='items2'>




Example 81.
Service returns two most recent items
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items2'>




Alone

Now I am alone.
O, what a rogue and peasant slave am I!

href='http://denmark.lit/2003/12/13/atom03'/>
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?

href='http://denmark.lit/2003/12/13/atom03'/>
tag:denmark.lit,2003:entry-32397
2003-12-13T18:30:02Z
2003-12-13T18:30:02Z





If there are fewer items in the node than requested, the service should return all of them.
Example 82.
Service returns no items if it has none
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items2'>




6.5.8 Requesting a Particular Item
The subscriber can request a particular item by specifying the Node ID and the appropriate ItemID.
Example 83.
Subscriber requests a particular item
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='items3'>






The service would then return that specific item, if available.
6.5.9 Error Cases
There are several reasons why the items retrieval request might fail:
The requesting entity has multiple subscriptions to the node but does not specify a subscription ID.
The requesting entity is subscribed but specifies an invalid subscription ID.
The node does not return items to unsubscribed entities and the requesting entity is not subscribed.
The service or node does not support persistent items and does not return the last published item.
The service or node does not support item retrieval.
The node has an access model of "presence" and the requesting entity is not subscribed to the owner's presence.
The node has an access model of "roster" and the requesting entity is not in one of the authorized roster groups.
The node has an access model of "whitelist" and the requesting entity is not on the whitelist.
The service or node requires payment for item retrieval.
The requesting entity is blocked from retrieving items from the node (e.g., because having an affiliation of outcast).
The node does not exist.
These error cases are described more fully in the following sections.
6.5.9.1 Subscription ID Required
If the requesting entity has multiple subscriptions to the node but does not specify a subscription ID, the service MUST return a error to the subscriber, which SHOULD also include a pubsub-specific error condition of .
Example 84.
Entity did not specify SubID
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>





6.5.9.2 Invalid Subscription ID
If the requesting entity is subscribed but specifies an invalid subscription ID, the service MUST return a error to the subscriber, which SHOULD also include a pubsub-specific error condition of .
Example 85.
Entity specified invalid SubID
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>





6.5.9.3 Entity Not Subscribed
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 error to the subscriber, which SHOULD also include a pubsub-specific error condition of .
Example 86.
Entity is not subscribed
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>





6.5.9.4 Persistent Items Not Supported
If the service or node does not support persistent items and does not return the last published item, the service MUST return a error to the subscriber, specifying a pubsub-specific error condition of and a feature of "persistent-items".
Example 87.
Persistent items not supported
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>


feature='persistent-items'/>


6.5.9.5 Item Retrieval Not Supported
If the service or node does not support item retrieval (e.g., because the node is a collection node as described in
PubSub Collection Nodes (XEP-0248)
]), the service MUST return a error to the subscriber, specifying a pubsub-specific error condition of and a feature of "retrieve-items".
Example 88.
Item retrieval not supported
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>


feature='retrieve-items'/>


6.5.9.6 Presence Subscription Required
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 error, which SHOULD also include a pubsub-specific error condition of .
Example 89.
Entity is not authorized to retrieve items (presence subscription required)
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>





6.5.9.7 Not in Roster Group
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 error, which SHOULD also include a pubsub-specific error condition of .
Example 90.
Entity is not authorized to retrieve items (not in roster group)
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>





6.5.9.8 Not on Whitelist
For nodes with a node access model of "whitelist", if the requesting entity is not on the whitelist then the service MUST return a error, specifying a pubsub-specific error condition of .
Example 91.
Node has whitelist access model
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>





6.5.9.9 Payment Required
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 error to the subscriber.
Example 92.
Payment is required to retrieve items
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>




6.5.9.10 Blocked
If the requesting entity is blocked from retrieving items (e.g., because having an affiliation of outcast), the service MUST return a error to the subscriber.
Example 93.
Requesting entity is blocked
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>




6.5.9.11 Node Does Not Exist
If the node does not exist, the service SHOULD return an error to the subscriber.
Example 94.
Node does not exist
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>




6.5.9.12 No Such Item(s)
If there are no items at the node or the requested items do not exist, the service SHOULD return an IQ stanza of type "result" with an empty element.
Example 95.
No such item(s)
id='items1'
to='francisco@denmark.lit/barracks'
type='result'>




7.
Publisher Use Cases
7.1 Publish an Item to a Node
7.1.1 Request
A pubsub service MAY support the ability to publish items (if so, it MUST advertise support for the "http://jabber.org/protocol/pubsub#publish" feature). 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 child.
The syntax is as follows:
The element MUST possess a 'node' attribute, specifying the NodeID of the node.
Depending on the node configuration, the element MAY contain no elements or one element. [
19
] [
20
The 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.
Example 96.
Publisher publishes an item with an ItemID
from='hamlet@denmark.lit/blogbot'
to='pubsub.shakespeare.lit'
id='publish1'>




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?

href='http://denmark.lit/2003/12/13/atom03'/>
tag:denmark.lit,2003:entry-32397
2003-12-13T18:30:02Z
2003-12-13T18:30:02Z





Example 97.
Publisher publishes an item without an ItemID
from='hamlet@denmark.lit/blogbot'
to='pubsub.shakespeare.lit'
id='publish2'>




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?

href='http://denmark.lit/2003/12/13/atom03'/>
tag:denmark.lit,2003:entry-32397
2003-12-13T18:30:02Z
2003-12-13T18:30:02Z





7.1.2 Success Case
If the pubsub service can successfully process the request, it MUST inform the publisher of success. If the publish request did not include an ItemID, the IQ-result SHOULD include an empty element that specifies the ItemID of the published item.
Example 98.
Service replies with success
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/blogbot'
id='publish1'>




Example 99.
Service replies with success and the ID of the new item
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/blogbot'
id='publish2'>






Note: If the publisher previously published an item with the same ItemID, successfully processing the request means that the service MUST overwrite the old item with the new item and then proceed as follows.
The pubsub service MUST then send one event notification to each entity that meets the criteria for receiving an event notification (typically to each approved subscriber, although there are other contexts in which an entity may receive an event notification as summarized under
Notification Triggers
). Each 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.
7.1.2.1 Notification With Payload
If the node is configured to include payloads, the subscribers will receive payloads with the event notifications.
Example 100.
Subscribers receive event notifications with payloads





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?

href='http://denmark.lit/2003/12/13/atom03'/>
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?

href='http://denmark.lit/2003/12/13/atom03'/>
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?

href='http://denmark.lit/2003/12/13/atom03'/>
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?

href='http://denmark.lit/2003/12/13/atom03'/>
tag:denmark.lit,2003:entry-32397
2003-12-13T18:30:02Z
2003-12-13T18:30:02Z





7.1.2.2 Notification Without Payload
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.)
Example 101.
Subscribers receive event notifications only

























7.1.2.3 Item Publisher
If configured to do so (see
Associating Events and Payloads with the Generating Entity
), the service can include the publisher of the item when it generates event notifications.
Example 102.
Service Notifies Subscribers



publisher='hamlet@denmark.lit'>
[ ... ENTRY ... ]




If so, the service MUST also include the publisher with every other form of item retrieval.
Example 103.
Service returns items
from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='items1'>


publisher='hamlet@denmark.lit'>
[ ... ENTRY ... ]

[ ... MORE ITEMS ... ]



The value of the 'publisher' attribute MUST be generated by the service, not accepted by the service in the published item, since allowing the publisher to assert its JID would open the possibility of spoofing.
The JID stamped by the service can be either (1) the full JID of the publisher as taken the 'from' attribute of the IQ-set used to publish the item or (2) the bare JID of the publisher as derived from a formal affiliation in the explicit list of whitelisted publishers.
7.1.2.4 Inclusion of Subscription ID
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
Stanza Headers and Internet Metadata (XEP-0131)
21
] format and SHOULD be included after the event notification information (i.e., as the last child of the stanza).
Example 104.
Subscriber receives notated event notification







123-abc

004-yyy



7.1.2.5 Node is full
If the service or node is configured so that there is a maximum number of items cached at the node and the maximum is reached when an item is published, the service MUST delete one of the existing items or reject the new item.
The behaviour of the service is determined by the "pubsub#publish_node_full" option which may take one of the following values: "retract-oldest", "discard-oldest", or "reject".
The "retract-oldest" option is the default one and SHOULD be implemented even if this configuration isn't supported.
It is RECOMMENDED for the service to follow the "first in, first out" rule and retract the oldest item. Depending on node configuration, deletion of an existing item MAY result in sending of a retract notification to the subscribers.
When configured as "discard-oldest", a service MUST discard the oldest item.
The "reject" option for this configuration is described in
Node is full
publishing errors.
7.1.3 Error Cases
There are several reasons why the publish request might fail:
The requesting entity does not have sufficient privileges to publish.
The node does not support item publication.
The node does not exist.
The node is full (max_items exceeded).
The payload size exceeds a service-defined limit.
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.
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).
7.1.3.1 Insufficient Privileges
If the requesting entity does not have sufficient privileges to publish, the service MUST return a error.
Example 105.
Entity does not have sufficient privileges to publish to node
from='pubsub.shakespeare.lit'
id='publish1'>




7.1.3.2 Item Publication Not Supported
If the node does not support item publication (e.g., because it is a collection node as described in
PubSub Collection Nodes (XEP-0248)
]), the service MUST return a error, specifying a pubsub-specific error condition of and a feature of "publish".
Example 106.
Node does not support item publication
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='publish1'>


feature='publish'/>


7.1.3.3 Node Does Not Exist
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 error.
Example 107.
Entity attempts to publish to a non-existent node
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='publish1'>




7.1.3.4 Node is full
If the requesting entity attempts to publish an item to a node that has reached its maximum number of items, visible via pubsub#max_items, and the pubsub#publish_full_node configuration value is set to "reject", then the service MUST return a error, which SHOULD also include a pubsub-specific error condition of .
Example 108.
Entity attempts to publish to a node with max_items reached
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='publish1'>





7.1.3.5 Payload Too Big
If the payload size exceeds a service-defined limit, the service MUST return a error, which SHOULD also include a pubsub-specific error condition of .
Example 109.
Entity attempts to publish very large payload
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='publish1'>





7.1.3.6 Bad Payload
If the element does not contain exactly 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 error, which SHOULD also include a pubsub-specific error condition of .
Example 110.
Entity attempts to publish item with multiple payload elements or namespace does not match
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='publish1'>





7.1.3.7 Request Does Not Match Configuration
If the request does not conform to the configured
event type
for the node, the service MAY bounce the request with a error, which SHOULD also include a pubsub-specific error condition. The following rules apply:
If the event type is persistent (either event 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 event notification or payload) and the publisher does not include an item, the service MUST bounce the publication request with a error and a pubsub-specific error condition of .
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 error and a pubsub-specific error condition of .
If the event type is notification + transient and the publisher provides an item, the service MUST bounce the publication request with a error and a pubsub-specific error condition of .
Examples of these errors are shown below.
Example 111.
Publisher attempts to publish to persistent node with no item
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='publish1'>





Example 112.
Publisher attempts to publish to payload node with no payload
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='publish1'>





Example 113.
Publisher attempts to publish to transient notification node with item
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='publish1'>





7.1.4 Automatic Node Creation
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 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.
7.1.5 Publishing Options
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:
Example 114.
Publishing with options
from='hamlet@denmark.lit/blogbot'
to='pubsub.shakespeare.lit'
id='pub1'>




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?

href='http://denmark.lit/2003/12/13/atom03'/>
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 element MUST contain a data form (see
Data Forms (XEP-0004)
12
]), whose FORM_TYPE MUST be "http://jabber.org/protocol/pubsub#publish-options" (see
XEP-0068
).
Each form field denotes a precondition to publishing the request. A pub-sub service advertising support for publishing options MUST check each precondition field against the node configuration of the same name, and it MUST reject the publication upon encountering unknown fields.
Preconditions MUST be processed as follows:
If the node exists and the precondition is not met, then the publish MUST fail with a error condition and a pubsub-specific condition of .
If the node exists and the precondition is met, then the publish succeeds.
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.
If the node does not exist and the service does not support the "auto-create" feature, then the publish shall fail.
7.2 Delete an Item from a Node
A publisher might want to delete an item once it has been published to a node that supports persistent items. Support for this feature ("delete-items") is RECOMMENDED.
7.2.1 Request
To delete an item, the publisher sends a retract request as shown in the following examples. The element MUST possess a 'node' attribute, MAY possess a 'notify' attribute, and MUST contain one element; the element MUST be empty and MUST possess an 'id' attribute.
Example 115.
Entity deletes an item from a node
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='retract1'>






7.2.2 Success Case
If no error occurs, the service MUST delete the item.
Example 116.
Service replies with success
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='retract1'/>
7.2.2.1 Delete And Notify
If no error occurs and the element included a 'notify' attribute with a value of "true" or "1" [
16
], then the service MUST delete the item and MUST notify all subscribers as shown below. The syntax is identical to event notifications except that instead of an element, the element includes a element.
Example 117.
Subscribers are notified of deletion













7.2.2.2 Inclusion of Subscription ID
If a single entity is subscribed to the node multiple times, the service SHOULD notate the 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 notification data (i.e., as the last child of the stanza).
Example 118.
Subscriber receives notated event notification







123-abc

004-yyy



7.2.3 Error Cases
There are several reasons why the item retraction request might fail:
The publisher does not have sufficient privileges to delete the requested item.
The node or item does not exist.
The request does not specify a node.
The request does not include an element or the element does not specify an ItemID.
The node does not support persistent items.
The service does not support the deletion of items.
These error cases are described more fully in the following sections.
7.2.3.1 Insufficient Privileges
If the requesting entity does not have sufficient privileges to delete the item, the service MUST return a error.
Example 119.
Requesting entity does not have sufficient privileges
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='retract1'>




7.2.3.2 Node Does Not Exist
If the node or item does not exist, the service MUST return an error.
Example 120.
Non-existent node or item
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='retract1'>




7.2.3.3 NodeID Required
If the request does not specify a node, the service MUST return a error, which SHOULD also include a pubsub-specific error condition of .
Example 121.
Request does not specify a node
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='retract1'>





7.2.3.4 Item or ItemID Required
If the request does not include an element or the element does not specify an ItemID, the service MUST return a error, which SHOULD also include a pubsub-specific error condition of .
Example 122.
Request does not specify an item
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='retract1'>





7.2.3.5 Persistent Items Not Supported
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 error, specifying a pubsub-specific error condition of and a feature of "persistent-items".
Example 123.
Node does not support persistent items
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='retract1'>


feature='persistent-items'/>


7.2.3.6 Item Deletion Not Supported
If the service does not support item deletion, it MUST return a error, specifying a pubsub-specific error condition of and a feature of "delete-items".
Example 124.
Service does not support item deletion
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='retract1'>


feature='delete-items'/>


8.
Owner Use Cases
8.1 Create a Node
8.1.1 General Considerations
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:
Create a node with default configuration for the specified node type.
Create and configure a node simultaneously.
Example 125.
Request to create a node
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='create1'>




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 error, specifying a pubsub-specific error condition of and a feature of "create-nodes".
Example 126.
Service does not support node creation
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='create1'>


feature='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 error.
Example 127.
Service requires registration
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='create1'>




If the requesting entity does not have sufficient privileges to create nodes, the service MUST respond with a error.
Example 128.
Requesting entity is prohibited from creating nodes
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='create1'>




If the requested NodeID already exists, the service MUST respond with a error.
Example 129.
NodeID already exists
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='create1'>




If the node creator does not specify a NodeID but the service does not support instant nodes, the service MUST return a error, specifying a pubsub-specific error condition of .
Example 130.
Service does not support instant nodes
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='create2'>





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.
Example 131.
Entity requests an instant node
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='create2'>




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).
Example 132.
Service replies with success and generated NodeID
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='create2'>




Note: When a service successfully creates a node on behalf of the requesting entity, it MUST return an IQ result (in accordance with XMPP Core). 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, the service MUST also specify the modified node in the IQ result. In all other cases, the service MAY specify the NodeID in the IQ result but the node creator MUST NOT depend on receiving it from the service (since the node creator can determine which node was created by tracking the 'id' attribute that it specified for the IQ-set).
8.1.2 Create a Node With Default Configuration
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 Node Configurations
section of this document).
In order to create a node with default configuration, the node creator can simply include an empty child element.
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).
Example 133.
Entity requests leaf node with (default) open access model
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='create1'>




Note: The default setting for the 'pubsub#node_type' configuration field is "leaf".
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#access_model' field.
Example 134.
Entity requests leaf node with non-default access model
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='create2'>





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.
Example 135.
Service informs requesting entity of success
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='create1'/>
If service does not support the specified access model, it MUST return a error, specifying a pubsub-specific error condition of .
Example 136.
Service does not support specified access model
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='create2'>





(For error handling if the service does not support the specified node type, refer to
PubSub Collection Nodes (XEP-0248)
].)
8.1.3 Create and Configure a Node
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 element MUST follow the element and MUST NOT possess a 'node' attribute, since the value of the element's 'node' attribute specifies the desired NodeID; if any of these rules are violated, the service MUST return a error.
Example 137.
Entity requests a new node with non-default configuration.
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='create1'>





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

Princely Musings (Atom)
1
1
1
10
604800
open
publishers
0
never
false
headline
0
0
0
0
1028
urn:example:e2ee:bundle

http://jabxslt.jabberstudio.org/atom_body.xslt





Example 138.
Service replies with success
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='create1'/>
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.
8.2 Configure a Node
After creating a new node, the node owner may want to modify the node configuration. Support for this feature is RECOMMENDED.
8.2.1 Request
Example 139.
Owner requests configuration form
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='config1'>




8.2.2 Success Case
If no error occurs, the server MUST return a configuration form to the node owner, which SHOULD contain the current node configuration as the default values.
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.
Example 140.
Service responds with configuration form
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='config1'>




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

label='A friendly name for the node'/>
label='Whether to deliver event notifications'>
true

label='Whether to deliver payloads with event notifications'>
true

label='Notify subscribers when the node configuration changes'>
0

label='Notify subscribers when the node is deleted'>
false

label='Notify subscribers when items are removed from the node'>
false

label='Notify owners about new subscribers and unsubscribes'>
0

label='Persist items to storage'>
1

label='Max # of items to persist. `max` for no specific limit other than a server imposed maximum.'>
10

label='Time after which to automatically purge items. `max` for no specific limit other than a server imposed maximum.'>
604800

label='Whether to allow subscriptions'>
1

label='Specify the subscriber model'>





open

label='Roster groups allowed to subscribe'>





label='Specify the publisher model'>



publishers

label='Purge all items when the relevant publisher goes offline?'>
0

label='Max Payload size in bytes'>
1028

label='When to send the last published item'>



never

label='Deliver event notifications only to available users'>
0

label='Specify the delivery style for event notifications'>


headline

label='Specify the semantic type of payload data to be provided at this node.'>
urn:example:e2ee:bundle

label='Payload XSLT'/>




8.2.3 Error Cases
There are several reasons why the node configuration request might fail:
The service does not support node configuration.
The requesting entity does not have sufficient privileges to configure the node.
The request did not specify a node.
The node has no configuration options.
The specified node does not exist.
These error cases are described more fully in the following sections.
8.2.3.1 Node Configuration Not Supported
If the service does not support node configuration, the service MUST return a error, specifying a pubsub-specific error condition of and a feature of "config-node".
Example 141.
Service does not support node configuration
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='config1'>


feature='config-node'/>


8.2.3.2 Insufficient Privileges
If the requesting entity does not have sufficient privileges to configure the node, the service MUST respond with a error.
Example 142.
Requesting entity is prohibited from configuring this node
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='config1'>




8.2.3.3 NodeID Required
If the request did not specify a node, the service SHOULD return a 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 instead of .
Example 143.
Request did not specify a node
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='config1'>





8.2.3.4 No Configuration Options
If no configuration options are available (e.g., because node configuration is "locked down"), the service MUST return a error to the owner.
Example 144.
Node has no configuration options
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='config1'>




8.2.3.5 Node Does Not Exist
If the node does not exist, the service MUST return an error.
Example 145.
Node does not exist
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='config1'>




8.2.4 Form Submission
After receiving the configuration form, the owner SHOULD submit a completed configuration form. Note that the
rules of XEP-0004 for incomplete submission form handling
apply.
Example 146.
Owner submits node configuration form
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='config2'>




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

Princely Musings (Atom)
1
1
1
10
604800
roster

friends
servants
courtiers

publishers
0
never
false
headline
0
0
0
0
1028
urn:example:e2ee:bundle

http://jabxslt.jabberstudio.org/atom_body.xslt





Alternatively, the owner MAY cancel the configuration process, in which case the existing configuration MUST be applied.
Example 147.
Owner cancels configuration process
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='config2'>






8.2.5 Form Processing
8.2.5.1 Success
If the form can be successfully processed, the service MUST return an IQ-result.
Example 148.
Service replies with success
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='config2'/>
8.2.5.2 Failure
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 error to the owner.
Example 149.
Configuration change cannot be processed
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='config2'>




8.2.5.3 Success With Notifications
If the "pubsub#notify_config" option is set to true, the service MUST notify subscribers of the configuration change. (A service SHOULD support this option for leaf nodes.) If the node configuration is set to notification-only, the notification MUST consist of an empty element whose 'node' attribute is set to the NodeID of the node; if the node configuration is set to full payloads, the element MUST in addition contain the node configuration as represented via the
Data Forms
protocol.
Example 150.
Service sends configuration change notification (event notification only)





Example 151.
Service sends configuration change notification (full payload)





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

Princely Musings (Atom)
1
1
0
0
0
0
1
10
604800
1
open
publishers
0
9216
never
0
headline
urn:example:e2ee:bundle

http://jabxslt.jabberstudio.org/atom_body.xslt





8.3 Request Default Node Configuration Options
An entity may 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.
8.3.1 Request
To get the node options, the entity MUST send an empty element to the service with no NodeID; in response, the service SHOULD return the default node options.
Example 152.
Entity requests default node configuration options
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='def1'>




8.3.2 Request
A service may support several node types. The default configuration for each node type may be different. To request the node options that are specific to a particular node type, the entity MAY include an attribute named 'type' in the . The value of this attribute MUST be a node-type. If the attribute is not provided, the service MUST return the configuration for the 'leaf' type.
Example 153.
Entity requests default node configuration options
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='def1collection'>




8.3.3 Success Case
If no error occurs, the service MUST return the default node configuration options.
Example 154.
Service responds with default node configuration options
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='def1'>




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

label='A friendly name for the node'/>
label='Deliver event notifications'>
true

label='Deliver payloads with event notifications'>
1

label='A description of the node'/>
label='Notify subscribers when the node configuration changes'>
0

label='Notify subscribers when the node is deleted'>
0

label='Notify subscribers when items are removed from the node'>
0

label='Notify owners about new subscribers and unsubscribes'>
0

label='Persist items to storage'>
1

label='Max # of items to persist. `max` for no specific limit other than a server imposed maximum.'>
10

label='Time after which to automatically purge items. `max` for no specific limit other than a server imposed maximum.'>
604800

label='Whether to allow subscriptions'>
1

label='Specify the subscriber model'>





open

label='Roster groups allowed to subscribe'>





label='Specify the publisher model'>



publishers

label='Purge all items when the relevant publisher goes offline?'>
0

label='Max payload size in bytes'>
9216

label='When to send the last published item'>



never

label='Deliver notifications only to available users'>
0

label='Specify the delivery style for notifications'>


headline





8.3.4 Error Cases
There are several reasons why the default node configuration options request might fail:
The service does not support node configuration.
The service does not support retrieval of default node configuration.
These error cases are described more fully in the following sections.
8.3.4.1 Node Configuration Not Supported
If the service does not support node configuration, it MUST return a error, specifying a pubsub-specific error condition of and a feature of "config-node".
Example 155.
Service does not support node configuration
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='def1'>


feature='config-node'/>


8.3.4.2 Default Node Configuration Retrieval Not Supported
If the service does not support retrieval of default node configuration options, it MUST return a error, specifying a pubsub-specific error condition of and a feature of "retrieve-default".
Example 156.
Service does not support retrieval of default node configuration options
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='def1'>


feature='retrieve-default'/>


8.4 Delete a Node
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.
8.4.1 Request
In order to delete a node, a node owner MUST send a node deletion request, consisting of a element whose 'node' attribute specifies the NodeID of the node to be deleted.
Example 157.
Owner deletes a node
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='delete1'>




The deletion request MAY include the URI of a replacement node to which requests might be redirected. Typically this is an XMPP URI or IRI as described under
PubSub URIs
, but it can be an HTTP URI or any other scheme.
Example 158.
Owner deletes a node with redirection
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='delete1'>






Support for redirection is OPTIONAL on the part of pubsub services.
8.4.2 Success Case
If no error occurs, the service MUST inform the owner of success.
Example 159.
Service replies with success
from='pubsub.shakespeare.lit'
id='delete1'/>
In addition, the service MUST also send notification of node deletion to all subscribers (which SHOULD include pending and unconfigured subscriptions).
Example 160.
Subscribers are notified of node deletion













8.4.3 Error Cases
There are several reasons why the node deletion request might fail:
The requesting entity does not have sufficient privileges to delete the node.
The node is the root collection node, which cannot be deleted (see
PubSub Collection Nodes (XEP-0248)
]).
The specified node does not exist.
These error cases are described more fully in the following sections.
8.4.3.1 Insufficient Privileges
If the requesting entity does not have sufficient privileges to delete the node (e.g., is not an owner), the service MUST return a error.
Example 161.
Entity is not an owner
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='delete1'>




8.4.3.2 Node Does Not Exist
If the requesting entity attempts to delete a node that does not exist, the service MUST return an error.
Example 162.
Owner attempts to delete a non-existent node
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='delete1'>




8.5 Purge All Node Items
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). It is OPTIONAL for a service to implement this feature.
8.5.1 Request
In order to purge a node of all items, a node owner sends a node purge request consisting of a element whose 'node' attribute specifies the NodeID of the node to be purged.
Example 163.
Owner purges all items from a node
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='purge1'>




8.5.2 Success Case
If no error occurs, the service MUST purge the node and inform the owner of success.
Example 164.
Service replies with success
from='pubsub.shakespeare.lit'
id='purge1'/>
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 child element.
Example 165.
Subscribers are notified of node purge









8.5.3 Error Cases
There are several reasons why the node purge request might fail:
The node or service does not support node purging.
The requesting entity does not have sufficient privileges to purge the node.
The node is not configured to persist items.
The specified node does not exist.
These error cases are described more fully in the following sections.
8.5.3.1 Node Purging Not Supported
If the node or service does not support node purging, it MUST return a error, specifying a pubsub-specific error condition of and a feature of "purge-nodes".
Example 166.
Service does not support node purging
from='pubsub.shakespeare.lit'
to='hamlet@denmark.lit/elsinore'
id='purge1'>


feature='purge-nodes'/>


8.5.3.2 Insufficient Privileges
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 error.
Example 167.
Entity is not an owner
from='pubsub.shakespeare.lit'
id='purge1'>




8.5.3.3 Node Does Not Persist Items
If the service or node does not persist items (e.g., because the node is a collection node as described in
PubSub Collection Nodes (XEP-0248)
]), it MUST return a error, specifying a pubsub-specific error condition of and a feature of "persistent-items".
Example 168.
Node is not configured for persistent items
from='pubsub.shakespeare.lit'
id='purge1'>


feature='persistent-items'/>


8.5.3.4 Node Does Not Exist
If the node does not exist, the service MUST return an error.
Example 169.
Node does not exist
from='pubsub.shakespeare.lit'
id='purge1'>




8.6 Manage Subscription Requests
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 and the JID of the pending subscriber. The message MAY include a element that contains natural-language text explaining that the message contains a pending subscription form.
Example 170.
Service sends authorization request to node owner


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

label='Allow this JID to subscribe to this pubsub node?'>
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.
Example 171.
Owner approves subscription request



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


123-abc


princely_musings


horatio@denmark.lit


true



The service then SHOULD notify the approved subscriber (see the
Notification of Subscription State Changes
section of this document).
Example 172.
Subscription approval notification
from='pubsub.shakespeare.lit'
to='horatio@denmark.lit'
id='approvalnotify1'>




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.
Example 173.
Owner denies subscription request



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


123-abc


princely_musings


horatio@denmark.lit


false



The service then SHOULD notify the denied subscriber (see the
Notification of Subscription State Changes
section of this document).
Example 174.
Subscription cancellation / denial notification
from='pubsub.shakespeare.lit'
to='horatio@denmark.lit'
id='unsubnotify1'>




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



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.
8.7 Process Pending Subscription Requests
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
Ad-Hoc Commands (XEP-0050)
22
] protocol, where the command name ('node' attribute of the command element) MUST have a value of "http://jabber.org/protocol/pubsub#get-pending".
8.7.1 Request
Example 176.
Owner requests pending subscription requests
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='pending1'>
node='http://jabber.org/protocol/pubsub#get-pending'
action='execute'/>

8.7.2 Success Case
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 "pubsub#node" whose


node='http://www.chatopus.com/#2.2'
ver='1FDrLLbYMpzvcI95jgSHABSWDRY='/>

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):
Example 214.
Account server queries contact
to='nurse@capulet.lit/chamber'
type='get'
id='disco123'>

to='juliet@capulet.lit'
type='result'
id='disco123'>











The server shall also query the identity+features for :
Example 215.
Account server queries contact
to='romeo@montague.lit/orchard'
type='get'
id='disco234'>

to='juliet@capulet.lit'
type='result'
id='disco234'>








(As noted in
Entity Capabilities (XEP-0115)
23
], 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 and (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 .
If Juliet publishes a geolocation item to the roster-access "http://jabber.org/protocol/geoloc" node with the "pubsub#roster_groups_allowed" variable set to a value of "Friends", her server will send notifications only to because the nurse is not in that roster group.
10.
Feature Summary
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: Except for the first entry, 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.
Table 7:
Service Discovery Features
Name
Description
Support
Section
Identification for generic pubsub capabilities.
RECOMMENDED
Discover Features
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
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-items
Deletion of items is supported.
RECOMMENDED
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 Subscriptions
member-affiliation
The member affiliation is supported.
RECOMMENDED
Affiliations
meta-data
Node metadata is supported.
RECOMMENDED
modify-affiliations
Node owners may modify affiliations.
OPTIONAL
Manage Affiliations
multi-items
The service supports the storage of multiple items per node. It requires the pubsub#max_items configuration item to be exposed to the user and allows sensible values (higher than one) to be set in
Configure a Node
OPTIONAL
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.
RECOMMENDED
Publish an Item to a Node
publish-options
Publishing an item with options is supported.
OPTIONAL
Publishing Options
publish-only-affiliation
The publish-only affiliation is supported.
OPTIONAL
Affiliations
publisher-affiliation
The publisher affiliation is supported.
RECOMMENDED
Affiliations
publish-node-full
Specified behaviour may happen when publishing on a full node.
OPTIONAL
Retracting an item
and
Rejecting an item
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 Node Configuration Options
retrieve-default-sub
Retrieval of default subscription configuration is supported.
OPTIONAL
Request Default Subscription 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
Subscribing and unsubscribing are supported.
RECOMMENDED
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
11.
Error Conditions
Table 8:
Error conditions and typical causes
Condition
Description

The node already exists, or is full. See
pubsub#publish_node_full

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.

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".

The node or item specified for some operation does not exist.

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.

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.

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).

Entities are required to register before node creation is allowed.
Note: Refer to
Error Condition Mappings (XEP-0086)
28
] for more information regarding error syntax.
12.
Implementation Notes
12.1 Data Model
When implementing this protocol, it is often helpful to consider the data model behind it. Note that this section describes such a conceptual model for informational purposes only and does not define any requirements about how, where or in what format an implementation actually stores data.
A persistent pubsub node may be viewed as an ordered key-value store, where the ItemIDs are the keys, and the item payloads are the values.
The order of items is publication order, such that the most recently published is the “newest”. This holds true even if publishing with an ItemID that already exists on the node: the older item is dropped to preserve uniqueness of keys. This is sometimes referred to as “overwriting” in this document.
The order is of most importance when the max_items option is used to limit the number of items on the node. When the limit is reached, the oldest item may be dropped from the node according to the configured policy (see the
publish_node_full
option).
If published ItemIDs are always unique, a persistent node may also be viewed as a kind of “first in, first out” (FIFO) queue.
12.2 Notification Triggers
There are many possible triggers for sending an event notification to an entity for the currently published item or the last published item, as summarized below:
The entity explicitly requests one or more items from the node and is authorized to retrieve items; when the service receives such a request, it sends the items to the entity.
The entity is an authorized subscriber to the node (explicitly via subscription or implicitly based on a role of owner or publisher); when the publisher sends a publish request, the service sends the currently published item to the entity (subject to presence checks and notification filtering if appropriate).
The entity is not subscribed but is eligible to do so and has sent presence containing appropriate entity capabilities data to a service that supports filtered notifications (effectively establishing a "temporary subscription" based on an expressed notification interest); when the service first receives such presence, it sends the last published item to the entity (sending it only once upon first receiving such presence, not on subsequent presence updates that contain the same notification interest).
The entity is not subscribed but is eligible to do so and has sent presence containing appropriate entity capabilities data to a service that supports filtered notifications (effectively establishing a "temporary subscription"); when the publisher sends a publish request that matches the entity's expressed notification interest, the service sends the currently published item to the entity.
The entity gains access to the node because of a change to the node access model; as a result, the service sends the last published item to the entity.
The entity is added to the roster group associated with a node access model of "roster"; as a result, the service sends the last published item to the entity.
12.3 Intended Recipients for Notifications
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).
12.4 Handling Notification-Related Errors
As noted above, a pubsub service SHOULD ensure that the stanza for each event notification it generates possesses an 'id' attribute with a 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
10
] and
Error Condition Mappings (XEP-0086)
28
] regarding XMPP error condition semantics):
If the XMPP error is of type "cancel" (e.g., ), or the error condition is , 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., ) or "wait" (e.g., ), or the error condition is , , or , 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.
12.5 Temporary Subscriptions
An implementation MAY enable an entity to subscribe to a node temporarily, i.e., only for as long as the subscriber is online in its current presence session. To subscribe temporarily, the subscriber MUST set the "pubsub#expire" subscription configuration option to a literal value of "presence".
Example 216.
A Temporary Subscription
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='lease3'>




http://jabber.org/protocol/pubsub#subscribe_options

...
presence
...




The service will then automatically cancel the subscription when it receives presence of type "unavailable" from the subscriber.
An implementation MAY enable the node owner to force all subscriptions to be temporary, which is useful for nodes that are also configured to use presence-based delivery. This setting uses the "pubsub#tempsub" node configuration option set to a value of true.
Example 217.
Owner sets all subscriptions to temporary
from='hamlet@denmark.lit/elsinore'
to='pubsub.shakespeare.lit'
id='configtemp'>




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

true




12.6 Presence-Based Delivery of Events
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.
12.7 Not Routing Events to Offline Storage
Sending events to users of existing XMPP servers may force event notifications to be routed to offline storage for later delivery (as described in
Best Practices for Handling Offline Messages (XEP-0160)
29
]). 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
Advanced Message Processing (XEP-0079)
30
].
Specify a message type of "headline", which in most existing server implementations will prevent offline storage.
12.8 Including a Message Body
If a service understands the semantics for a particular payload type and an entity's subscription is so configured (by the "pubsub#include_body" subscription option to true), the service SHOULD include an appropriate XMPP 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

element (see
RFC 4287
]) could be mapped to the XMPP 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. This XSLT is applied by the pubsub service after receiving a publish request and before sending the appropriate notifications, not by the client before sending a publish request.
If the service does not understand the semantics for a particular payload type and therefore cannot transform the payload into a human-readable message body, it SHOULD NOT include a child.
If a subscriber has multiple subscriptions to the same node, where some of the SubIDs have include_body set to true and others have include_body set to false, the service SHOULD include a body with all notifications.
12.9 Node ID and Item ID Uniqueness
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.
12.10 Item Caching
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: Particular profiles of the generic publish-subscribe protocol MAY define more stringent requirements regarding the "cache-last-item" feature.
12.11 Batch Processing
A publisher MAY include multiple elements in a publish request and MAY include multiple 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 and the service MUST NOT publish or retract any of the items.
If a batch publish contains so many items that publication of all the items would exceed the maximum number of items for the node, the service MUST return a error, which SHOULD also include a pubsub-specific error condition of .
Note: 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.
12.12 Auto-Subscribing Owners and Publishers
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.
12.13 Authorizing Subscription Requests (Pending Subscribers)
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
Best Practices for Handling Offline Messages (XEP-0160)
29
]) 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.
12.14 Notification of Subscription State Changes
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 element with a single child that specifies the node, JID, and subscription state. The notification MAY contain a element specifying natural-language text regarding the subscription change. The JID to which the service sends the notification is the address that was set in the 'jid' attribute of the subscription request. Examples are shown below.
Example 218.
Subscription approval notification
from='pubsub.shakespeare.lit'
to='horatio@denmark.lit'
id='approvalnotify1'>




Example 219.
Subscription cancellation / denial notification
from='pubsub.shakespeare.lit'
to='horatio@denmark.lit'
id='unsubnotify1'>




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.
12.15 NodeID Semantics
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 as described in
PubSub Collection Nodes (XEP-0248)
].
12.16 Inclusion of SHIM Headers
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 (refer to
PubSub Collection Nodes (XEP-0248)
]).
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.
12.17 Associating Events and Payloads with the Generating Entity
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
User Geolocation (XEP-0080)
24
], 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 the "itemreply" node configuration option, with three possible values:
"owner" (i.e., the node owner or an alias for the node owners)
"publisher" (i.e., the item publisher)
"none"
A node owner MUST NOT define more than one of these options.
Interoperability note: As of March 2023, the value of "owner" is not widely supported in generic implementations, and clients may choose to avoid it. In contrast, the value of "none" was not specified in previous versions of this document but has been added retrospectively due to implementation support. Therefore, the primary use of the 'pubsub#itemreply' option is to allow node owners to determine whether the server will
include a 'publisher' attribute in items or not
The JID associated with an item is conveyed via the 'publisher' attribute on the element, as demonstrated in the below example:
Example 220.
Event notification with publisher JID
to='bassanio@merchantofvenice.lit'>


publisher='portia@merchantofvenice.lit'>

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
Personal Eventing Protocol (XEP-0163)
].
12.18 Chaining
The word "chaining" refers to the practice of subscribing one node to another node. For instance, consider a scenario in which the node wants to distribute information received from the node "NewsFeed" at . While it is theoretically possible for 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 rather than ).
12.19 Time-Based Subscriptions (Leases)
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
XMPP Date and Time Profiles (XEP-0082)
31
]).
The leasing process is shown below.
Example 221.
Leasing process
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='lease1'>

node='princely_musings'
jid='francisco@denmark.lit'/>

from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='lease1'>

node='princely_musings'
jid='francisco@denmark.lit'
subscription='unconfigured'>





from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='lease2'>



from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='lease2'>




http://jabber.org/protocol/pubsub#subscribe_options

...
label='Requested lease period'/>
...



from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='lease3'>




http://jabber.org/protocol/pubsub#subscribe_options

...
2006-02-28T11:59:59Z
...



from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='lease3'/>
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 MUST be done by sending a containing a element qualified by the 'http://jabber.org/protocol/pubsub#event' namespace and including an 'expiry' attribute.
Example 222.
Service notifies subscriber of impending lease end


expiry='2006-02-28T23:59:59Z'
jid='francisco@denmark.lit'
node='princely_musings'
subid='ba49252aaa4f5d320c24d3766f0bdcade78c78d3'
subscription='subscribed'/>


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.
Example 223.
Renewing a lease
from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='renew1'>



from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='renew1'>




http://jabber.org/protocol/pubsub#subscribe_options

...
label='Requested lease period'/>
...



from='francisco@denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='renew2'>




http://jabber.org/protocol/pubsub#subscribe_options

...
2006-03-31T23:59:59Z
...



from='pubsub.shakespeare.lit'
to='francisco@denmark.lit/barracks'
id='renew2'/>
12.20 Content-Based Pubsub Systems
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 'XMPP'"). 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. [
32
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.
Example 224.
A content-based subscription
from='bard@shakespeare.lit/globe'
to='pubsub.shakespeare.lit'
id='filter1'>

node='princely_musings'
jid='francisco@denmark.lit'/>

from='pubsub.shakespeare.lit'
to='bard@shakespeare.lit/globe'
id='filter1'>

node='princely_musings'
jid='bard@shakespeare.lit'
subid='991d7fd1616fd041015064133cd097a10030819e'
subscription='unconfigured'>





from='bard@shakespeare.lit/globe'
to='pubsub.shakespeare.lit'
id='filter2'>

jid='bard@shakespeare.lit'
subid='991d7fd1616fd041015064133cd097a10030819e'/>

from='pubsub.shakespeare.lit'
to='bard@shakespeare.lit/globe'
id='filter2'>

jid='bard@shakespeare.lit'
subid='991d7fd1616fd041015064133cd097a10030819e'>


http://jabber.org/protocol/pubsub#subscribe_options

...
type='text-single'
label='Keyword to match'/>
...



from='bard@shakespeare.lit/globe'
to='pubsub.shakespeare.lit'
id='filter3'>

jid='bard@shakespeare.lit'
subid='991d7fd1616fd041015064133cd097a10030819e'>


http://jabber.org/protocol/pubsub#subscribe_options

...
peasant
...



from='pubsub.shakespeare.lit'
to='bard@shakespeare.lit/globe'
id='filter3'/>
The subscriber will then be notified about events that match the keyword.
Example 225.
Event notification for matched keyword





Alone


Now I am alone.
O, what a rogue and peasant slave am I!

href='http://denmark.lit/2003/12/13/atom03'/>
tag:denmark.lit,2003:entry-32396
2003-12-13T11:09:53Z
2003-12-13T11:09:53Z





991d7fd1616fd041015064133cd097a10030819e



12.21 Singleton Nodes
For some nodes, it is desirable to have at most one item associated with the node at any one time (for example, a client may want to store its preferences using a node name that is a namespace controlled by that client). When this pattern is desired, it is RECOMMENDED for the publisher to specify an ItemID of "current" to ensure that the publication of a new item will overwrite the existing item.
Example 226.
Publishing to a Singleton Node
from='horatio@denmark.lit/mobile'
to='pubsub.shakespeare.lit'
id='single1'>






Naturally, the node owner can enforce the singleton node pattern by setting the max_items configuration option to "1".
12.22 PubSub URIs
An XMPP URI (see
RFC 5122
33
]) can be used for the purpose of identification or interaction. Some examples are provided below.
The following URI merely identifies a pubsub node.
Example 227.
XMPP URI for a node
xmpp:pubsub.shakespeare.lit?;node=princely_musings
The following URI identifies a specific item at a node.
Example 228.
XMPP URI for a pubsub item
xmpp:pubsub.shakespeare.lit?;node=princely_musings;item=ae890ac52d0df67ed7cfdf51b644e901
The following URI defines how to subscribe to a node (for details, see the
URI Query Types
section of this document).
Example 229.
URI for subscribing to a pubsub node
xmpp:pubsub.shakespeare.lit?pubsub;action=subscribe;node=princely_musings
The following URI defines how to retrieve a specific item from a node.
Example 230.
URI for retrieving a pubsub item
xmpp:pubsub.shakespeare.lit?pubsub;action=retrieve;node=princely_musings;item=ae890ac52d0df67ed7cfdf51b644e901
12.23 Integration with Data Forms
This section defines a datatype "integer-or-max" to be used with
Data Forms Validation (XEP-0122)
34
]. An implementation may use this type to validate fields such as "pubsub#children_max", "pubsub#item_expire" or "pubsub#max_items".














The meaning of a value of this type is defined in each field named above.
When the
element
is used in combination with this datatype, it applies to the integer value.
13.
Internationalization Considerations
13.1 Field Labels
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.
14.
Security Considerations
14.1 Private Information
The data published to a pubsub node might contain sensitive information (e.g., a user's geolocation). Therefore, node owners SHOULD exercise care in approving subscription requests. Security considerations regarding particular kinds of information are the responsibility of the "using protocol".
14.2 Authorization
XMPP PubSub contains a hierarchy of affiliations for the purpose of authorization and access control. 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.
14.3 Access Models
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.
14.4 Presence Leaks
In the context of instant messaging systems it is possible for the act of publishing an item to reveal the node owner or item publisher's network availability. However, this risk is mitigated by the following factors:
A node does not necessarily reveal the existence of the publishing entity.
XMPP PubSub systems are not necessarily tied to instant messaging systems.
Even in the context of IM systems, a node provides information distinct from network availability (e.g., user tunes).
Even then, the actual publisher might not be an IM user (e.g., an automated calendaring or geolocation system).
15.
IANA Considerations
This document does not require interaction with the
Internet Assigned Numbers Authority (IANA)
35
].
16.
XMPP Registrar Considerations
16.1 Protocol Namespaces
The
XMPP Registrar
36
] includes the following namespaces in its registry of protocol namespaces (see <
>):
16.2 Service Discovery Category/Type
The XMPP Registrar includes a category of "pubsub" in its registry of Service Discovery identities (see <
>), as well as two specific types within that category:
Table 9:
Service Discovery Types in Pubsub Category
leaf
A pubsub node of the "leaf" type as described in XEP-0060.
service
A pubsub service that supports the functionality defined in XEP-0060. [
37
The registry submission is as follows:

pubsub
Services and nodes that adhere to 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.
16.3 Service Discovery Features
The XMPP Registrar maintains a registry of service discovery features (see <
>), 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
Identification for generic pubsub capabilities
XEP-0060


http://jabber.org/protocol/pubsub#access-authorize
The default node access model is authorize.
XEP-0060


http://jabber.org/protocol/pubsub#access-open
The default node access model is open.
XEP-0060


http://jabber.org/protocol/pubsub#access-presence
The default node access model is presence.
XEP-0060


http://jabber.org/protocol/pubsub#access-roster
The default node access model is roster.
XEP-0060


http://jabber.org/protocol/pubsub#access-whitelist
The default node access model is whitelist.
XEP-0060


http://jabber.org/protocol/pubsub#auto-create
The service supports automatic creation of nodes on first publish.
XEP-0060


http://jabber.org/protocol/pubsub#auto-subscribe
The service supports automatic subscription to a nodes based on presence subscription.
XEP-0060


http://jabber.org/protocol/pubsub#config-node
Configuration of node options is supported.
XEP-0060


http://jabber.org/protocol/pubsub#config-node-max
Server supports `max` being set as a value for node configuration options: pubsub#max_items, pubsub#item_expire and pubsub#children_max
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-items
Deletion of items is supported.
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-0060


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-0060


http://jabber.org/protocol/pubsub#leased-subscription
Time-based subscriptions are supported.
XEP-0060


http://jabber.org/protocol/pubsub#manage-subscriptions
Node owners may manage subscriptions.
XEP-0060


http://jabber.org/protocol/pubsub#member-affiliation
The member affiliation is supported.
XEP-0060


http://jabber.org/protocol/pubsub#meta-data
Node metadata is supported.
XEP-0060


http://jabber.org/protocol/pubsub#modify-affiliations
Node owners may modify affiliations.
XEP-0060


http://jabber.org/protocol/pubsub#multi-items
The service supports the storage of multiple items per node.
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#presence-subscribe
Implicit presence-based subscriptions are 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#publish-only-affiliation
The publish-only affiliation is supported.
XEP-0060


http://jabber.org/protocol/pubsub#publisher-affiliation
The publisher affiliation is supported.
XEP-0060


http://jabber.org/protocol/pubsub#publish-node-full
Specified behaviour may happen when publishing on a full node.
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-default-sub
Retrieval of default subscription 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

16.4 Field Standardization
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 <
>). Within pubsub, there are four uses of such forms:
Authorization of subscriptions using the 'http://jabber.org/protocol/pubsub#subscribe_authorization' namespace.
Configuration of subscription options using the 'http://jabber.org/protocol/pubsub#subscribe_options' namespace.
Configuration of a node using the 'http://jabber.org/protocol/pubsub#node_config' namespace.
Setting of metadata 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
Field Standardization for Data Forms (XEP-0068)
14
], names of custom (unregistered) fields MUST begin with the characters "x-" if the form itself is scoped by a registered FORM_TYPE.
16.4.1 pubsub#subscribe_authorization FORM_TYPE

http://jabber.org/protocol/pubsub#subscribe_authorization
XEP-0060
Forms enabling authorization of subscriptions to pubsub nodes
var='pubsub#allow'
type='boolean'
label='Whether to allow the subscription'/>
var='pubsub#node'
type='text-single'
label='The NodeID of the relevant node'/>
var='pubsub#subscriber_jid'
type='jid-single'
label='The address (JID) of the subscriber'/>
var='pubsub#subid'
type='text-single'
label='The subscription identifier associated with the subscription request'/>

16.4.2 pubsub#subscribe_options FORM_TYPE

http://jabber.org/protocol/pubsub#subscribe_options
XEP-0060
Forms enabling configuration of subscription options for pubsub nodes
var='pubsub#deliver'
type='boolean'
label='Whether an entity wants to receive
or disable notifications'/>
var='pubsub#digest'
type='boolean'
label='Whether an entity wants to receive digests
(aggregations) of notifications or all
notifications individually'/>
type='text-single'
label='The minimum number of milliseconds between
sending any two notification digests'/>
var='pubsub#expire'
type='text-single'
label='The DateTime at which a leased subscription
will end or has ended'/>
var='pubsub#include_body'
type='boolean'
label='Whether an entity wants to receive an XMPP
message body in addition to the payload
format'/>
var='pubsub#show-values'
type='list-multi'
label='The presence states for which an entity
wants to receive notifications'>






type='list-single'>



type='list-single'>




16.4.3 pubsub#meta-data FORM_TYPE

http://jabber.org/protocol/pubsub#meta-data
XEP-0060
Forms enabling setting of metadata information about pubsub nodes
type='jid-multi'
label='The JIDs of those to contact with questions'/>
type='text-single'
label='The datetime when the node was created'/>
type='jid-single'
label='The JID of the node creator'/>
type='text-single'
label='A description of the node'/>
type='list-single'
label='The default language of the node'/>
type='list-single'
label='Access model'/>
type='list-single'
label='Publish model'/>
type='text-single'
label='The number of subscribers to the node'/>
type='jid-multi'
label='The JIDs of those with an affiliation of owner'/>
type='jid-multi'
label='The JIDs of those with an affiliation of publisher'/>
type='text-single'
label='The name of the node'/>
type='text-single'
label='Payload semantic type information'/>
type='text-single'
label='Max # of items to persist'/>

16.4.4 pubsub#node_config FORM_TYPE

http://jabber.org/protocol/pubsub#node_config
XEP-0060
Forms enabling configuration of pubsub nodes
type='list-single'
label='Who may subscribe and retrieve items'>






type='text-single'
label='The URL of an XSL transformation which can be
applied to payloads in order to generate an
appropriate message body element.'/>
type='jid-multi'
label='The JIDs of those to contact with questions'/>
type='text-single'
label='The URL of an XSL transformation which can be
applied to the payload format in order to generate
a valid Data Forms result that the client could
display using a generic Data Forms rendering
engine'/>
label='Whether to deliver event notifications'>
true

type='boolean'
label='Whether to deliver payloads with event notifications; applies only to leaf nodes'/>
type='text-single'
label='A description of the node'/>
type='text-single'
label='Number of seconds after which to automatically purge items. `max` for no specific limit other than a server imposed maximum.'/>
type='list-single'
label='Whether owners or publisher should receive replies to items'>



type='list-single'
label='The default language of the node'/>
type='text-single'
label='The maximum number of items to persist. `max` for no specific limit other than a server imposed maximum.'/>
type='text-single'
label='The maximum payload size in bytes'/>
type='list-single'
label='Whether the node is a leaf (default)'>


label='Specify the delivery style for notifications'>



type='boolean'
label='Whether to notify subscribers when the node configuration changes'/>
type='boolean'
label='Whether to notify subscribers when the node is deleted'/>
type='boolean'
label='Whether to notify subscribers when items are removed from the node'/>
type='boolean'
label='Whether to notify owners about new subscribers and unsubscribes'/>
type='boolean'
label='Whether to persist items to storage'/>
type='boolean'
label='Whether to deliver notifications to available users only'/>
type='list-single'
label='The publisher model'>




type='list-single'
label='Action to be performed by the service when publishing on a full node.'>




type='boolean'
label='Whether to purge all items when the relevant publisher goes offline'/>
type='list-multi'
label='The roster group(s) allowed to subscribe and retrieve items'/>
type='list-single'
label='When to send the last published item'>




type='boolean'
label='Whether to make all subscriptions temporary, based on subscriber presence'/>
label='Whether to allow subscriptions'>
1

type='text-single'
label='A friendly name for the node'/>
type='text-single'
label='The semantic type information of data in the node, usually specified
by the namespace of the payload (if any)'/>

16.5 SHIM Headers
The XMPP Registrar includes "SubID" in its registry of SHIM headers (see <
>). The registry submission is as follows:

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.
16.6 URI Query Types
As authorized by
XMPP URI Query Components (XEP-0147)
38
], the XMPP Registrar maintains a registry of queries and key-value pairs for use in XMPP URIs (see <
>).
The "pubsub" querytype is defined herein for interaction with pubsub services, with three keys: (1) "action" (whose defined values are "subscribe", "unsubscribe", and "retrieve"), (2) "node" (to specify a pubsub node), and optionally "item" (to specify a particular item at a node).
Example 231.
Pubsub Subscribe Action: IRI/URI
xmpp:pubsub.shakespeare.lit?pubsub;action=subscribe;node=princely_musings
Example 232.
Pubsub Subscribe Action: Resulting Stanza





Example 233.
Pubsub Unsubscribe Action: IRI/URI
xmpp:pubsub.shakespeare.lit?pubsub;action=unsubscribe;node=princely_musings
Example 234.
Pubsub Unsubscribe Action: Resulting Stanza





Example 235.
Pubsub Retrieve Action: IRI/URI
xmpp:pubsub.shakespeare.lit?pubsub;action=retrieve;node=princely_musings
Example 236.
Pubsub Retrieve Action: Resulting Stanza





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


retrieve
enables retrieving a specific item from a pubsub node




node
the pubsub node


item
the pubsub item



16.7 Data Forms Validation Datatypes
The following datatype shall be registered for use with Data Forms Validation:
Data Forms Validation Datatypes Registry Submission

integer-or-max

Datatype used for text-single fields where the accepted value is
either an integer or the string "max".

XEP-0060

17.
XML Schemas
17.1 http://jabber.org/protocol/pubsub

xmlns:xs='http://www.w3.org/2001/XMLSchema'
xmlns:xdata='jabber:x:data'
targetNamespace='http://jabber.org/protocol/pubsub'
xmlns='http://jabber.org/protocol/pubsub'
elementFormDefault='qualified'>



The protocol documented by this schema is defined in
XEP-0060: http://xmpp.org/extensions/xep-0060.html

namespace='jabber:x:data'
schemaLocation='http://xmpp.org/schemas/x-data.xsd'/>


















































































































































































17.2 http://jabber.org/protocol/pubsub#errors

xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://jabber.org/protocol/pubsub#errors'
xmlns='http://jabber.org/protocol/pubsub#errors'
elementFormDefault='qualified'>



This namespace is used for error reporting only, as
defined in XEP-0060:





















































































17.3 http://jabber.org/protocol/pubsub#event

xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://jabber.org/protocol/pubsub#event'
xmlns='http://jabber.org/protocol/pubsub#event'
elementFormDefault='qualified'>



The protocol documented by this schema is defined in
XEP-0060: http://xmpp.org/extensions/xep-0060.html

namespace='jabber:x:data'
schemaLocation='http://xmpp.org/schemas/x-data.xsd'/>




















































































































17.4 http://jabber.org/protocol/pubsub#owner

xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://jabber.org/protocol/pubsub#owner'
xmlns='http://jabber.org/protocol/pubsub#owner'
elementFormDefault='qualified'>



The protocol documented by this schema is defined in
XEP-0060: http://xmpp.org/extensions/xep-0060.html

namespace='jabber:x:data'
schemaLocation='http://xmpp.org/schemas/x-data.xsd'/>
















































use='optional'
default='leaf'>
































































18.
Acknowledgements
Thanks to Kirk Bateman, Robin Collier, Blaine Cook, Ovidiu Craciun, Brian Cully, Dave Cridland, Guillaume Desmottes, Gaston Dombiak, William Edney, Seth Fitzsimmons, Fabio Forno, Nathan Fritz, Julien Genestoux, Anastasia Gornostaeva, Joe Hildebrand, Curtis King, Tuomas Koski, Petri Liimatta, Tobias Markmann, Pedro Melo, Dirk Meyer, Tory Patnoe, Peter Petrov, Sonny Piers, Christophe Romain, Pavel Šimerda, Andy Skelton, Kevin Smith, Chris Teegarden, Simon Tennant, Matt Tucker, Melvin Vermeeren, Matthew Wild, Bob Wyman, Matus Zamborsky, and Brett Zamir for their feedback.
19.
Author Note
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.
Appendices
Appendix A: Document Information
Series
XEP
Number
0060
Publisher
XMPP Standards Foundation
Status
Stable
Type
Standards Track
Version
1.30.0
2025-11-11
Approving Body
XMPP Council
Dependencies
XMPP Core,
XEP-0004
XEP-0030
XEP-0059
XEP-0068
XEP-0082
XEP-0131
Supersedes
None
Superseded By
None
Short Name
pubsub
Schema
XML Schema for the 'pubsub' namespace: <
XML Schema for the 'pubsub#errors' namespace: <
XML Schema for the 'pubsub#event' namespace: <
XML Schema for the 'pubsub#owner' namespace: <
Source Control
HTML
This document in other formats:
XML
PDF
Appendix B: Author Information
Peter Millard
See
Author Note
Peter Saint-Andre
Email
stpeter@stpeter.im
JabberID
stpeter@jabber.org
URI
Ralph Meijer
Email
ralphm@ik.nu
JabberID
ralphm@ik.nu
Appendix C: Legal Notices
This XMPP Extension Protocol is copyright © 1999 – 2024 by the
XMPP Standards Foundation
(XSF).
Permissions
Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.
Disclaimer of Warranty
## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##
Limitation of Liability
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.
IPR Conformance
This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <
> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
Visual Presentation
The HTML representation (you are looking at) is maintained by the XSF. It is based on the
YAML CSS Framework
, which is licensed under the terms of the
CC-BY-SA 2.0
license.
Appendix D: Relation to XMPP
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
Appendix E: Discussion Venue
There exists a special venue for discussion related to the technology described in this document: the <
pubsub@xmpp.org
> mailing list.
The primary venue for discussion of XMPP Extension Protocols is the <
standards@xmpp.org
> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <
> for a complete list.
Errata can be sent to <
editor@xmpp.org
>.
Appendix F: Requirements Conformance
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
"MAY", and "OPTIONAL" in this document are to be interpreted as
described in
BCP 14
RFC2119
RFC8174
] when,
and only when, they appear in all capitals, as shown here.
Appendix G: Notes
. RFC 4287: The Atom Syndication Format <
>.
. RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core <
>.
. XEP-0030: Service Discovery <
>.
. XEP-0248: PubSub Collection Nodes <
>.
. XEP-0163: Personal Eventing Protocol <
>.
. RFC 3921: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <
>.
. XEP-0045: Multi-User Chat <
>.
. These nodes are equivalent to those used in
XEP-0030: Service Discovery
. This rule does not apply to the root collection node, if any.
10
. RFC 3920: Extensible Messaging and Presence Protocol (XMPP): Core <
>.
11
. XEP-0055: Jabber Search <
>.
12
. XEP-0004: Data Forms <
>.
13
. XEP-0128: Service Discovery Extensions <
>.
14
. XEP-0068: Field Data Standardization for Data Forms <
>.
15
. XEP-0203: Delayed Delivery <
>.
16
. In accordance with Section 3.2.2.1 of
XML Schema Part 2: Datatypes
, the allowable lexical representations for the xs:boolean datatype are the strings "0" and "false" for the concept 'false' and the strings "1" and "true" for the concept 'true'; implementations MUST support both styles of lexical representation.
17
. XEP-0059: Result Set Management <
>.
18
. XEP-0313: Message Archive Management <
>.
19
. The inclusion of more than one element is no longer allowed, given the removal of batch publishing from version 1.13 of this specification.
20
. It is not necessary for a publication request to include a payload or even an element in order to trigger an event notification. For example, the result of publishing to a transient, notification-only node will be an event notification that does not include even an element. However, for the sake of convenience we refer to the act of publication as "publishing an item" (rather than, say, "triggering an event notification") even though a publication request will not always contain an element.
21
. XEP-0131: Stanza Headers and Internet Metadata <
>.
22
. XEP-0050: Ad-Hoc Commands <
>.
23
. XEP-0115: Entity Capabilities <
>.
24
. XEP-0080: User Geolocation <
>.
25
. XEP-0118: User Tune <
>.
26
. XEP-0108: User Activity <
>.
27
. Including, say, the 'http://jabber.org/protocol/geoloc' NodeID indicates that the client understands the geolocation namespace described in
User Geolocation (XEP-0080)
25
], whereas including the 'http://jabber.org/protocol/geoloc+notify' namespace indicates that the client wishes to receive notifications related to geolocation, where the NodeID is the same as the geolocation namespace 'http://jabber.org/protocol/geoloc' (in this case there is a one-to-one correspondence between the namespace name and the NodeID).
28
. XEP-0086: Error Condition Mappings <
>.
29
. XEP-0160: Best Practices for Handling Offline Messages <
>.
30
. XEP-0079: Advanced Message Processing <
>.
31
. XEP-0082: XMPP Date and Time Profiles <
>.
32
. 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.
33
. RFC 5122: Internationalized Resource Identifiers (IRIs) and Uniform Resource Identifiers (URIs) for the Extensible Messaging and Presence Protocol (XMPP) <
>.
34
. XEP-0122: Data Forms Validation <
>.
35
. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <
>.
36
. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <
>.
37
. Prior to version 1.5 of XEP-0060, this type was called "generic".
38
. XEP-0147: XMPP URI Query Components <
>.
Appendix H: Revision History
Note: Older versions of this specification might be available at
Version
1.30.0
(2025-11-11)
Describe the 'http://jabber.org/protocol/pubsub' disco#info feature.
gdk
Version
1.29.0
(2025-11-11)
Update Feature Summary with sections 6.1.3.10 and 7.1.3.2 by marking 'subscribe' and 'publish' disco#info features as non-mandatory.
gdk
Version
1.28.0
(2025-09-11)
Reduce 'Discover Nodes' section to not include hierarchy / Collection Nodes
Recommend JID+NodeID addressing when 'node' attribute is available
Move the Service Discovery Identity type 'collection' from XEP-0060 to XEP-0248
Move collection-specific Service Discovery Features from XEP-0060 to XEP-0248
Move process for changing node of type leaf to collection from XEP-0060 to XEP-0248
Remove reference to non-existing process for retrieving the default subscription configuration options for collection nodes
Move requirement to support pubsub#notify_config for collection nodes from XEP-0060 to XEP-0248
Remove collection-specific pubsub#node_config FORM_TYPE field standardization that is duplicated in XEP-0248
Remove pubsub#collection SHIM header registration as its registration is duplicated in XEP-0248
gdk
Version
1.27.0
(2025-09-11)
Add section on retrieving default node configuration that's specific to a particular node type
gdk
Version
1.26.0
(2023-09-07)
Add examples for publishing item without ID
melvo
Version
1.25.0
(2023-03-22)
Add data model informational text in Implementation Notes.
Provide a way for a PubSub service to tell a client when a node is full.
Clarify behaviour and current usage of the 'pubsub#itemreply' option.
Fix spec approver
mw, pep
Version
1.24.1
(2022-01-21)
Add hint for processing incomplete submission forms
melvo
Version
1.24.0
(2022-01-21)
Advertise support and fix typo:
Advertise support for publishing items
Replace 'allow' with 'allows'
melvo
Version
1.23.0
(2022-01-14)
Clarify (redefine) pubsub#type field.
edhelas, pep
Version
1.22.1
(2021-12-26)
Fix indentation to be consistent.
egp
Version
1.22.0
(2021-09-07)
Remove exception for last item when purging a node: all items must be removed.
jp
Version
1.21.0
(2021-08-03)
Revert change from version 1.15.5 which changed meta-data to metadata in wire protocol. That was an unintended breaking change which has now been reverted.
pep
Version
1.20.0
(2021-06-08)
Add integer-or-max datatype to use with Data Forms Validation.
pep
Version
1.19.1
(2021-03-04)
Cross-document editorial adjustments for inclusive language.
mw
Version
1.19.0
(2020-08-16)
Add missing 'item' key and 'retrieve' action to query type registry.
ps
Version
1.18.1
(2020-08-25)
Fix trivial typo
lnjx
Version
1.18.0
(2020-02-27)
Properly specifiy that an empty is invalid on publish.
jsc
Version
1.17.0
(2019-10-06)
Clarify node config behaviour with regards to unlimited behaviour for fields that specify a maximum.
dg
Version
1.16.0
(2019-09-11)
Add a pubsub#rsm disco#info feature to clear confusion
edhelas
Version
1.15.8
(2019-06-19)
Add pubsub#access_model and pubsub#publish_model to examples
edhelas
Version
1.15.7
(2019-01-27)
Add 'publisher' attribute to in the http://jabber.org/protocol/pubsub schema, forgotten in revision 1.13.
egp
Version
1.15.6
(2018-11-22)
Correct several "entity element(s)" to " element(s)" (mw)
Remove unused and never defined 'node' attribute in pubsub#event item schema. This had been added in version 1.8 of the JEP, but never used. (egp)
jsc (Editor)
Version
1.15.5
(2018-11-03)
Fix a bunch of typos, batch-style.
pep
Version
1.15.4
(2018-08-11)
Add example where fewer than the number of requested items are returned.
egp
Version
1.15.3
(2018-08-18)
Add a new sentence and example about what to do if there are fewer items than requested present in a node.
egp
Version
1.15.2
(2018-05-14)
Fix a few things in the schema:
Remove duplicated element.
Make ’s node attribute optional.
Add a missing optional dataform in .
egp
Version
1.15.1
(2018-02-02)
Add missing "retrieve-default-sub" feature to the XML Schema
sc
Version
1.15.0
(2017-12-12)
Specify that unregistered publish-options are mapped 1:1 to node configurations
Get rid of per-item OVERRIDE
Get rid of METADATA publish-options
Remove registration for the obsolete pubsub#access_model publish-options
dg
Version
1.14
(2017-11-29)
Add pubsub#multi-items to features.
jt
Version
1.13.8
(2017-10-10)
Add missing dependency on XEP-0059.
fs (XEP Editor: jwi)
Version
1.13.7
(2017-08-24)
Fix examples using invalid XEP-0082 dates.
egp
Version
1.13.6
(2017-06-22)
Clarify behaviour of publish-options. Fields must be registered
dg
Version
1.13.5
(2016-12-21)
Add missing options to schema.
psa (XEP Editor: ssw)
Version
1.13.4
(2016-12-02)
Make Multiple Simultaneous Modifications examples consistent with text.
psa
Version
1.13.3
(2016-12-08)
Include publisher with any item retrieval.
ss (XEP Editor: ssw)
Version
1.13.2
(2016-10-11)
Be more consistent with reply.
ss (XEP Editor: ssw)
Version
1.13.1
(2016-07-21)
Fix wording, replace Jabber with XMPP where applicable.
ss
Version
1.13
(2010-07-12)
Pending further discussion: added but then removed change to allow notifications via IQ stanzas; removed but then retained batch publishing; removed but then retained SubIDs in subscription approvals.
Corrected a large number of reported errata.
Removed delete-any feature.
Added missing delete-items feature.
Added special value of "presence" for the pubsub#expire option to support temporary subscriptions.
Removed replyto and replyroom config options.
Removed multiple node discovery since it depended on the deprecated Service Discovery Publishing feature.
Defined "room" value for itemreply config option.
Added optional 'publisher' attribute to element.
Added optional child to element.
Based redirects on URIs for consistency with RFC 6120 gone and redirect errors.
Clarified meaning of filtered notifications (they are based on NodeIDs, not payload namespaces).
Added pubsub-on-a-jid service discovery feature for explicit discovery that an IM and presence account also functions as a virtual pubsub service.
Added purge_offline node configuration option for purging the node when the relevant publisher goes offline, for use in certain extended presence applications.
Added item_expire node configuration option for automatically removing items after a certain number of seconds.
Added notification_type node configuration option for defining which value of the type attribute shall be used for notifications.
Added retrieve-default-sub feature for retrieving default subscription configuration from a node (as you can retrieve default node configuration from the service).
Clarified suggested rules for payload definitions.
Mentioned that singleton pattern can be enforced by setting max_items to 1.
Removed the notion of batch publishing because it makes information coherence and atom handling excessively difficult.
Added error handling for too-many-subscriptions to help prevent a certain denial of service attack.
Added process for retrieving default subscription configuration options for leaf nodes, by omitting the 'node' attribute on the element (also added the element to the schema for the http://jabber.org/protocol/pubsub namespace, since it was missing).
Removed informational mapping of node metadata to Dublin Core.
psa
Version
1.12
(2008-09-03)
Specified that service should return ItemID on successful publish if no ItemID was provided in request.
Described the use of Result Set Management to return some but not all published items.
Defined pubsub#notify_sub config option so that owners can receive notifications of new subscriptions, unsubscribes, and other subscription changes.
Harmonized definition of +notify feature with implementation reality.
Moved text about collections to XEP-0248.
psa
Version
1.11
(2008-03-05)
For collection nodes, changed name of node child element to associate and added disassociate child element to handle disassociation use case; corrected SHIM examples to conform to XEP-0131; modified lease expiry notification for consistency with other subscription-related notifications (i.e., not using SHIM header); renamed SHIM headers to Collection and SubID for consistency with HTTP and Email headers.
rm/psa
Version
1.10
(2007-09-26)
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
Defined member affiliation to properly implement whitelist feature
Split several long sections into smaller sub-sections.
Clarified that a pubsub service must generate an ItemID if the publisher does not provide one.
Specified recommended ItemID for singleton nodes.
Summarized triggers for sending notifications.
psa
Version
1.9
(2006-09-13)
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.
psa
Version
1.8
(2006-06-27)
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 element to 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 plus feature attribute
Changed some error conditions from to
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 , , , and elements qualified by pubsub#owner namespace
Changed retrieval of default node configuration options to use element, not element
Allowed caching of last published item
Added pubsub#deliver subscription option
Added metadata fields for pubsub#owners and pubsub#contact
Changed element for retrieval of default node configuration options from to 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
psa
Version
1.7
(2005-03-03)
Reinstated pubsub#subscribe feature (deleted in error)
Added type attribute for the and 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 metadata (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 error to 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
psa/rm
Version
1.6
(2004-07-13)
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.
pgm/psa
Version
1.5
(2004-07-07)
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.
pgm/psa
Version
1.4
(2004-06-22)
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.
pgm
Version
1.3
(2004-04-25)
Editorial review; added one implementation note.
psa
Version
1.2
(2004-03-09)
Added XMPP error handling.
psa
Version
1.1
(2004-01-14)
Added XMPP Registrar Considerations subsection for Service Discovery category/type registration.
psa
Version
1.0
(2003-10-28)
Per a vote of the Jabber Council, advanced status to Draft.
psa
Version
0.16
(2003-10-23)
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.
pgm
Version
0.15
(2003-10-21)
Fixed invalid XML in examples for subscription deny/allow.
pgm
Version
0.14
(2003-10-21)
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.
pgm
Version
0.13
(2003-09-30)
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.
pgm
Version
0.12
(2003-08-13)
Defined public vs. private nodes; described how changes to existing nodes might trigger meta-node events (e.g., configuration changes); changed to for #events namespace; added metadata about meta-nodes; fully defined XMPP Registrar considerations.
pgm/psa
Version
0.11
(2003-06-25)
Removed subscription notifications since they have inherent issues. Removed empty implementation note sub-section.
pgm
Version
0.10
(2003-06-11)
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.
pgm
Version
0.9
(2003-04-30)
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.
pgm
Version
0.8
(2003-04-03)
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.
pgm
Version
0.7
(2003-02-14)
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.
pgm
Version
0.6
(2003-02-06)
Added more details and an example about publishing without NodeID. Added more implementation notes about NodeIDs and persistent storage.
pgm
Version
0.5
(2003-01-22)
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.
pgm
Version
0.4
(2003-01-21)
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.
pgm
Version
0.3
(2003-01-20)
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 node configuration example.
pgm
Version
0.2
(2003-01-02)
Added numerous implementation notes; added get-pending action with regard to subscriptions; added error table; changed purge and delete to use IQ type='set'.
pgm
Version
0.1
(2002-11-19)
Initial version.
pgm
Appendix I: Bib(La)TeX Entry
@report{millard2002pubsub,
title = {Publish-Subscribe},
author = {Millard, Peter and Saint-Andre, Peter and Meijer, Ralph},
type = {XEP},
number = {0060},
version = {1.30.0},
institution = {XMPP Standards Foundation},
url = {https://xmpp.org/extensions/xep-0060.html},
date = {2002-11-19/2025-11-11},
END