Known implementations: wokkel.pubsub.PubSubService

Interface for an XMPP Publish Subscribe Service.

All methods that are called as the result of an XMPP request are to return a deferred that fires when the requested action has been performed. Alternatively, exceptions maybe raised directly or by calling errback on the returned deferred.

Method notifyPublish Send out notifications for a publish event.
Method notifyDelete Send out node deletion notifications.
Method publish Called when a publish request has been received.
Method subscribe Called when a subscribe request has been received.
Method unsubscribe Called when a subscribe request has been received.
Method subscriptions Called when a subscriptions retrieval request has been received.
Method affiliations Called when a affiliations retrieval request has been received.
Method create Called when a node creation request has been received.
Method getConfigurationOptions Retrieve all known node configuration options.
Method getDefaultConfiguration Called when a default node configuration request has been received.
Method getConfiguration Called when a node configuration retrieval request has been received.
Method setConfiguration Called when a node configuration change request has been received.
Method items Called when a items retrieval request has been received.
Method retract Called when a item retraction request has been received.
Method purge Called when a node purge request has been received.
Method delete Called when a node deletion request has been received.
def notifyPublish(service, nodeIdentifier, notifications): (source)

Send out notifications for a publish event.

ParametersserviceThe entity the notifications will originate from. (type: JID)
nodeIdentifierThe identifier of the node that was published to. (type: unicode)
notificationsThe notifications as tuples of subscriber, the list of subscriptions and the list of items to be notified. (type: list of (JID, list of Subscription, list of Element))
def notifyDelete(service, nodeIdentifier, subscribers, redirectURI=None): (source)

Send out node deletion notifications.

ParametersserviceThe entity the notifications will originate from. (type: JID)
nodeIdentifierThe identifier of the node that was deleted. (type: unicode)
subscribersThe subscribers for which a notification should be sent out. (type: list of JID)
redirectURIOptional XMPP URI of another node that subscribers are redirected to. (type: str)
def publish(requestor, service, nodeIdentifier, items): (source)

Called when a publish request has been received.

ParametersrequestorThe entity the request originated from. (type: JID)
serviceThe entity the request was addressed to. (type: JID)
nodeIdentifierThe identifier of the node to publish to. (type: unicode)
itemsThe items to be published as elements. (type: list of Element<twisted.words.xish.domish.Element>)
Returnsdeferred that fires on success. (type: Deferred)
def subscribe(requestor, service, nodeIdentifier, subscriber): (source)

Called when a subscribe request has been received.

ParametersrequestorThe entity the request originated from. (type: JID)
serviceThe entity the request was addressed to. (type: JID)
nodeIdentifierThe identifier of the node to subscribe to. (type: unicode)
subscriberThe entity to be subscribed. (type: JID)
ReturnsA deferred that fires with a Subscription. (type: Deferred)
def unsubscribe(requestor, service, nodeIdentifier, subscriber): (source)

Called when a subscribe request has been received.

ParametersrequestorThe entity the request originated from. (type: JID)
serviceThe entity the request was addressed to. (type: JID)
nodeIdentifierThe identifier of the node to unsubscribe from. (type: unicode)
subscriberThe entity to be unsubscribed. (type: JID)
ReturnsA deferred that fires with None when unsubscription has succeeded. (type: Deferred)
def subscriptions(requestor, service): (source)

Called when a subscriptions retrieval request has been received.

ParametersrequestorThe entity the request originated from. (type: JID)
serviceThe entity the request was addressed to. (type: JID)
ReturnsA deferred that fires with a list of subscriptions as Subscription. (type: Deferred)
def affiliations(requestor, service): (source)

Called when a affiliations retrieval request has been received.

ParametersrequestorThe entity the request originated from. (type: JID)
serviceThe entity the request was addressed to. (type: JID)
ReturnsA deferred that fires with a list of affiliations as tuples of (node identifier as unicode, affiliation state as str). The affiliation can be 'owner', 'publisher', or 'outcast'. (type: Deferred)
def create(requestor, service, nodeIdentifier): (source)

