net.sf.opensmus
Class MUSUser

java.lang.Object
  extended by net.sf.opensmus.MUSUser
All Implemented Interfaces:
ServerUser

public class MUSUser
extends java.lang.Object
implements ServerUser


Field Summary
 int ip
           
 boolean logged
           
 MUSMovie m_movie
           
 java.lang.String m_name
           
 java.lang.String m_pathname
           
 int m_udpcookie
           
 boolean m_udpenabled
           
 int m_userlevel
           
static org.jboss.netty.channel.ChannelFutureListener REPORT_CLOSE
           
 
Constructor Summary
MUSUser(MUSServer svr, org.jboss.netty.channel.Channel s)
           
 
Method Summary
 void addToMovie(MUSMovie newmov)
           
 boolean createUDPSocket()
           
 long creationTime()
          Gets this user's creationTime on the server, equivalent to the user login
 void deleteUser()
          Deletes this user, disconnecting him from the server.
 void disconnectFromMovie()
           
 java.util.Vector<java.lang.String> getGroupNames()
          Gets a list of the groups this user is a member of.
 java.util.Vector<ServerGroup> getGroups()
          Gets a list of the groups this user is a member of.
 int getGroupsCount()
          Gets the number of groups this user is a member of.
 void groupJoined(ServerGroup grp)
          Called by the OpenSMUS server when the user joins a group.
 void groupLeft(ServerGroup grp)
          Called by the OpenSMUS server when the user leaves a group.
 java.lang.String ipAddress()
          Gets this user's IP address as a String
 int ipAsInteger()
           
 void killMUSUser()
           
 void logDroppedMsg()
           
 java.lang.String name()
          Returns the name of the user as a String
 java.lang.String pathname()
           
 void postMessage(MUSMessage msg)
          Posts a message to the OpenSMUS server dispatcher.
 void processUDPPacket(byte[] content)
           
 void replyLogon(MUSLogonMessage msg)
           
 void replyLogonError(MUSLogonMessage msg, int error)
           
 void replyUDPInformation()
           
 void sendMessage(MUSMessage msg)
          Sends a message to this server user directly.
 ServerMovie serverMovie()
          Retrieves the ServerMovie object representing the movie this user is connected to.
 void setUDPEnabled(MUSLogonMessage logmsg)
           
 void setuserLevel(int level)
          Sets the user access level for this user.
 java.lang.String toString()
           
 int userLevel()
          Gets the user access level for this user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REPORT_CLOSE

public static org.jboss.netty.channel.ChannelFutureListener REPORT_CLOSE

m_udpcookie

public int m_udpcookie

m_udpenabled

public boolean m_udpenabled

logged

public boolean logged

m_pathname

public java.lang.String m_pathname

ip

public int ip

m_name

public java.lang.String m_name

m_movie

public MUSMovie m_movie

m_userlevel

public int m_userlevel
Constructor Detail

MUSUser

public MUSUser(MUSServer svr,
               org.jboss.netty.channel.Channel s)
        throws java.io.IOException
Throws:
java.io.IOException
Method Detail

setUDPEnabled

public void setUDPEnabled(MUSLogonMessage logmsg)

createUDPSocket

public boolean createUDPSocket()

replyUDPInformation

public void replyUDPInformation()

replyLogon

public void replyLogon(MUSLogonMessage msg)

replyLogonError

public void replyLogonError(MUSLogonMessage msg,
                            int error)

processUDPPacket

public void processUDPPacket(byte[] content)

deleteUser

public void deleteUser()
Description copied from interface: ServerUser
Deletes this user, disconnecting him from the server.

Specified by:
deleteUser in interface ServerUser

killMUSUser

public void killMUSUser()

disconnectFromMovie

public void disconnectFromMovie()

addToMovie

public void addToMovie(MUSMovie newmov)

logDroppedMsg

public void logDroppedMsg()

sendMessage

public void sendMessage(MUSMessage msg)
Description copied from interface: ServerUser
Sends a message to this server user directly.

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

postMessage

public void postMessage(MUSMessage msg)
Description copied from interface: ServerUser
Posts a message to the OpenSMUS server dispatcher.
Scripts can use this method to post messages to the server as if they were a connected user, since the ServerSideScript class implements the ServerUser interface.

Specified by:
postMessage in interface ServerUser
Parameters:
msg - Message to post

name

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

Specified by:
name in interface ServerUser

pathname

public java.lang.String pathname()

userLevel

public int userLevel()
Description copied from interface: ServerUser
Gets the user access level for this user

Specified by:
userLevel in interface ServerUser

setuserLevel

public void setuserLevel(int level)
Description copied from interface: ServerUser
Sets the user access level for this user.

Specified by:
setuserLevel in interface ServerUser
Parameters:
level - new user access level

serverMovie

public ServerMovie serverMovie()
Description copied from interface: ServerUser
Retrieves the ServerMovie object representing the movie this user is connected to.
Server side scripts can use this method to retrieve a pointer to the movie that created them.

Specified by:
serverMovie in interface ServerUser

creationTime

public long creationTime()
Description copied from interface: ServerUser
Gets this user's creationTime on the server, equivalent to the user login

Specified by:
creationTime in interface ServerUser

ipAddress

public java.lang.String ipAddress()
Description copied from interface: ServerUser
Gets this user's IP address as a String

Specified by:
ipAddress in interface ServerUser

ipAsInteger

public int ipAsInteger()

getGroupNames

public java.util.Vector<java.lang.String> getGroupNames()
Description copied from interface: ServerUser
Gets a list of the groups this user is a member of. By default all users are at least members of one group, @AllUsers

Specified by:
getGroupNames in interface ServerUser
Returns:
Java Vector with the group names as Strings.

getGroups

public java.util.Vector<ServerGroup> getGroups()
Description copied from interface: ServerUser
Gets a list of the groups this user is a member of. By default all users are at least members of one group, @AllUsers

Specified by:
getGroups in interface ServerUser
Returns:
Java Vector with the group objects.

getGroupsCount

public int getGroupsCount()
Description copied from interface: ServerUser
Gets the number of groups this user is a member of. By default all users are at least members of one group, @AllUsers

Specified by:
getGroupsCount in interface ServerUser
Returns:
the number of groups

groupJoined

public void groupJoined(ServerGroup grp)
Description copied from interface: ServerUser
Called by the OpenSMUS server when the user joins a group.

Specified by:
groupJoined in interface ServerUser
Parameters:
grp - ServerGroup reference

groupLeft

public void groupLeft(ServerGroup grp)
Description copied from interface: ServerUser
Called by the OpenSMUS server when the user leaves a group.

Specified by:
groupLeft in interface ServerUser
Parameters:
grp - ServerGroup reference

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object