org.jivesoftware.spark.ui.conferences
Class ConferenceUtils

java.lang.Object
  extended by org.jivesoftware.spark.ui.conferences.ConferenceUtils

public class ConferenceUtils
extends java.lang.Object


Method Summary
static void autoJoinConferenceRoom(java.lang.String roomName, java.lang.String roomJID, java.lang.String password)
           
static void createPrivateConference(java.lang.String serviceName, java.lang.String message, java.lang.String roomName, java.util.Collection jids)
          Creates a private conference.
static void enterRoom(org.jivesoftware.smackx.muc.MultiUserChat groupChat, java.lang.String tabTitle, java.lang.String nickname, java.lang.String password)
           
static GroupChatRoom enterRoomOnSameThread(java.lang.String roomName, java.lang.String roomJID, java.lang.String password)
           
static java.lang.String getCreationDate(java.lang.String roomJID)
          Retrieve the date (in yyyyMMdd) format of the time the room was created.
static int getNumberOfOccupants(java.lang.String roomJID)
          Return the number of occupants in a room.
static java.util.Collection getRoomList(java.lang.String serviceName)
          Return a list of available Conference rooms from the server based on the service name.
static void inviteUsersToRoom(java.lang.String serviceName, java.lang.String roomName, java.util.Collection jids)
          Invites users to an existing room.
static void joinConferenceRoom(java.lang.String roomName, java.lang.String roomJID)
           
static java.util.List joinRoom(org.jivesoftware.smackx.muc.MultiUserChat groupChat, java.lang.String nickname, java.lang.String password)
           
static boolean requiresPassword(java.lang.String roomJID)
          Returns true if the room requires a password.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRoomList

public static java.util.Collection getRoomList(java.lang.String serviceName)
                                        throws java.lang.Exception
Return a list of available Conference rooms from the server based on the service name.

Parameters:
serviceName - the service name (ex. conference@jivesoftware.com)
Returns:
a collection of rooms.
Throws:
java.lang.Exception - if an error occured during fetch.

getNumberOfOccupants

public static int getNumberOfOccupants(java.lang.String roomJID)
                                throws org.jivesoftware.smack.XMPPException
Return the number of occupants in a room.

Parameters:
roomJID - the full JID of the conference room. (ex. dev@conference.jivesoftware.com)
Returns:
the number of occupants in the room if available.
Throws:
org.jivesoftware.smack.XMPPException - thrown if an error occured during retrieval of the information.

getCreationDate

public static java.lang.String getCreationDate(java.lang.String roomJID)
                                        throws java.lang.Exception
Retrieve the date (in yyyyMMdd) format of the time the room was created.

Parameters:
roomJID - the jid of the room.
Returns:
the formatted date.
Throws:
java.lang.Exception - throws an exception if we are unable to retrieve the date.

autoJoinConferenceRoom

public static void autoJoinConferenceRoom(java.lang.String roomName,
                                          java.lang.String roomJID,
                                          java.lang.String password)

joinConferenceRoom

public static void joinConferenceRoom(java.lang.String roomName,
                                      java.lang.String roomJID)

enterRoom

public static void enterRoom(org.jivesoftware.smackx.muc.MultiUserChat groupChat,
                             java.lang.String tabTitle,
                             java.lang.String nickname,
                             java.lang.String password)

joinRoom

public static java.util.List joinRoom(org.jivesoftware.smackx.muc.MultiUserChat groupChat,
                                      java.lang.String nickname,
                                      java.lang.String password)

inviteUsersToRoom

public static final void inviteUsersToRoom(java.lang.String serviceName,
                                           java.lang.String roomName,
                                           java.util.Collection jids)
Invites users to an existing room.

Parameters:
serviceName - the service name to use.
roomName - the name of the room.
jids - a collection of the users to invite.

requiresPassword

public static final boolean requiresPassword(java.lang.String roomJID)
Returns true if the room requires a password.

Parameters:
roomJID - the JID of the room.
Returns:
true if the room requires a password.

createPrivateConference

public static void createPrivateConference(java.lang.String serviceName,
                                           java.lang.String message,
                                           java.lang.String roomName,
                                           java.util.Collection jids)
Creates a private conference.

Parameters:
serviceName - the service name to use for the private conference.
message - the message sent to each individual invitee.
roomName - the name of the room to create.
jids - a collection of the user JIDs to invite.

enterRoomOnSameThread

public static GroupChatRoom enterRoomOnSameThread(java.lang.String roomName,
                                                  java.lang.String roomJID,
                                                  java.lang.String password)