Class Index | Minimal

Classes


Class jabberwerx.ClientEntityCache (MINIMAL)


Extends jabberwerx.EntitySet.

The client's collection of entities. This is the central repositories for entities within a client.

This class provides the following events:

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
 
localUser(jid)
Factory method for jabberwerx.LocalUser objects.
 
register(entity)
Registers the given entity to this cache.
 
server(serverDomain)
Factory method for jabberwerx.Server objects.
 
Factory method for jabberwerx.TemporaryEntity objects.
 
unregister(entity)
Unregisters the given entity from this cache.
Methods borrowed from class jabberwerx.JWModel:
applyEvent, event, shouldBeSavedWithGraph
Methods borrowed from class jabberwerx.JWBase:
destroy, getClassName, graphUnserialized, init, invocation, shouldBeSerializedInline, toString, wasUnserialized, willBeSerialized
Class Detail
jabberwerx.ClientEntityCache()
Method Detail
{jabberwerx.LocalUser} localUser(jid)
Factory method for jabberwerx.LocalUser objects. If a local object for the passed JID already exists, that object is returned instead of a new object.
Parameters:
{jabberwerx.JID|String} jid
The JID for this user.
Throws:
{TypeError}
if {jid} is not a valid JID
{jabberwerx.EntitySet.EntityAlreadyExistsError}
if an entity for {jid} already exists, but is not a LocalUser
Returns:
{jabberwerx.LocalUser} A LocalUser for the given arguments

register(entity)
Registers the given entity to this cache. This method overrides the base class to:

  1. Validate that another entity matching {entity} is not already registered (throwing a jabberwerx.EntitySet.EntityAlreadyExistsError).
  2. trigger the "entityCreated" event if this cache was changed as a result of this call
Parameters:
{jabberwerx.Entity} entity
The entity to register

{jabberwerx.Server} server(serverDomain)
Factory method for jabberwerx.Server objects. If a local object for the passed JID already exists, that object is returned instead of a new object.
Parameters:
{String} serverDomain
The domain for this server, eg, "jabber.com".
Throws:
{TypeError}
if serverDomain is not a valid JID
{jabberwerx.EntitySet.EntityAlreadyExistsError}
if an entity for {serverDomain} already exists, but is not a Server.
Returns:
{jabberwerx.Server} A Server for the given arguments

{jabberwerx.TemporaryEntity} temporaryEntity(jid)
Factory method for jabberwerx.TemporaryEntity objects. If a local object for the passed JID already exists, that object is returned instead of a new object.
Parameters:
{jabberwerx.JID|String} jid
The JID of the temporary entity object to get or create.
Throws:
{TypeError}
if {jid} is not a valid JID
{jabberwerx.EntitySet.EntityAlreadyExistsError}
if an entity for {jid} already exists, but is not a TemporaryEntity
Returns:
{jabberwerx.TemporaryEntity} A TemporaryEntity for the given JID

unregister(entity)
Unregisters the given entity from this cache. This method overrides the base class to trigger the "entityDestroyed" event.
Parameters:
{jabberwerx.Entity} entity
The entity to unregister

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