@DeclareRoles(value={"admin","user"}) @RolesAllowed(value="admin") public class UserEJB extends Object
| Modifier and Type | Field and Description |
|---|---|
protected javax.ejb.SessionContext |
ctx |
| Constructor and Description |
|---|
UserEJB() |
| Modifier and Type | Method and Description |
|---|---|
es.uvigo.esei.dgss.lettab.domain.User |
checkLoggedUser(String login,
String password)
Checks the user that try to login in the web
|
void |
confirmUser(String login)
Looks for the User with the obtained login, sets its state to true and
updates his status
|
es.uvigo.esei.dgss.lettab.domain.User |
createUser(String login,
String password,
String name,
String email)
Creates a new User entity using the passed parameters, persists it in the
database with a false active status.
|
es.uvigo.esei.dgss.lettab.domain.User |
findRegisteredUser(String login)
Find the registered user by login
|
es.uvigo.esei.dgss.lettab.domain.User |
findUserByLogin(String login)
Obtains the user with the current login
|
void |
linkUserToEvent(es.uvigo.esei.dgss.lettab.domain.User participant,
es.uvigo.esei.dgss.lettab.domain.Event event)
Link to an event to an user and increase the participants for that event
|
@PermitAll public es.uvigo.esei.dgss.lettab.domain.User createUser(String login, String password, String name, String email) throws javax.persistence.EntityExistsException
login - Unique login for the new userpassword - Password for the new username - Name for the new useremail - Email for the new userjavax.persistence.EntityExistsException - Throws this exception if the user exists@RolesAllowed(value="user") public void confirmUser(String login)
login - The user that you want to activate@PermitAll public es.uvigo.esei.dgss.lettab.domain.User findUserByLogin(String login) throws javax.persistence.NoResultException
login - The login used to find the userjavax.persistence.NoResultException - When the user with the login is not found@PermitAll public es.uvigo.esei.dgss.lettab.domain.User findRegisteredUser(String login) throws UserNotActiveException
login - Unique login for searching the bonded Userjavax.ws.rs.NotFoundException - thrown if the user is neither found nor activatedUserNotActiveException@PermitAll public es.uvigo.esei.dgss.lettab.domain.User checkLoggedUser(String login, String password) throws FailedLoginException
login - the login of the userpassword - the password of the userFailedLoginException - Happens when the user is wrong in the password@RolesAllowed(value="user") public void linkUserToEvent(es.uvigo.esei.dgss.lettab.domain.User participant, es.uvigo.esei.dgss.lettab.domain.Event event)
participant - The user that is linked to an eventevent - Event assigned to a userCopyright © 2016. All rights reserved.