public class UserService extends PollenServiceSupport
serviceContext
Constructor and Description |
---|
UserService() |
Modifier and Type | Method and Description |
---|---|
UserAccount |
connect(String login,
String password) |
protected void |
copyUserAccount(UserAccount source,
UserAccount destination,
boolean copyEmail)
Copy
source user account to destination one. |
void |
createDefaultUsers() |
UserAccount |
createUser(UserAccount user,
boolean byAdmin) |
void |
deleteUser(String id) |
protected String |
encodePassword(String password) |
protected String |
generatePassword() |
int |
getNbUsers() |
UserAccount |
getNewUser() |
List<UserAccount> |
getUsers(org.nuiton.topia.persistence.pager.TopiaPagerBean pager) |
void |
lostPassword(String email)
This service is used to retrieve the userAccount associated to the given
email . |
UserAccount |
updateUser(UserAccount user,
String newPassword,
boolean byAdmin) |
commitTransaction, create, createWithProperties, decorateDate, decorateDateTime, delete, flushTransaction, getConfiguration, getDAO, getDatePattern, getDateTimePattern, getEntities, getEntities, getEntityById, getLocale, getTransaction, newInstance, newService, setServiceContext, update
public UserAccount connect(String login, String password) throws UserNotFoundException, UserInvalidPasswordException
public UserAccount createUser(UserAccount user, boolean byAdmin) throws UserLoginAlreadyUsedException, UserEmailAlreadyUsedException
public UserAccount updateUser(UserAccount user, String newPassword, boolean byAdmin) throws UserEmailAlreadyUsedException, UserInvalidPasswordException
public void lostPassword(String email) throws UserNotFoundException, InvalidEmailException
email
. If the user is found, an email will be send with a new
password. Otherwise an error will occured.email
- User emailInvalidEmailException
- if the email is not validUserNotFoundException
- if no user matches the given emailpublic UserAccount getNewUser()
public void deleteUser(String id) throws UserNotFoundException
UserNotFoundException
public List<UserAccount> getUsers(org.nuiton.topia.persistence.pager.TopiaPagerBean pager)
public int getNbUsers()
public void createDefaultUsers()
protected String generatePassword()
protected void copyUserAccount(UserAccount source, UserAccount destination, boolean copyEmail)
source
user account to destination
one.
The email is lower cased in the destination
user account.source
- user account to copydestination
- which receive the copyBinder.copy(Object, Object, String...)
Copyright © 2009–2014 CodeLutin. All rights reserved.