Package eu.getmangos.controllers
Class AccountController
java.lang.Object
eu.getmangos.controllers.AccountController
@ApplicationScoped public class AccountController extends Object
-
Constructor Summary
Constructors Constructor Description AccountController() -
Method Summary
Modifier and Type Method Description voiddelete(Integer id)Delete an account in the database.Accountfind(Integer id)Retrieves an account by its ID.List<Account>findAll()Retrieves all accounts from the database.org.reactivestreams.Publisher<AccountEventDTO>notifyAccountEvent()voidregister(Account account)Accountsearch(String name)Search an account by its nameAccountsearchByEmail(String email)Search an account by its email addressvoidupdate(Account account)
-
Constructor Details
-
AccountController
public AccountController()
-
-
Method Details
-
register
- Throws:
DAOException
-
update
- Throws:
DAOException
-
delete
Delete an account in the database. This method will also delete all links with the bans for this account.- Parameters:
id- The ID of the account to be deleted.- Throws:
DAOException- Send a DAOException if something happened during the data validation.
-
notifyAccountEvent
-
find
Retrieves an account by its ID.- Parameters:
id- The ID of the account- Returns:
- The account if found, null otherwise.
-
search
Search an account by its name- Parameters:
name- The name of the account.- Returns:
- The matching account for the given name.
-
searchByEmail
Search an account by its email address- Parameters:
email- The email of the account.- Returns:
- The matching account for the given email.
-
findAll
Retrieves all accounts from the database.- Returns:
- A list of Account.
-