Class: connectionObj

.appObj. connectionObj

new connectionObj()

Source:

Classes

connectionRoomObj

Members

<static> connectionObj.events

Expose all event functions
Source:

<static> connectionObj.util

Expose all utility functions
Source:

Methods

<static> connectionObj.emitRoomDataDelta(isLeavingAllRooms, callback)

Emits the roomData message with a clientListDelta for the current connection to other connections in rooms this connection is in. Note: To send listDetas for individual rooms, use connectionRoomObj.emitRoomDataDelta
Parameters:
Name Type Description
isLeavingAllRooms Boolean Indicator if connection is leaving all rooms. Meant to be used upon disconnection / logoff.
callback Object Callback of form (err, roomDataObj) which will contain the roomDataObj including all updated rooms of the connection and is designed to be returnable to the connection.
Source:

<static> connectionObj.generateRoomClientList(roomStatus, roomMap, callback)

Generates a full room clientList object for the given connection
Parameters:
Name Type Argument Default Description
roomStatus string <optional>
<nullable>
"join" Room status which allow for values of "join"|"update"|"leave".
roomMap Object <nullable>
Map of rooms to generate connection clientList for. If null, then all rooms will be used.
callback Object Callback which includes a formed roomData object .
Source:

<static> connectionObj.generateRoomDataDelta(isLeavingRoom, callback)

Generates a delta roomData object for the current user including all rooms the user is in. The result can be selectively parsed to deliver delta roomData objects to other clients.
Parameters:
Name Type Description
isLeavingRoom Boolean Indicates if connection is in the process of leaving the room.
callback Object Callback of form (err, roomDataDelta).
Source:

<static> connectionObj.generateRoomList(callback)

Generates the roomList message object
Parameters:
Name Type Description
callback function Callback with error and roomList object.
Source:

<static> connectionObj.getApp() → {Object}

Returns the application object to which the connection belongs. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Source:
Returns:
The application object
Type
Object

<static> connectionObj.getAppName() → {string}

Returns the application name for the application to which the connection belongs. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Source:
Returns:
The application name
Type
string

<static> connectionObj.getEasyrtcid() → {string}

Returns the easyrtcid for the connection. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Source:
Returns:
Returns the connection's easyrtcid, which is the EasyRTC unique identifier for a socket connection.
Type
string

<static> connectionObj.getField(Field, callback)

Returns connection level field object for a given field name.
Parameters:
Name Type Description
Field string name
callback function Callback with error and field value (any type)
Source:

<static> connectionObj.getFields(limitToIsShared, callback)

Returns an object containing all field names and values within the connection. Can be limited to fields with isShared option set to true.
Parameters:
Name Type Description
limitToIsShared boolean Limits returned fields to those which have the isShared option set to true.
callback function Callback with error and object containing field names and values.
Source:

<static> connectionObj.getRoomNames(callback)

Returns an array of all room names which connection has entered.
Parameters:
Name Type Description
callback function Callback with error and array of room names.
Source:

<static> connectionObj.getSession() → {Object}

Returns the session object to which the connection belongs (if one exists). Returns a null if connection is not attached to a session (such as when sessions are disabled). Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Source:
Returns:
The session object. May be null if connection has not been joined to a session.
Type
Object

<static> connectionObj.isAuthenticated()

Gets connection authentication status for the connection. It is possible for a connection to become disconnected and keep the authenticated flag. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Source:
Returns:
Boolean Authentication status

<static> connectionObj.isConnected()

Gets connection status for the connection. It is possible for a connection to be considered connected without being authenticated. Note that unlike most EasyRTC functions, this returns a value and does not use a callback.
Source:
Returns:
Boolean Connection status

<static> connectionObj.isInRoom(roomName, callback)

Returns a boolean to the callback indicating if connection is in a given room
Parameters:
Name Type Description
roomName string Room name which uniquely identifies a room within an EasyRTC application.
callback function Callback with error and a boolean indicating if connection is in a room..
Source:

<static> connectionObj.joinRoom(roomName, callback)

Joins an existing room, returning a room object. Returns null if room can not be joined.
Parameters:
Name Type Description
roomName string Room name which uniquely identifies a room within an EasyRTC application.
callback function Callback with error and object containing EasyRTC connection room object (same as calling room(roomName))
Source:

<static> connectionObj.joinSession(isAuthenticated, next)

Sets connection authentication status for the connection.
Parameters:
Name Type Description
isAuthenticated Boolean True/false as to if the connection should be considered authenticated.
next nextCallback A success callback of form next(err).
Source:

<static> connectionObj.removeConnection(next)

Removes a connection object. Does not (currently) remove connection from rooms or groups.
Parameters:
Name Type Description
next nextCallback A success callback of form next(err).
Source:

<static> connectionObj.room(roomName, callback)

Gets room object for a given room name. Returns null if room not found. The returned room object includes functions for managing room fields.
Parameters:
Name Type Description
roomName string Room name which uniquely identifies a room within an EasyRTC application.
callback function Callback with error and object containing EasyRTC connection room object.
Source:

<static> connectionObj.setAuthenticated(isAuthenticated, next)

Sets connection authentication status for the connection.
Parameters:
Name Type Description
isAuthenticated Boolean True/false as to if the connection should be considered authenticated.
next nextCallback A success callback of form next(err).
Source:

<static> connectionObj.setCredential(credential, next)

Sets the credential for the connection.
Parameters:
Name Type Argument Description
credential * <nullable>
Credential for the connection. Can be any JSONable object.
next nextCallback A success callback of form next(err).
Source:

<static> connectionObj.setField(fieldName, fieldValue, fieldOption, next)

Sets connection field value for a given field name.
Parameters:
Name Type Argument Description
fieldName string Must be formatted according to "fieldNameRegExp" option.
fieldValue Object
fieldOption Object <nullable>
Field options (such as isShared which defaults to false)
next nextCallback <optional>
A success callback of form next(err). Possible err will be instanceof (ApplicationWarning).
Source:

<static> connectionObj.setPresence(presenceObj, next)

Sets the presence object for the connection.
Parameters:
Name Type Description
presenceObj Object A presence object.
next nextCallback A success callback of form next(err).
Source:

<static> connectionObj.setUsername(username, next)

Sets the username string for the connection.
Parameters:
Name Type Argument Description
username string <nullable>
Username to assign to the connection.
next nextCallback A success callback of form next(err).
Source: