@Service(value="userManager") public class UserManagerImpl extends GenericManagerImpl<org.appfuse.model.User,Long> implements UserManager, UserService
dao, log| Constructor and Description |
|---|
UserManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
String |
buildRecoveryPasswordUrl(org.appfuse.model.User user,
String urlTemplate)
Builds a recovery password url by replacing placeholders with username and generated recovery token.
|
String |
generateRecoveryToken(org.appfuse.model.User user) |
org.appfuse.model.User |
getUser(String userId)
Retrieves a user by userId.
|
org.appfuse.model.User |
getUserByUsername(String username)
Finds a user by their username.
|
List<org.appfuse.model.User> |
getUsers()
Retrieves a list of all users.
|
boolean |
isRecoveryTokenValid(String username,
String token) |
boolean |
isRecoveryTokenValid(org.appfuse.model.User user,
String token) |
void |
removeUser(String userId)
Removes a user from the database by their userId
|
void |
removeUser(org.appfuse.model.User user)
Removes a user from the database
|
org.appfuse.model.User |
saveUser(org.appfuse.model.User user)
Saves a user's information.
|
List<org.appfuse.model.User> |
search(String searchTerm)
Search a user for search terms.
|
void |
sendPasswordRecoveryEmail(String username,
String urlTemplate)
Sends a password recovery email to username.
|
void |
setMailEngine(MailEngine mailEngine) |
void |
setMailMessage(org.springframework.mail.SimpleMailMessage message) |
void |
setPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
Convenience method for testing - allows you to mock the PasswordEncoder and set it on an interface.
|
void |
setPasswordRecoveryTemplate(String passwordRecoveryTemplate)
Velocity template name to send users a password recovery mail (default
passwordRecovery.vm).
|
void |
setPasswordTokenManager(PasswordTokenManager passwordTokenManager) |
void |
setPasswordUpdatedTemplate(String passwordUpdatedTemplate)
Velocity template name to inform users their password was updated
(default passwordUpdated.vm).
|
void |
setUserDao(UserDao userDao)
Convenience method for testing - allows you to mock the DAO and set it on an interface.
|
org.appfuse.model.User |
updatePassword(String username,
String currentPassword,
String recoveryToken,
String newPassword,
String applicationUrl) |
exists, get, getAll, reindex, reindexAll, remove, remove, save, searchclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexists, get, getAll, reindex, reindexAll, remove, remove, save, search@Autowired @Qualifier(value="passwordEncoder") public void setPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
UserManagersetPasswordEncoder in interface UserManagerpasswordEncoder - the PasswordEncoder implementation to use@Autowired public void setUserDao(UserDao userDao)
UserManagersetUserDao in interface UserManageruserDao - the UserDao implementation to use@Autowired(required=false) public void setMailEngine(MailEngine mailEngine)
@Autowired(required=false) public void setMailMessage(org.springframework.mail.SimpleMailMessage message)
@Autowired(required=false) public void setPasswordTokenManager(PasswordTokenManager passwordTokenManager)
public void setPasswordRecoveryTemplate(String passwordRecoveryTemplate)
passwordRecoveryTemplate - the Velocity template to use (relative to classpath)MailEngine.sendMessage(org.springframework.mail.SimpleMailMessage, String, java.util.Map)public void setPasswordUpdatedTemplate(String passwordUpdatedTemplate)
passwordUpdatedTemplate - the Velocity template to use (relative to classpath)MailEngine.sendMessage(org.springframework.mail.SimpleMailMessage, String, java.util.Map)public org.appfuse.model.User getUser(String userId)
getUser in interface UserManagergetUser in interface UserServiceuserId - the identifier for the userpublic List<org.appfuse.model.User> getUsers()
getUsers in interface UserManagergetUsers in interface UserServicepublic org.appfuse.model.User saveUser(org.appfuse.model.User user)
throws UserExistsException
saveUser in interface UserManagersaveUser in interface UserServiceuser - the user's informationUserExistsException - thrown when user already existspublic void removeUser(org.appfuse.model.User user)
removeUser in interface UserManageruser - the user to removepublic void removeUser(String userId)
removeUser in interface UserManagerremoveUser in interface UserServiceuserId - the user's idpublic org.appfuse.model.User getUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException
getUserByUsername in interface UserManagergetUserByUsername in interface UserServiceusername - the login name of the humanorg.springframework.security.core.userdetails.UsernameNotFoundException - thrown when username not foundpublic List<org.appfuse.model.User> search(String searchTerm)
search in interface UserManagersearchTerm - the search terms.public String buildRecoveryPasswordUrl(org.appfuse.model.User user, String urlTemplate)
UserManagerbuildRecoveryPasswordUrl in interface UserManagerpublic String generateRecoveryToken(org.appfuse.model.User user)
generateRecoveryToken in interface UserManagerpublic boolean isRecoveryTokenValid(String username, String token)
isRecoveryTokenValid in interface UserManagerpublic boolean isRecoveryTokenValid(org.appfuse.model.User user,
String token)
isRecoveryTokenValid in interface UserManagerpublic void sendPasswordRecoveryEmail(String username, String urlTemplate)
sendPasswordRecoveryEmail in interface UserManagerurlTemplate - url template including two placeholders '{username}' and '{token}'public org.appfuse.model.User updatePassword(String username, String currentPassword, String recoveryToken, String newPassword, String applicationUrl) throws UserExistsException
updatePassword in interface UserManagerUserExistsExceptionCopyright © 2003–2013. All rights reserved.