|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This class defines the interface for performing user management and authentication in the drink system. Currently, this class provides methods to retrieve the administrator status of the user and their balance.
| Method Summary | |
boolean |
addUser(String username,
String password)
Adds a user to the database of known users. |
boolean |
addUser(String username,
String password,
int balance,
boolean adminStatus)
Adds a user to the database of known users using the supplied values to initialize the users account. |
boolean |
decreaseUserBalance(String username,
int amount)
Decrements a user's balance by the given amount. |
Vector |
dump()
This provides a dump of all the data for every user known to the system. |
int |
getUserBalance(String username)
Determines the number of credits a user has. |
boolean |
increaseUserBalance(String username,
int amount)
Increases a user's balance by the given amount. |
boolean |
isSystemReady()
Returns whether or not the AcctMgrSpec is ready to process transactions. |
boolean |
isUserAdmin(String username)
Determines if a given user is an administrator of drink. |
boolean |
isValidUser(String username)
Determines if a user is known to the Drink system. |
boolean |
isValidUser(String username,
String password)
Authenticates a user. |
void |
purgeDatabase()
Tells the database to remove all information regarding users. |
boolean |
removeUser(String username)
Removes a user from the database of known users. |
boolean |
setUserAdmin(String username,
boolean admin)
Sets the user's admin flag to the given value. |
| Method Detail |
public boolean isSystemReady()
public boolean isValidUser(String username,
String password)
username - The user to authenticate.password - The users password.
public boolean isValidUser(String username)
username - The user to verify
public int getUserBalance(String username)
username - The username whose balance is desired
public boolean decreaseUserBalance(String username,
int amount)
username - The user whose account is to be decrementedamount - The amount, in credits, to decrement the users account.
increaseUserBalance(String, int)
public boolean increaseUserBalance(String username,
int amount)
username - The user whose account is to be incremented.amount - The amount to increase the users account
decreaseUserBalance(String, int)
public boolean addUser(String username,
String password)
username - The name of the user to add.password - The new users drink-specific password.
LocalAcctMgr.isValidUser(String,String)
public boolean addUser(String username,
String password,
int balance,
boolean adminStatus)
username - The username of the account to create.password - The drink-specific passwordbalance - The users new balance. Negative is allowed.adminStatus - Whether or not the user is to be an admin.
public void purgeDatabase()
public Vector dump()
public boolean removeUser(String username)
username - The user to remove
public boolean isUserAdmin(String username)
username - The user to be verified
public boolean setUserAdmin(String username,
boolean admin)
username - The user to editadmin - The value to set the flag to.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||