ks.server.interfaces
Interface IUserManager

All Superinterfaces:
IProcessCommand, IReadonlyUserManager

public interface IUserManager
extends IReadonlyUserManager, IProcessCommand

Define the interface between the Server and the User Manager which is responsible for maintaining information about the users of the system, both active and inactive users.

extends IReadonlyUserManager to get access methods.

Note: Your class that implements this interface must have a constructor with no parameters. This class must support a set of commands that is to be determined by the Group. For now, consider the following as an initial set.

There are a set of administrator-only commands:


Method Summary
 void announce(java.lang.String who)
          Construct a message to all active users in the system announcing the presence of this new user.
 boolean logIn(java.lang.String userName, java.lang.String password)
          When a user logs into the system, this method is invoked.
 boolean logOut(java.lang.String userName)
          When a user logs off the system, this method is invoked.
 void sendActiveUsers(java.lang.String who)
          Construct a message to send to user's client listing all active users in the system.
 
Methods inherited from interface ks.server.interfaces.IReadonlyUserManager
activeUsers, isLoggedIn, isUser, updateGameStats
 
Methods inherited from interface ks.server.interfaces.IProcessCommand
process
 

Method Detail

logIn

public boolean logIn(java.lang.String userName,
                     java.lang.String password)
When a user logs into the system, this method is invoked.

Parameters:
userName - String
password - String
Returns:
boolean

logOut

public boolean logOut(java.lang.String userName)
When a user logs off the system, this method is invoked.

Parameters:
userName - String

sendActiveUsers

public void sendActiveUsers(java.lang.String who)
Construct a message to send to user's client listing all active users in the system. The Client expects to receive a BulkLoginMessage that records the full set of active users.

Parameters:
who - the name of the user receiving this information.

announce

public void announce(java.lang.String who)
Construct a message to all active users in the system announcing the presence of this new user.

Parameters:
who -