net.sf.opensmus
Interface ServerMovie

All Known Implementing Classes:
MUSMovie

public interface ServerMovie

Interface representing a movie connected to the OpenSMUS server.
ServerSideScript classes can use the serverMovie() method to retrieve a pointer to the ServerMovie object that created them.
Scripts can also use methods of the ServerObject interface to retrieve pointers to other movies connected to the server.


Method Summary
 ServerGroup createServerGroup(java.lang.String groupname)
          Creates a new group on the movie and returns a pointer to it.
 void deleteServerGroup(java.lang.String groupname)
          Deletes a group from the movie.
 void disableGroup(java.lang.String gname)
          Disables this group so new users can not join it.
 void enableGroup(java.lang.String gname)
          Enables this group to receive new users.
 ServerGroup getServerGroup(int groupidx)
          Retrieves a pointer to a ServerGroup object representing a group that exists on this ServerMovie.
 ServerGroup getServerGroup(java.lang.String groupname)
          Retrieves a pointer to a ServerGroup object representing a group that exists on this ServerMovie.
 java.lang.String name()
          Returns the name of the movie as a String
 boolean persists()
          Checks if the movie is set to persist on the server even when no users are connected to it.
 int serverGroupCount()
          Gets the number of groups in this movie.
 int serverUserCount()
          Gets the number of users connected to this movie.
 void setpersists(boolean persistflag)
          Toggles the movie persistent flag for this movie.
 void setuserLevel(int level)
          Sets the default user levels for users that connect to this movie and do not have a user account in the DB.
 int userLevel()
          Gets the default user levels for users that connect to this movie and do not have a user account in the DB.
 

Method Detail

getServerGroup

ServerGroup getServerGroup(java.lang.String groupname)
                           throws GroupNotFoundException
Retrieves a pointer to a ServerGroup object representing a group that exists on this ServerMovie.

Parameters:
groupname - String with the name of the group to be returned
Returns:
ServerGroup pointer, or throws a GroupNotFoundException
Throws:
GroupNotFoundException

getServerGroup

ServerGroup getServerGroup(int groupidx)
                           throws GroupNotFoundException
Retrieves a pointer to a ServerGroup object representing a group that exists on this ServerMovie.

Parameters:
groupidx - index of the movie to be returned
Returns:
ServerGroup pointer, or throws a GroupNotFoundException
Throws:
GroupNotFoundException

createServerGroup

ServerGroup createServerGroup(java.lang.String groupname)
                              throws MUSErrorCode
Creates a new group on the movie and returns a pointer to it.

Parameters:
groupname - String with the name of the group to be created
Returns:
ServerGroup pointer, or throws a MUSErrorCode if the creation fails
Throws:
MUSErrorCode

deleteServerGroup

void deleteServerGroup(java.lang.String groupname)
Deletes a group from the movie.

Parameters:
groupname - String with the name of the group to be deleted

serverGroupCount

int serverGroupCount()
Gets the number of groups in this movie.

Returns:
the number of groups

serverUserCount

int serverUserCount()
Gets the number of users connected to this movie.

Returns:
the number of users

name

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


userLevel

int userLevel()
Gets the default user levels for users that connect to this movie and do not have a user account in the DB.
This value can be configured by the DefaultUserLevel directive in a movie configuration file.


setuserLevel

void setuserLevel(int level)
Sets the default user levels for users that connect to this movie and do not have a user account in the DB.
When this method is used it overrides the value configured by the DefaultUserLevel directive in a movie configuration file.


enableGroup

void enableGroup(java.lang.String gname)
Enables this group to receive new users. Groups are enabled by default.


disableGroup

void disableGroup(java.lang.String gname)
Disables this group so new users can not join it.


persists

boolean persists()
Checks if the movie is set to persist on the server even when no users are connected to it. Movies are not persistent by default.

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

setpersists

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

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