org.chorem.pollen.services.impl
Class UserService

java.lang.Object
  extended by org.chorem.pollen.services.PollenServiceSupport
      extended by org.chorem.pollen.services.impl.UserService
All Implemented Interfaces:
PollenService

public class UserService
extends PollenServiceSupport


Field Summary
 
Fields inherited from class org.chorem.pollen.services.PollenServiceSupport
serviceContext
 
Constructor Summary
UserService()
           
 
Method Summary
 UserAccount connect(String login, String password)
           
protected  void copyUserAccount(UserAccount source, UserAccount destination)
          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.TopiaFilterPagerUtil.FilterPagerBean 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)
           
 
Methods inherited from class org.chorem.pollen.services.PollenServiceSupport
commitTransaction, create, createWithProperties, decorateDate, decorateDateTime, delete, flushTransaction, generateId, getConfiguration, getDAO, getDatePattern, getDateTimePattern, getEntities, getEntities, getEntityById, getLocale, getTransaction, newInstance, newService, setServiceContext, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserService

public UserService()
Method Detail

connect

public UserAccount connect(String login,
                           String password)
                    throws UserNotFoundException,
                           UserInvalidPasswordException
Throws:
UserNotFoundException
UserInvalidPasswordException

createUser

public UserAccount createUser(UserAccount user,
                              boolean byAdmin)
                       throws UserLoginAlreadyUsedException,
                              UserEmailAlreadyUsedException
Throws:
UserLoginAlreadyUsedException
UserEmailAlreadyUsedException

updateUser

public UserAccount updateUser(UserAccount user,
                              String newPassword,
                              boolean byAdmin)
                       throws UserEmailAlreadyUsedException,
                              UserInvalidPasswordException
Throws:
UserEmailAlreadyUsedException
UserInvalidPasswordException

lostPassword

public void lostPassword(String email)
                  throws UserNotFoundException,
                         InvalidEmailException
This service is used to retrieve the userAccount associated to the given email. If the user is found, an email will be send with a new password. Otherwise an error will occured.

Parameters:
email - User email
Throws:
InvalidEmailException - if the email is not valid
UserNotFoundException - if no user matches the given email

getNewUser

public UserAccount getNewUser()

deleteUser

public void deleteUser(String id)
                throws UserNotFoundException
Throws:
UserNotFoundException

getUsers

public List<UserAccount> getUsers(org.nuiton.topia.persistence.TopiaFilterPagerUtil.FilterPagerBean pager)

getNbUsers

public int getNbUsers()

createDefaultUsers

public void createDefaultUsers()

generatePassword

protected String generatePassword()

encodePassword

protected String encodePassword(String password)

copyUserAccount

protected void copyUserAccount(UserAccount source,
                               UserAccount destination)
Copy source user account to destination one. The email is lower cased in the destination user account.

Parameters:
source - user account to copy
destination - which receive the copy
See Also:
Binder.copy(Object, Object, String...)


Copyright © 2009-2012 CodeLutin. All Rights Reserved.