net.sf.opensmus
Interface ServerGroup

All Known Implementing Classes:
MUSGroup

public interface ServerGroup

Interface representing a group on a movie.
Scripts can use methods of the ServerMovie interface to retrieve pointers to existing groups.


Method Summary
 void addUser(ServerUser oneuser)
          Adds a user to this server group
 ServerUser getServerUser(int useridx)
          Retrieves a pointer to a ServerUser object representing a user connected to the movie.
 ServerUser getServerUser(java.lang.String username)
          Retrieves a pointer to a ServerUser object representing a user connected to the movie.
 java.util.Vector<ServerUser> getServerUsers()
          Returns a list of all the users in the group.
 java.util.Vector<java.lang.String> getUserNames()
          Returns a list of the names of the users in the group.
 java.lang.String name()
          Returns the name of the group as a String
 boolean persists()
          Checks if the group is set to persist on the movie even when no users members of it.
 void removeUser(ServerUser oneuser)
          Removes a user from this server group.
 void sendMessage(MUSMessage msg)
          Sends a message to all users that are members of this group
 int serverUserCount()
          Gets the number of users in this group.
 void setpersists(boolean persistflag)
          Toggles the group persistent flag for this group.
 void setuserLimit(int level)
          Sets the maximum number of users allowed to join this group.
 int userLimit()
          Returns the maximum number of users allowed to join this group.
 

Method Detail

getServerUser

ServerUser getServerUser(java.lang.String username)
                         throws UserNotFoundException
Retrieves a pointer to a ServerUser object representing a user connected to the movie.

Parameters:
username - String with the name of the user to be returned
Returns:
ServerUser pointer, or throws a UserNotFoundException
Throws:
UserNotFoundException

getServerUser

ServerUser getServerUser(int useridx)
                         throws UserNotFoundException
Retrieves a pointer to a ServerUser object representing a user connected to the movie.

Parameters:
useridx - index of the user to be returned
Returns:
ServerUser pointer, or throws a UserNotFoundException
Throws:
UserNotFoundException

addUser

void addUser(ServerUser oneuser)
             throws MUSErrorCode
Adds a user to this server group

Parameters:
oneuser - ServerUser object to be added
Throws:
MUSErrorCode

removeUser

void removeUser(ServerUser oneuser)
Removes a user from this server group.

Parameters:
oneuser - ServerUser object to be removed

serverUserCount

int serverUserCount()
Gets the number of users in this group.

Returns:
the number of users

sendMessage

void sendMessage(MUSMessage msg)
Sends a message to all users that are members of this group

Parameters:
msg - Message to send

name

java.lang.String name()
Returns the name of the group as a String


userLimit

int userLimit()
Returns the maximum number of users allowed to join this group.
By default there is no limit on the number of users, unless the GroupSizeLimits directive in specified in a movie configuration file.

Returns:
the number of users allowed to join the group, or -1 for unlimited users

setuserLimit

void setuserLimit(int level)
Sets the maximum number of users allowed to join this group.
By default there is no limit on the number of users, unless the GroupSizeLimits directive in specified in a movie configuration file.

Parameters:
level - the number of users allowed to join the group, or -1 for unlimited users

persists

boolean persists()
Checks if the group is set to persist on the movie even when no users members of it. Groups are not persistent by default.

Returns:
TRUE if the group is set to persist, FALSE otherwise

setpersists

void setpersists(boolean persistflag)
Toggles the group persistent flag for this group. Persistent groups are not destroyed even when no users are connected to it.

Parameters:
persistflag - TRUE if the group needs to persist on the movie, FALSE otherwise

getUserNames

java.util.Vector<java.lang.String> getUserNames()
Returns a list of the names of the users in the group.


getServerUsers

java.util.Vector<ServerUser> getServerUsers()
Returns a list of all the users in the group.