@PermitAll public class UserEJB extends Object
| Constructor and Description |
|---|
UserEJB() |
| Modifier and Type | Method and Description |
|---|---|
ligaaas.teamc.domain.User |
activateUser(Long userId)
Activates the account of a user.
|
void |
delete(long userId)
Deletes a
User. |
ligaaas.teamc.domain.User |
find(long userId)
Returns the
User identified by id. |
List<ligaaas.teamc.domain.User> |
findByEmail(String userEmail)
Returns a
List of User with the specified email. |
List<ligaaas.teamc.domain.User> |
findByLogin(String userLogin)
Returns the
User identified by id. |
List<ligaaas.teamc.domain.User> |
findByToken(String userToken)
Returns the
User identified by token. |
String |
generateHash(ligaaas.teamc.domain.User user)
Generates the hash of a given user.
|
ligaaas.teamc.domain.User |
registerUser(ligaaas.teamc.domain.User user)
Register a new
User. |
ligaaas.teamc.domain.User |
update(ligaaas.teamc.domain.User user)
Updates a user.
|
ligaaas.teamc.domain.User |
updatePassword(ligaaas.teamc.domain.User user,
String newUserPassword)
Updates a user password.
|
public String generateHash(ligaaas.teamc.domain.User user)
user - The user used to calculate the hash.@RolesAllowed(value="registered") public ligaaas.teamc.domain.User update(ligaaas.teamc.domain.User user)
user - A modified User to be persisted.User modified.NullPointerException - if the User is null.IllegalArgumentException - if User doesn't exist.IllegalArgumentException - if the password is distinct to the persisted.javax.ejb.EJBAccessException - if user to update isn't the current principal.javax.ejb.EJBAccessException - if the current User isn't registered.@RolesAllowed(value="registered") public ligaaas.teamc.domain.User updatePassword(ligaaas.teamc.domain.User user, String newUserPassword)
user - A user to modify the password.newUserPassword - The new password to add.User modified.NullPointerException - if the User is null.NullPointerException - if the newUserPassword is null.IllegalArgumentException - if User doesn't exist.javax.ejb.EJBAccessException - if user to update isn't the current principal.javax.ejb.EJBAccessException - if the current User isn't registered.@RolesAllowed(value="registered") public void delete(long userId)
User.userId. - The id of the User to be deleted.NullPointerException - if the User does not exist.javax.ejb.EJBAccessException - if user to delete isn't the current principal.javax.ejb.EJBAccessException - if the current User isn't registered.public List<ligaaas.teamc.domain.User> findByLogin(String userLogin)
User identified by id. If there is no User
with the specified id, null will be returned.userLogin. - The id of the user to be returned.User with the given id.IllegalArgumentException - if User login is nullpublic List<ligaaas.teamc.domain.User> findByToken(String userToken)
User identified by token. If there is no User
with the specified token, null will be returned.userToken. - The token of the user to be returned.User with the given token.IllegalArgumentException - if User token is nullpublic List<ligaaas.teamc.domain.User> findByEmail(String userEmail)
List of User with the specified email.userEmail. - The email of the User to be searched.List of User with the specified email.IllegalArgumentException - if User email is nullpublic ligaaas.teamc.domain.User registerUser(ligaaas.teamc.domain.User user)
User.user. - A new User to be registered.User is created with an notification sent to the
email.IllegalArgumentException - if User is nullIllegalArgumentException - if User login is already in use.IllegalArgumentException - if User email is already in use.public ligaaas.teamc.domain.User find(long userId)
User identified by id. If there is no User
with the specified id, null will be returned.userId - The id of the user to be returned.User with the given id.public ligaaas.teamc.domain.User activateUser(Long userId)
userId - The id of the user to be activated.IllegalArgumentException - if the userId is less than one.javax.ejb.EJBAccessException - if current user is not anonymous.Copyright © 2018. All rights reserved.