Class Index | Minimal

Classes


Class jabberwerx.PrivateStorageController


Extends jabberwerx.Controller.

Controller class for dealing with private storage functionality.

Class Summary
Constructor Attributes Constructor Name and Description
 

Creates a new PrivateStorageController with the given client.

Fields borrowed from class jabberwerx.Controller:
client, name
Method Summary
Method Attributes Method Name and Description
 

Destroys private storage controller.

 
fetch(ename, callback)

Fetches a private storage data and invokes the callback function passing it received xml element or error encountered.

 
remove(ename)

Clears private storage data.

 
update(private_elm)

Updates the server with new private storage data.

Methods borrowed from class jabberwerx.Controller:
cleanupEntity, 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
Class Detail
jabberwerx.PrivateStorageController(client)

Creates a new PrivateStorageController with the given client.

Parameters:
{jabberwerx.Client} client
The client object to use for communicating to the server
Throws:
{TypeError}
If {client} is not an instance of jabberwerx.Client
Method Detail
destroy()

Destroys private storage controller.


fetch(ename, callback)

Fetches a private storage data and invokes the callback function passing it received xml element or error encountered.

Parameters:
{String} ename
Ename string for the privacy storage element.
{function} callback
The function called after the server response is processed. If a server error occurs, the function will be passed the error stanza response.

The signature of the function is callback(private_data, errorStanza).

The callback will be invoked in the context of the PrivateStorageController e.g. callback.call(this, private_data, errorStanza). Therefore in the callback method this will refer to the instance of PrivateStorageController and so this.client will retrieve the jabberwerx.Client object.

Throws:
{TypeError}
If {ename} is not a properly formatted ename element.
{jabberwerx.Client.NotConnectedError}
If the jabberwerx.Client is not connected

remove(ename)

Clears private storage data.

Parameters:
{String} ename
Ename string for the privacy storage element.
Throws:
{TypeError}
If {ename} is not a properly formatted ename element.

update(private_elm)

Updates the server with new private storage data.

Parameters:
{Element} private_elm
Document element.
Throws:
{TypeError}
If {private_elm} is undefined or not a document element.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 02 2014 13:23:42 GMT-0600 (MDT)