Class Index | Minimal

Classes


Class jabberwerx.Controller (MINIMAL)


Extends jabberwerx.JWModel.

Abstract base class for all controller types.

All controller types have a unique simple name (e.g. "roster" for the RosterController, or "capabilities" for the CapabilitiesController).

Class Summary
Constructor Attributes Constructor Name and Description
 
jabberwerx.Controller(client, name)
Creates a new jabberwerx.Controller with the given owning client.
Field Summary
Field Attributes Field Name and Description
 
The client object that is used to manage roster API calls
 
The name of this controller.
Method Summary
Method Attributes Method Name and Description
 
cleanupEntity(entity)

Cleanup the given entity on behalf of the client's entity cache jabberwerx.EntitySet.

 

Destroys this Controller.

 
removeEntity(entity)

Users should not call this method directly.

 
updateEntity(entity)

Users should not call this method directly.

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.Controller(client, name)
Creates a new jabberwerx.Controller with the given owning client. This method sets the name and client for this Controller, and stores it in the jabberwerx.Client#controllers hashtable.
Parameters:
{jabberwerx.Client} client
The owning client
{String} name
The common name for this controller
Throws:
{TypeError}
if {client} is not the correct type, or if {name} is not a non-empty string.
Field Detail
{jabberwerx.Client} client
The client object that is used to manage roster API calls

{String} name
The name of this controller.
Method Detail
cleanupEntity(entity)

Cleanup the given entity on behalf of the client's entity cache jabberwerx.EntitySet.

Users should not call this method directly.

Subclasses SHOULD override this method and use it to destroy the given entity. Controllers MAY choose to leave the entity in the cache between sessions (pubsub nodes), this is the behavior by default. This method is called just prior to the clientStatusChanged status_disconnected event. It is called once for each entity the controller owns (the controller used during the entity's creation {@link jabberwerx.Entity#init).

NOTE - This method is called within a batch update jabberwerx.Entity.EntitySet#startBatch.

Parameters:
{jabberwerx.Entity} entity
The entity to cleanup and destroy

destroy()

Destroys this Controller. This method deletes this controller from its owning client.

Subclasses SHOULD override this method to perform any additional cleanup (e.g. removing event callbacks), but MUST call the superclass' implementation (this._super()).


{jabberwerx.Entity} removeEntity(entity)

Users should not call this method directly. Instead, call jabberwerx.Entity#remove.

Parameters:
{jabberwerx.Entity} entity
The entity to remove
Throws:
{TypeError}
if entity is not an instance of Jabberwerx.Entity
Returns:
{jabberwerx.Entity} deleted entity

{jabberwerx.Entity} updateEntity(entity)

Users should not call this method directly. Instead, call jabberwerx.Entity#update.

Parameters:
{jabberwerx.Entity} entity
The entity to update
Throws:
{TypeError}
if entity is not an instance of Jabberwerx.Entity
Returns:
{jabberwerx.Entity} updated entity

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