Class MessageFactory
This class creates WONDER-compliant messages. Please note that all functions in this class are static, so there is no need to create MessageFactory objects.
Defined in: wonder_full.js.
createAnswerMessage - Creates an Answer message, the connectionDescription field will be empty and has to be filled before sending.
- Parameters:
- {Identity} from
- - The Identity that figures as sender of the message.
- {Identity[]} to
- - The Array of Identity that figures as receiver of the message.
- {string} contextId
- - The contextId of the conversation related to the invitation.
- {ResourceConstraints} constraints
- - The resource constraints for the resources initialized on conversation start.
- {Identity} hosting Optional
- - The host of the conversation (optional). [NOT IMPLEMENTED, by default the host will be the one starting the conversation]
- {Identity[]} connected
- - Array of Identity that are already connected to the conversation. Used to establish the order in the connection flow for multiparty.
- Returns:
- The created Message
createCandidateMessage - Creates a Message containing an ICE candidate
- Parameters:
- {Identity} from
- - The Identity that figures as sender of the message.
- {Identity[]} to
- - The Array of Identity that figures as receiver of the message.
- {string} contextId
- - The contextId of the conversation related to the invitation.
- {string} label
- - The label of the candidate.
- {string} id
- - The id of the candidate.
- {string} candidate
- - The ICE candidate string.
- {boolean} lastCandidate
- - Boolean indicating if the candidate is the last one. If true, include the full SDP in the candidate parameter for compatibility with domains that don't support trickling.
- Returns:
- The created Message
createInvitationMessage - Creates an Invitation message, the connectionDescription field will be empty and has to be filled before sending.
- Parameters:
- {Identity} from
- - The Identity that figures as sender of the message.
- {Identity[]} to
- - The Array of Identity that figures as receiver of the message.
- {string} contextId
- - The contextId of the conversation related to the invitation.
- {ResourceConstraints} constraints
- - The resource constraints for the resources initialized on conversation start.
- {string} conversationURL Optional
- - The URL of the conversation (optional).
- {string} subject Optional
- - The subject of the conversation. (optional).
- {Identity} hosting Optional
- - The host of the conversation (optional). [NOT IMPLEMENTED, by default the host will be the one starting the conversation]
- agenda
- peers
- Returns:
- The created Message
createUpdatedMessage - Creates an Updated message, the newConnectionDescription field will be empty and has to be filled before sending.
- Parameters:
- {Identity} from
- - The Identity that figures as sender of the message.
- {Identity[]} to
- - The Array of Identity that figures as receiver of the message.
- {string} contextId
- - The contextId of the conversation related to the invitation.
- {ResourceConstraints} newConstraints
- - The resource constraints for the resources to update.
- Returns:
- The created Message
createUpdateMessage - Creates an Update message, the newConnectionDescription field will be empty and has to be filled before sending.
- Parameters:
- {Identity} from
- - The Identity that figures as sender of the message.
- {Identity[]} to
- - The Array of Identity that figures as receiver of the message.
- {string} contextId
- - The contextId of the conversation related to the invitation.
- {ResourceConstraints} newConstraints
- - The resource constraints for the resources to update.
- Returns:
- The created Message