Class jabberwerx.PubSubController
Extends
jabberwerx.Controller.
Controller that provides support for XEP-0060 Publish-Subscribe
Constructor Attributes | Constructor Name and Description |
---|---|
jabberwerx.PubSubController(client, name)
Creates a new PubSubController for the given client. |
- Fields borrowed from class jabberwerx.Controller:
- client, name
Method Attributes | Method Name and Description |
---|---|
cleanupEntity(entity)
Cleanup pubsub nodes on behalf of the client entity set. |
|
destroy()
Destroys this PubSubController and removes any event callbacks it registered. |
|
node(node, jid)
Creates a new PubSubNode object, or returns an existing PubSubNode object, to be used to perform actions on the specified pubsub node hosted on the specified pubsub service. |
- Methods borrowed from class jabberwerx.Controller:
- removeEntity, updateEntity
- Methods borrowed from class jabberwerx.JWModel:
- applyEvent, event, shouldBeSavedWithGraph
- Methods borrowed from class jabberwerx.JWBase:
- getClassName, graphUnserialized, init, invocation, shouldBeSerializedInline, toString, wasUnserialized, willBeSerialized
Creates a new PubSubController for the given client.
NOTE: Only subclasses should specify a value for {name}. Otherwise, only {client} should be passed into this constructor.
- Parameters:
- {jabberwerx.Client} client
- The client object to use for communicating to the server
- {String} name Optional
- The name of this controller (default is "pubsub")
- Throws:
- {TypeError}
- If {client} is not a jabberwerx.Client
Cleanup pubsub nodes on behalf of the client entity set. jabberwerx.EntitySet.
Fired on disconnect when cache is cleared.- Parameters:
- {jabberwerx.Entity} entity
- The entity to destroy
Destroys this PubSubController and removes any event callbacks it registered.
Creates a new PubSubNode object, or returns an existing PubSubNode object, to be used to perform actions on the specified pubsub node hosted on the specified pubsub service.
- Parameters:
- {String} node
- The identifier for the node which must be unique within the pubsub service.
- {jabberwerx.JID|String} jid
- The JID of the pubsub service which hosts this pubsub node
- Throws:
- {TypeError}
- if {node} is not a string.
- {jabberwerx.JID.InvalidJIDError}
- if {jid} is an invalid JID.
- Returns:
- {jabberwerx.PubSubNode} The requested PubSubNode.