|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.asdf.server.AccountManager
public class AccountManager
Handles creating, deleting, modifying and accessing of accounts.
Constructor Summary | |
---|---|
AccountManager()
|
Method Summary | |
---|---|
boolean |
changePassword(java.lang.String username,
java.lang.String password,
java.lang.String newPassword)
Changes password of a given user, if the user performing this action is allowed to do so. |
AccountManagementResponse |
createAccount(ClientConnection conn,
java.lang.String accountName,
java.lang.String password,
int type)
Handles account creating requests. |
boolean |
deleteAccount(java.lang.String username,
java.lang.String password)
Deletes an account from database and memory. |
AuthenticationResponse |
logIn(ClientConnection conn,
java.lang.String username,
java.lang.String passwd)
ConnectionInfo conn wants to log in with Account named account, using password passwd |
AuthenticationResponse |
logOut(ClientConnection conn)
Logout method. |
void |
setBalanceChange(java.lang.String gameName,
double amount,
Account account)
Change user credit balance. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AccountManager()
Method Detail |
---|
public boolean changePassword(java.lang.String username, java.lang.String password, java.lang.String newPassword)
username
- Account name of the user whose password is to be changed.password
- Old password of this user.newPassword
- New password.
public boolean deleteAccount(java.lang.String username, java.lang.String password)
username
- Account name to be deleted.password
- Password for the account, to check that this user is allowed to perform this action.
public AuthenticationResponse logIn(ClientConnection conn, java.lang.String username, java.lang.String passwd)
conn
- Specifies the client who is performing the actionusername
- The name of the account with which the user wishes to loginpasswd
- The password the user is sending to loginpublic AuthenticationResponse logOut(ClientConnection conn)
conn
- public AccountManagementResponse createAccount(ClientConnection conn, java.lang.String accountName, java.lang.String password, int type)
conn
- The client connection used by the user.accountName
- Account name that is requested for creation.password
- Password for the new account.type
- Type of the account.
public void setBalanceChange(java.lang.String gameName, double amount, Account account)
amount
- Difference in balanceaccount
- Account on which to make the change
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |