org.jivesoftware.xiff.conference
class Room
Object
|
+--org.jivesoftware.xiff.conference.Room
class Room extends Object
Manages incoming and outgoing data from a conference room as part of multi-user conferencing (JEP-0045). You will need an instance of this class for each room that the user joins. You can also use your own, external data provider if you choose, by using the
setExternalDataProvider()
method. This is most useful for applications where the data provider might need to be a class other than an array with the Data Provider API decorations, like in the case of a Macromedia Central LCDataProvider. Overall, however, its probably a rare occurence. - Author:Sean Voisen
- Since:2.0.0
Property Summary
The conference server to use for this room. Usually, this is a subdomain of the primary XMPP server, like conference.myserver.com.
The nickname to use when joining.
The room name that should be used when joining.
Method Summary
Allow a previously banned JIDs to enter this room. This is the same as: Room.grant(NO_AFFILIATION, jid) If the process could not be completed, the room will dispatch the event adminError
Bans an arrya of JIDs from entering the room. This is the same as: Room.grant(OUTCAST_AFFILIATION, jid) If the process could not be completed, the room will dispatch the event adminError
Cancels the configuration process. The room may still be locked if you cancel the configuration process when attempting to join a reserved room. You must be joined to the room and have the owner affiliation to configure the room
Changes the subject in the conference room. You must be joined to the room to change the subject
Sends a configuration form to the room. Accepts a fieldmap hash which is an object with keys being the variables and the values being arrays. For single value fields, use a single element array You must be joined and have owner affiliation to configure the room
Actively decline an invitation. You can optionally ignore invitations but if you choose to decline an invitation, you call this method on a room instance that represents the room the invite originated from. You do not need to be joined to this room to decline an invitation Note: mu-conference-0.6 currently does not allow users to send decline messages without joining first. If using this version of conferencing software, it is best to ignore invites.
Destroys a reserved room. If the room has been configured to be persistent, then it is optional that the server will permanently remove the room.
Gets the user's affiliation for this room. Possible affiliations are "owner", "admin", "member", and "outcast". It is also possible to have no defined affiliation.
Gets a reference to the XMPPConnection being used for incoming/outgoing XMPP data.
Gets the fully qualified room name (room@server) of the current room.
Gets the users role in the conference room. Possible roles are "visitor", "participant", "moderator" or no defined role.
Get the JID of the room like XMPPConnection.getJID() used to send room messages
Get the JID of the user in the room like XMPPConnection.getJID() used to receive messages
Grants permissions on a room one or more JIDs by setting the affiliation of a user based * on their JID. Use one of the following affiliations:
Room.MEMBER_AFFILIATION
Room.ADMIN_AFFILIATION
Room.OWNER_AFFILIATION
If the JID currenly has an existing affiliation, then the existing affiliation will be replaced with the one passed. If the process could not be completed, the room will dispatch the event adminError Invites a user that is not currently a member of this room to this room. You must be joined to the room and have appropriate permissions to invite other memebers, as the room will format and send the invite message to the destination user rather that you sending the invite directly to the user. To listen to events, add an event listener on your XMPPConnection on the
invite
event. Determines whether the connection to the room is active - that is, the user is connected and has joined the room.
Tests if the parameter comes is the same as this room
Tests if the parameter comes is the same user as that connected to the room
Joins a conference room based on the parameters specified by the room properties. This call will create an instant room based on a default server configuration if the room doesn't exist. To create and begin the configuration process of a reserved room, pass
true
to this method to begin the configuration process. When The configuration is complete, the room will be unlocked for others to join. Listen to the configureForm
event to handle and either return or cancel the configuration of the room. Kicks an occupant out of the room, assuming that the user has necessary permissions to do so. If the user does not, the server will return an error.
Leaves the current conference room, assuming that the user has joined one. If the user is not currently in a room, this method does nothing.
Requests an affiliation list for a given affiliation with with room. This will either broadcast the event
affiliations
or adminError
depending on the result of the request Use one of the following affiliations: Room.NO_AFFILIATION
Room.OUTCAST_AFFILIATION
Room.MEMBER_AFFILIATION
Room.ADMIN_AFFILIATION
Room.OWNER_AFFILIATION
Requests a configuration form from the room. Listen to
configureForm
event to fill out the form then call either configure
or cancelConfiguration
to complete the configuration process You must be joined to the room and have the owner affiliation to request a configuration form Revokes all affiliations from the JIDs. This is the same as: grant(Room.NO_AFFILIATION, jids) If the process could not be completed, the room will dispatch the event adminError Note: if the JID is banned from this room, then this will also revoke their banned status.
Sends a message to the conference room.
Sends a private message to a specific participant in the conference room.
Sets a reference to the XMPPConnection being used for incoming/outgoing XMPP data.
Allows use of an external data provider instead of the one used internally by the class by default. This is useful in the case of a Macromedia Central application where the data provider might need to be an instance of an LCDataProvider. The data provider should either implement the Data Provider API interface, or the interface for Central's LCDataProvider.
In a moderated room, sets voice status to a particular occupant, assuming the user has the necessary permissions to do so.
Set the JID of the room in the form "room@conference.server"
Field Documentation
Property Documentation
conferenceServer
public conferenceServer: String (read, write)
The conference server to use for this room. Usually, this is a subdomain of the primary XMPP server, like conference.myserver.com.
Constructor Documentation
Method Documentation
allow
public function allow (
jids: Array,
callback: Function): Void
callback: Function): Void
Allow a previously banned JIDs to enter this room. This is the same as: Room.grant(NO_AFFILIATION, jid) If the process could not be completed, the room will dispatch the event adminError
- See also:,
ban
public function ban (
jids: Array,
callback: Function): Void
callback: Function): Void
Bans an arrya of JIDs from entering the room. This is the same as: Room.grant(OUTCAST_AFFILIATION, jid) If the process could not be completed, the room will dispatch the event adminError
- See also:,
cancelConfiguration
public function cancelConfiguration (
): Void
Cancels the configuration process. The room may still be locked if you cancel the configuration process when attempting to join a reserved room. You must be joined to the room and have the owner affiliation to configure the room
- See also:,
changeSubject
public function changeSubject (
newSubject: String): Void
Changes the subject in the conference room. You must be joined to the room to change the subject
- Parameters:
newSubject The new subject
configure
public function configure (
fieldmap: Object): Void
Sends a configuration form to the room. Accepts a fieldmap hash which is an object with keys being the variables and the values being arrays. For single value fields, use a single element array You must be joined and have owner affiliation to configure the room
- See also:
decline
public function decline (
jid: String,
reason: String): Void
reason: String): Void
Actively decline an invitation. You can optionally ignore invitations but if you choose to decline an invitation, you call this method on a room instance that represents the room the invite originated from. You do not need to be joined to this room to decline an invitation Note: mu-conference-0.6 currently does not allow users to send decline messages without joining first. If using this version of conferencing software, it is best to ignore invites.
- Parameters:
jid reason A string describing why the invitiation was declined
destroy
public function destroy (
reason: String,
alternateJID: String,
callback: Function): Void
alternateJID: String,
callback: Function): Void
Destroys a reserved room. If the room has been configured to be persistent, then it is optional that the server will permanently remove the room.
- Parameters:
reason A short description of why the room is being destroyed alternateJID A JID for current members to use as an alternate room to join after the room has been destroyed. Like a postal forwarding address. callback
getAffiliation
public function getAffiliation (
): String
Gets the user's affiliation for this room. Possible affiliations are "owner", "admin", "member", and "outcast". It is also possible to have no defined affiliation.
- Returns:The user's affiliation
getConnection
public function getConnection (
): XMPPConnection
Gets a reference to the XMPPConnection being used for incoming/outgoing XMPP data.
- Returns:The XMPPConnection used
- See also:
getFullRoomName
public function getFullRoomName (
): String
Gets the fully qualified room name (room@server) of the current room.
- Returns:The fully qualified room name
getRole
public function getRole (
): String
Gets the users role in the conference room. Possible roles are "visitor", "participant", "moderator" or no defined role.
- Returns:The user's role
getRoomJID
public function getRoomJID (
): String
Get the JID of the room like XMPPConnection.getJID() used to send room messages
- Returns:the room's JID
getUserJID
public function getUserJID (
): String
Get the JID of the user in the room like XMPPConnection.getJID() used to receive messages
- Returns:your JID in the room
grant
public function grant (
affiliation: String,
jids: Array,
callback: Function): Void
jids: Array,
callback: Function): Void
Grants permissions on a room one or more JIDs by setting the affiliation of a user based * on their JID. Use one of the following affiliations:
Room.MEMBER_AFFILIATION
Room.ADMIN_AFFILIATION
Room.OWNER_AFFILIATION
If the JID currenly has an existing affiliation, then the existing affiliation will be replaced with the one passed. If the process could not be completed, the room will dispatch the event adminError - See also:,
invite
public function invite (
jid: String,
reason: String): Void
reason: String): Void
Invites a user that is not currently a member of this room to this room. You must be joined to the room and have appropriate permissions to invite other memebers, as the room will format and send the invite message to the destination user rather that you sending the invite directly to the user. To listen to events, add an event listener on your XMPPConnection on the
invite
event. - Parameters:
jid A string JID of the user to invite reason A string describing why you would like to invite the user
isActive
public function isActive (
): Boolean
Determines whether the connection to the room is active - that is, the user is connected and has joined the room.
- Returns:True if the connection is active; false otherwise
isThisRoom
public function isThisRoom (
sender: String): Boolean
Tests if the parameter comes is the same as this room
- Parameters:
sender the room JID to test - Returns:true if the passed JID matches the getRoomJID
isThisUser
public function isThisUser (
sender: String): Boolean
Tests if the parameter comes is the same user as that connected to the room
- Parameters:
sender the room JID to test - Returns:true if the passed JID matches the getUserJID()
join
public function join (
createReserved: Boolean): Boolean
Joins a conference room based on the parameters specified by the room properties. This call will create an instant room based on a default server configuration if the room doesn't exist. To create and begin the configuration process of a reserved room, pass
true
to this method to begin the configuration process. When The configuration is complete, the room will be unlocked for others to join. Listen to the configureForm
event to handle and either return or cancel the configuration of the room. - Parameters:
createReserved (optional) Set to true if you wish to create and configure a reserved room - Returns:A boolean indicating whether the join attempt was successfully sent.
kickOccupant
public function kickOccupant (
occupantNick: String,
reason: String): Void
reason: String): Void
Kicks an occupant out of the room, assuming that the user has necessary permissions to do so. If the user does not, the server will return an error.
- Parameters:
occupantNick The nickname of the room occupant to kick reason The reason for the kick
leave
public function leave (
): Void
Leaves the current conference room, assuming that the user has joined one. If the user is not currently in a room, this method does nothing.
requestAffiliations
public function requestAffiliations (
affiliation: String)
Requests an affiliation list for a given affiliation with with room. This will either broadcast the event
affiliations
or adminError
depending on the result of the request Use one of the following affiliations: Room.NO_AFFILIATION
Room.OUTCAST_AFFILIATION
Room.MEMBER_AFFILIATION
Room.ADMIN_AFFILIATION
Room.OWNER_AFFILIATION
- See also:, ,
requestConfiguration
public function requestConfiguration (
): Void
Requests a configuration form from the room. Listen to
configureForm
event to fill out the form then call either configure
or cancelConfiguration
to complete the configuration process You must be joined to the room and have the owner affiliation to request a configuration form - See also:, ,
revoke
public function revoke (
jids: Array,
callback: Function): Void
callback: Function): Void
Revokes all affiliations from the JIDs. This is the same as: grant(Room.NO_AFFILIATION, jids) If the process could not be completed, the room will dispatch the event adminError Note: if the JID is banned from this room, then this will also revoke their banned status.
- See also:, ,
sendMessage
public function sendMessage (
body: String,
htmlBody: String): Void
htmlBody: String): Void
Sends a message to the conference room.
- Parameters:
body The message body htmlBody (Optional) The message body with HTML formatting
sendPrivateMessage
public function sendPrivateMessage (
recipientNickname: String,
body: String,
htmlBody: String)
body: String,
htmlBody: String)
Sends a private message to a specific participant in the conference room.
- Parameters:
recipientNickname The conference room nickname of the recipient who should receive the private message body The message body htmlBody (Optional) The message body with HTML formatting
setConnection
public function setConnection (
connection: XMPPConnection): Void
Sets a reference to the XMPPConnection being used for incoming/outgoing XMPP data.
- Parameters:
connection The XMPPConnection instance to use. - See also:
setExternalDataProvider
public function setExternalDataProvider (
externalDP: Object): Void
Allows use of an external data provider instead of the one used internally by the class by default. This is useful in the case of a Macromedia Central application where the data provider might need to be an instance of an LCDataProvider. The data provider should either implement the Data Provider API interface, or the interface for Central's LCDataProvider.
- Parameters:
externalDP A reference to the external data provider
setOccupantVoice
public function setOccupantVoice (
occupantNick: String,
voice: Boolean): Void
voice: Boolean): Void
In a moderated room, sets voice status to a particular occupant, assuming the user has the necessary permissions to do so.
- Parameters:
occupantNick The nickname of the occupant to give voice voice Whether to add voice (true) or remove voice (false)
setRoomJID
public function setRoomJID (
jid: String): Void
Set the JID of the room in the form "room@conference.server"
- Returns:the room's JID
- Room.as, Last Modified: 4/20/2005 10:20:58 AM