|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlecturequiz.server.main.UserManager
public class UserManager
Method Summary | |
---|---|
User |
addUser(java.lang.String username,
int role)
Adds a user to the user-pool. |
void |
addUser(User user)
Adds a user to the list of users |
User |
authenticateUser(java.lang.String username,
java.lang.String password)
Tries to authenticate the user with the |
static UserManager |
getInstance()
Returns the instance of the UserManager class, or creates a new on if it doesn't exist. |
boolean |
isUsernameAvailable(java.lang.String username)
Checks if the supplied username is already in use by another logged in user. |
void |
removeUser(User user)
Removes a user from the list of users and any games they are in |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static UserManager getInstance()
public boolean isUsernameAvailable(java.lang.String username)
username
- The name to check availability for.
public User addUser(java.lang.String username, int role)
username
- The username of the user to be added.role
- The role of the user to be added.
public void addUser(User user)
user
- the user to addpublic void removeUser(User user)
user
- the user to removepublic User authenticateUser(java.lang.String username, java.lang.String password)
username
- Username to authenticatepassword
- Password
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |