net.sf.opensmus
Class MUSGroup

java.lang.Object
  extended by net.sf.opensmus.MUSGroup
All Implemented Interfaces:
ServerGroup

public class MUSGroup
extends java.lang.Object
implements ServerGroup


Field Summary
 java.util.Vector<MUSAttribute> m_attributelist
           
 boolean m_enabled
           
 java.lang.String m_name
           
 boolean m_persists
           
 int m_userlimit
           
 
Constructor Summary
MUSGroup(MUSMovie initmovie, java.lang.String initname)
           
 
Method Summary
 void addAttribute(MUSAttribute oneatt)
           
 void addUser(ServerUser oneuser)
          Adds a user to this server group
 void checkStructure()
           
 MUSAttribute getAttribute(java.lang.String attname)
           
 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.
 ServerUser getUser(java.lang.String uname)
           
 java.util.Vector<java.lang.String> getUserNames()
          Returns a list of the names of the users in the group.
 void logDroppedMsg()
           
 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 removeAllUsers()
           
 void removeAttribute(MUSAttribute oneatt)
           
 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.
 LValue srvcmd_getAllUsersCount()
           
 LValue srvcmd_getAttributeNames()
           
 LValue srvcmd_getUserCount()
           
 LValue srvcmd_getUsers()
           
 LValue srvcmd_handleAttributeMessage(MUSMessage reply, java.lang.String attrcommand, LPropList msgattributes)
           
 int userLimit()
          Returns the maximum number of users allowed to join this group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_name

public java.lang.String m_name

m_attributelist

public java.util.Vector<MUSAttribute> m_attributelist

m_enabled

public boolean m_enabled

m_persists

public boolean m_persists

m_userlimit

public int m_userlimit
Constructor Detail

MUSGroup

public MUSGroup(MUSMovie initmovie,
                java.lang.String initname)
Method Detail

addUser

public void addUser(ServerUser oneuser)
             throws MUSErrorCode
Description copied from interface: ServerGroup
Adds a user to this server group

Specified by:
addUser in interface ServerGroup
Parameters:
oneuser - ServerUser object to be added
Throws:
MUSErrorCode

removeUser

public void removeUser(ServerUser oneuser)
Description copied from interface: ServerGroup
Removes a user from this server group.

Specified by:
removeUser in interface ServerGroup
Parameters:
oneuser - ServerUser object to be removed

checkStructure

public void checkStructure()

addAttribute

public void addAttribute(MUSAttribute oneatt)

removeAttribute

public void removeAttribute(MUSAttribute oneatt)

getAttribute

public MUSAttribute getAttribute(java.lang.String attname)
                          throws AttributeNotFoundException
Throws:
AttributeNotFoundException

logDroppedMsg

public void logDroppedMsg()

srvcmd_handleAttributeMessage

public LValue srvcmd_handleAttributeMessage(MUSMessage reply,
                                            java.lang.String attrcommand,
                                            LPropList msgattributes)

srvcmd_getAllUsersCount

public LValue srvcmd_getAllUsersCount()

srvcmd_getUsers

public LValue srvcmd_getUsers()

srvcmd_getAttributeNames

public LValue srvcmd_getAttributeNames()

srvcmd_getUserCount

public LValue srvcmd_getUserCount()

getUser

public ServerUser getUser(java.lang.String uname)
                   throws UserNotFoundException
Throws:
UserNotFoundException

removeAllUsers

public void removeAllUsers()

getServerUser

public ServerUser getServerUser(java.lang.String username)
                         throws UserNotFoundException
Description copied from interface: ServerGroup
Retrieves a pointer to a ServerUser object representing a user connected to the movie.

Specified by:
getServerUser in interface ServerGroup
Parameters:
username - String with the name of the user to be returned
Returns:
ServerUser pointer, or throws a UserNotFoundException
Throws:
UserNotFoundException

getServerUser

public ServerUser getServerUser(int useridx)
                         throws UserNotFoundException
Description copied from interface: ServerGroup
Retrieves a pointer to a ServerUser object representing a user connected to the movie.

Specified by:
getServerUser in interface ServerGroup
Parameters:
useridx - index of the user to be returned
Returns:
ServerUser pointer, or throws a UserNotFoundException
Throws:
UserNotFoundException

getUserNames

public java.util.Vector<java.lang.String> getUserNames()
Description copied from interface: ServerGroup
Returns a list of the names of the users in the group.

Specified by:
getUserNames in interface ServerGroup

getServerUsers

public java.util.Vector<ServerUser> getServerUsers()
Description copied from interface: ServerGroup
Returns a list of all the users in the group.

Specified by:
getServerUsers in interface ServerGroup

serverUserCount

public int serverUserCount()
Description copied from interface: ServerGroup
Gets the number of users in this group.

Specified by:
serverUserCount in interface ServerGroup
Returns:
the number of users

sendMessage

public void sendMessage(MUSMessage msg)
Description copied from interface: ServerGroup
Sends a message to all users that are members of this group

Specified by:
sendMessage in interface ServerGroup
Parameters:
msg - Message to send

name

public java.lang.String name()
Description copied from interface: ServerGroup
Returns the name of the group as a String

Specified by:
name in interface ServerGroup

userLimit

public int userLimit()
Description copied from interface: ServerGroup
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.

Specified by:
userLimit in interface ServerGroup
Returns:
the number of users allowed to join the group, or -1 for unlimited users

setuserLimit

public void setuserLimit(int level)
Description copied from interface: ServerGroup
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.

Specified by:
setuserLimit in interface ServerGroup
Parameters:
level - the number of users allowed to join the group, or -1 for unlimited users

persists

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

Specified by:
persists in interface ServerGroup
Returns:
TRUE if the group is set to persist, FALSE otherwise

setpersists

public void setpersists(boolean persistflag)
Description copied from interface: ServerGroup
Toggles the group persistent flag for this group. Persistent groups are not destroyed even when no users are connected to it.

Specified by:
setpersists in interface ServerGroup
Parameters:
persistflag - TRUE if the group needs to persist on the movie, FALSE otherwise