@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 log in the web site
|
void |
confirmUser(String uuid)
Looks for the User with the obtained login, activate his account by
setting its state to true and updates his status in the persistence
layer.
|
es.uvigo.esei.dgss.lettab.domain.User |
createUser(String login,
String password,
String name,
String email,
String path)
Creates a new User entity using the passed parameters, assigns its role
as 'user' by default and 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, no matter his active status (if
the user confirmed its account or not).
|
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, String path) throws javax.validation.ConstraintViolationException
login - Unique login for the new userpassword - Password for the new username - Name for the new useremail - Email for the new userpath - Path to make the confirmation URL sent in the confirmation
mailjavax.validation.ConstraintViolationException - Throws this exception if some of the dates of the user are
wrong@PermitAll public void confirmUser(String uuid) throws UserAlreadyActiveException, javax.persistence.NoResultException
uuid - The user's uuid that you want to activateUserAlreadyActiveException - If the user is already activejavax.persistence.NoResultException - If the uuid is not found@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 javax.persistence.NoResultException, UserNotActiveException
login - Unique login for searching the bonded Userjavax.persistence.NoResultException - thrown if the user is not foundUserNotActiveException - If the user is not active@PermitAll public es.uvigo.esei.dgss.lettab.domain.User checkLoggedUser(String login, String password) throws FailedLoginException, javax.persistence.NoResultException, UserNotActiveException
login - the login of the userpassword - the password of the userFailedLoginException - Happens when the user is wrong in the passwordjavax.persistence.NoResultException - If the user is not foundUserNotActiveException - If the user is not active@RolesAllowed(value="user") public void linkUserToEvent(es.uvigo.esei.dgss.lettab.domain.User participant, es.uvigo.esei.dgss.lettab.domain.Event event) throws EventNotActiveException, NullPointerException
participant - The user that is linked to an eventevent - Event assigned to a userEventNotActiveException - thrown if the event is inactiveNullPointerException - If the event is nullCopyright © 2017. All rights reserved.