Class Index | Minimal

Classes


Class jabberwerx.MUCOccupantCache


Extends jabberwerx.EntitySet.

The entity cache for MUC room occupants.

This class provides the following events:

Class Summary
Constructor Attributes Constructor Name and Description
 

Creates a new MUCOccupantCache with the given room.

Field Summary
Field Attributes Field Name and Description
 

The owning MUCRoom.

Method Summary
Method Attributes Method Name and Description
 
occupant(nick)

Retrieves the occupant with the given nickname.

 
register(entity)

Registers the given occupant to this cache.

 
rename(entity, njid)

Renames an occupant to the new JID.

 
unregister(entity)

Unregisters the given occupant 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.MUCOccupantCache(room)

Creates a new MUCOccupantCache with the given room.

Parameters:
{jabberwerx.MUCRoom} room
The owning room
Throws:
{TypeError}
if {room} is not a valid MUCRoom
Field Detail
{jabberwerx.MUCRoom} room

The owning MUCRoom.

Method Detail
{jabberwerx.MUCOccupant} occupant(nick)

Retrieves the occupant with the given nickname.

Parameters:
{String} nick
The nickname of the occupant to retrieve
Throws:
{TypeError}
If {nick} is not a non-empty string.
Returns:
{jabberwerx.MUCOccupant} The occupant for {nick}, or undefined if not found.

register(entity)

Registers the given occupant to this cache. This method overrides the base to ensure {entity} is a MUCOccupant, then to trigger the "entityCreated" event once added.

Parameters:
{jabberwerx.MUCOccupant} entity
The occupant to register
Throws:
{TypeError}
If {entity} is not a valid MUCOccupant

rename(entity, njid)

Renames an occupant to the new JID. This method reindexes the given entity to the new JID, then triggers the "entityRenamed" event.

NOTE: This method should not be called directly. Instead, the owning room will call this method when a nickname change is detected.

Parameters:
{jabberwerx.MUCOccupant} entity
The occupant to rename
{jabberwerx.JID|String} njid
The new JID for the occupant

unregister(entity)

Unregisters the given occupant from this cache. This method overrides the base to ensure {entity} is a MUCOccupant, then to trigger the "entityDestroyed" event once removed.

Parameters:
{jabberwerx.MUCOccupant} entity
The occupant to unregister
Throws:
{TypeError}
If {entity} is not a valid MUCOccupant

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