Called when a node creation request has been received.

ParametersrequestorThe entity the request originated from. (type: JID)
serviceThe entity the request was addressed to. (type: JID)
nodeIdentifierThe suggestion for the identifier of the node to be created. If the request did not include a suggestion for the node identifier, the value is None. (type: unicode or NoneType)
ReturnsA deferred that fires with a unicode that represents the identifier of the new node. (type: Deferred)
def getConfigurationOptions(): (source)

Retrieve all known node configuration options.

The returned dictionary holds the possible node configuration options by option name. The value of each entry represents the specifics for that option in a dictionary:

  • 'type' (str): The option's type (see Field's doc string for possible values).
  • 'label' (unicode): A human readable label for this option.
  • 'options' (dict): Optional list of possible values for this option.

Example:

   {
   "pubsub#persist_items":
       {"type": "boolean",
        "label": "Persist items to storage"},
   "pubsub#deliver_payloads":
       {"type": "boolean",
        "label": "Deliver payloads with event notifications"},
   "pubsub#send_last_published_item":
       {"type": "list-single",
        "label": "When to send the last published item",
        "options": {
            "never": "Never",
            "on_sub": "When a new subscription is processed"}
       }
   }
Returns (type: dict.)
def getDefaultConfiguration(requestor, service, nodeType): (source)

Called when a default node configuration request has been received.

ParametersrequestorThe entity the request originated from. (type: JID)
serviceThe entity the request was addressed to. (type: JID)
nodeTypeThe type of node for which the configuration is retrieved, 'leaf' or 'collection'. (type: str)
ReturnsA deferred that fires with a dict representing the default node configuration. Keys are strs that represent the field name. Values can be of types unicode, int or bool. (type: Deferred)
def getConfiguration(requestor, service, nodeIdentifier): (source)

Called when a node configuration retrieval request has been received.

ParametersrequestorThe entity the request originated from. (type: JID)
serviceThe entity the request was addressed to. (type: JID)
nodeIdentifierThe identifier of the node to retrieve the configuration from. (type: unicode)
ReturnsA deferred that fires with a dict representing the node configuration. Keys are strs that represent the field name. Values can be of types unicode, int or bool. (type: Deferred)
def setConfiguration(requestor, service, nodeIdentifier, options): (source)

Called when a node configuration change request has been received.

ParametersrequestorThe entity the request originated from. (type: JID)
serviceThe entity the request was addressed to. (type: JID)
nodeIdentifierThe identifier of the node to change the configuration of. (type: unicode)
ReturnsA deferred that fires with None when the node's configuration has been changed. (type: Deferred)
def items(requestor, service, nodeIdentifier, maxItems, itemIdentifiers): (source)

Called when a items retrieval request has been received.

ParametersrequestorThe entity the request originated from. (type: JID)
serviceThe entity the request was addressed to. (type: JID)
nodeIdentifierThe identifier of the node to retrieve items from. (type: unicode)
def retract(requestor, service, nodeIdentifier, itemIdentifiers): (source)

Called when a item retraction request has been received.

ParametersrequestorThe entity the request originated from. (type: JID)
serviceThe entity the request was addressed to. (type: JID)
nodeIdentifierThe identifier of the node to retract items from. (type: unicode)
def purge(requestor, service, nodeIdentifier): (source)

Called when a node purge request has been received.

ParametersrequestorThe entity the request originated from. (type: JID)
serviceThe entity the request was addressed to. (type: JID)
nodeIdentifierThe identifier of the node to be purged. (type: unicode)
def delete(requestor, service, nodeIdentifier): (source)

Called when a node deletion request has been received.

ParametersrequestorThe entity the request originated from. (type: JID)
serviceThe entity the request was addressed to. (type: JID)
nodeIdentifierThe identifier of the node to be delete. (type: unicode)
API Documentation for wokkel, generated by pydoctor at 2018-12-06 14:45:46.