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).
Constructor Attributes | Constructor Name and Description |
---|---|
jabberwerx.Controller(client, name)
Creates a new jabberwerx.Controller with the given owning client.
|
Field Attributes | Field Name and Description |
---|---|
The client object that is used to manage roster API calls
|
|
The name of this controller.
|
Method Attributes | Method Name and Description |
---|---|
cleanupEntity(entity)
Cleanup the given entity on behalf of the client's entity cache jabberwerx.EntitySet. |
|
destroy()
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
- 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.
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
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()).
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
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