@RolesAllowed(value="C") public class UserService extends Object
| Constructor and Description |
|---|
UserService() |
| Modifier and Type | Method and Description |
|---|---|
void |
create(es.uvigo.esei.dgss.User user)
Creates a new user, encrypts it's password and then send a verification
e-mail
|
void |
delete(es.uvigo.esei.dgss.User user)
Deletes a user.
|
List<es.uvigo.esei.dgss.User> |
list()
Gets all users
|
List<es.uvigo.esei.dgss.User> |
listPlayers(es.uvigo.esei.dgss.User user)
Gets all players a user created
|
es.uvigo.esei.dgss.User |
read(String login)
Gets a user given its login
|
void |
sendConfirmationEmail(es.uvigo.esei.dgss.User user)
When a new user is created, we have to send an email with a link to verify
the account.
|
void |
setEntityManager(javax.persistence.EntityManager em) |
es.uvigo.esei.dgss.User |
setUserConfirmed(es.uvigo.esei.dgss.User user)
Confirms a user and activates it
|
es.uvigo.esei.dgss.User |
update(es.uvigo.esei.dgss.User user)
Updates a user
|
void |
updatePassword(String login,
String newPassword)
Method to update an user's password.
|
public void setEntityManager(javax.persistence.EntityManager em)
@PermitAll public void create(es.uvigo.esei.dgss.User user)
user - A new user to be stored@PermitAll public es.uvigo.esei.dgss.User read(String login)
login - Login of the user to findpublic es.uvigo.esei.dgss.User update(es.uvigo.esei.dgss.User user)
user - The user to be updatedIllegalArgumentException - if the user is not foundpublic void delete(es.uvigo.esei.dgss.User user)
user - The user to be removedIllegalArgumentException - if the user is not found@PermitAll public es.uvigo.esei.dgss.User setUserConfirmed(es.uvigo.esei.dgss.User user)
user - The user to be confirmedpublic List<es.uvigo.esei.dgss.User> list()
public List<es.uvigo.esei.dgss.User> listPlayers(es.uvigo.esei.dgss.User user)
user - The user who we can find its playersUserPlayer@PermitAll public void sendConfirmationEmail(es.uvigo.esei.dgss.User user)
user - The user to be removedIllegalArgumentException - if the user is not foundMailCopyright © 2018. All rights reserved.