Constructor and Description |
---|
DatabaseImpl() |
Modifier and Type | Method and Description |
---|---|
BSAccount |
getAccount(int userid)
Get an account via the numeric userid
|
BSAccount |
getAccount(java.lang.String username) |
BSAccount |
getAccount(java.lang.String username,
java.lang.String password) |
BSAccount |
getAccountByEmail(java.lang.String email) |
BSAccount |
getAccountByToken(int token)
Get an account by the recovery token.
|
int |
getUserCount()
Get the number of users in the database.
|
void |
insertAccount(BSAccount account) |
void |
setAccountDao(AccountDao accountDao) |
void |
updateAccount(BSAccount account) |
void |
updateAccountPassword(BSAccount account,
java.lang.String newPassword)
Change the user's password
|
public void setAccountDao(AccountDao accountDao)
accountDao
- the accountDao to setpublic BSAccount getAccount(java.lang.String username, java.lang.String password)
getAccount
in interface Database
public BSAccount getAccount(java.lang.String username)
getAccount
in interface Database
public BSAccount getAccount(int userid)
Database
getAccount
in interface Database
userid
- The user's unique numeric idnull
if no accountpublic BSAccount getAccountByToken(int token)
Database
getAccountByToken
in interface Database
token
- The token that was emailed to the user.public BSAccount getAccountByEmail(java.lang.String email)
getAccountByEmail
in interface Database
public void insertAccount(BSAccount account)
insertAccount
in interface Database
public void updateAccount(BSAccount account)
updateAccount
in interface Database
public void updateAccountPassword(BSAccount account, java.lang.String newPassword)
Database
updateAccountPassword
in interface Database
account
- His BSAccountnewPassword
- His new passwordpublic int getUserCount()
Database
getUserCount
in interface Database