cluster5.server.managers
Class UserManager

java.lang.Object
  extended by cluster5.server.managers.UserManager

public class UserManager
extends java.lang.Object


Method Summary
 User getByToken(java.lang.String token)
           
static UserManager getInstance()
           
 java.lang.String login(java.lang.String loginName, java.lang.String password)
          Loggs the user in if the pair loginName-password is correct.
 void logout(java.lang.String token)
          Loggs out a user identified by the token.
 void recordCpuTime(java.lang.Long userId, long cpuTime)
          Adds CPU time and +1 task to the specified user.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static UserManager getInstance()

login

public java.lang.String login(java.lang.String loginName,
                              java.lang.String password)
Loggs the user in if the pair loginName-password is correct.

Parameters:
loginName -
password -
Returns:
token which will be used for user identification

logout

public void logout(java.lang.String token)
Loggs out a user identified by the token. The token is invalidated and cannot be used any further.

Parameters:
token -

getByToken

public User getByToken(java.lang.String token)
Parameters:
token -
Returns:
instance of user by specified token

recordCpuTime

public void recordCpuTime(java.lang.Long userId,
                          long cpuTime)
Adds CPU time and +1 task to the specified user.

Parameters:
userId -
cpuTime -