org.appfuse.service.impl
Class UserManagerImpl

java.lang.Object
  extended by org.appfuse.service.impl.UniversalManagerImpl
      extended by org.appfuse.service.impl.UserManagerImpl
All Implemented Interfaces:
UniversalManager, UserManager, UserService

public class UserManagerImpl
extends UniversalManagerImpl
implements UserManager, UserService

Implementation of UserManager interface.

Author:
Matt Raible

Field Summary
 
Fields inherited from class org.appfuse.service.impl.UniversalManagerImpl
log
 
Constructor Summary
UserManagerImpl()
           
 
Method Summary
 org.appfuse.model.User getUser(java.lang.String userId)
          Retrieves a user by userId.
 org.appfuse.model.User getUserByUsername(java.lang.String username)
          Finds a user by their username.
 java.util.List<org.appfuse.model.User> getUsers(org.appfuse.model.User user)
          Retrieves a list of users, filtering with parameters on a user object
 void removeUser(java.lang.String userId)
          Removes a user from the database by their userId
 org.appfuse.model.User saveUser(org.appfuse.model.User user)
          Saves a user's information.
 void setAuthenticationProvider(org.acegisecurity.providers.dao.DaoAuthenticationProvider authenticationProvider)
          Set the DaoAuthenticationProvider object that will provide both the PasswordEncoder and the SaltSource which will be used for password encryption when necessary.
 void setUserDao(org.appfuse.dao.UserDao dao)
          Set the Dao for communication with the data layer.
 
Methods inherited from class org.appfuse.service.impl.UniversalManagerImpl
get, getAll, remove, save, setDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.appfuse.service.UniversalManager
get, getAll, remove, save
 

Constructor Detail

UserManagerImpl

public UserManagerImpl()
Method Detail

setUserDao

public void setUserDao(org.appfuse.dao.UserDao dao)
Set the Dao for communication with the data layer.

Specified by:
setUserDao in interface UserManager
Parameters:
dao - the UserDao that communicates with the database

setAuthenticationProvider

public void setAuthenticationProvider(org.acegisecurity.providers.dao.DaoAuthenticationProvider authenticationProvider)
Set the DaoAuthenticationProvider object that will provide both the PasswordEncoder and the SaltSource which will be used for password encryption when necessary.

Parameters:
authenticationProvider - the DaoAuthenticationProvider object

getUser

public org.appfuse.model.User getUser(java.lang.String userId)
Retrieves a user by userId. An exception is thrown if user not found

Specified by:
getUser in interface UserManager
Specified by:
getUser in interface UserService
Parameters:
userId - the identifier for the user
Returns:
User

getUsers

public java.util.List<org.appfuse.model.User> getUsers(org.appfuse.model.User user)
Retrieves a list of users, filtering with parameters on a user object

Specified by:
getUsers in interface UserManager
Specified by:
getUsers in interface UserService
Parameters:
user - parameters to filter on
Returns:
List

saveUser

public org.appfuse.model.User saveUser(org.appfuse.model.User user)
                                throws UserExistsException
Saves a user's information.

Specified by:
saveUser in interface UserManager
Specified by:
saveUser in interface UserService
Parameters:
user - the user's information
Returns:
user the updated user object
Throws:
UserExistsException - thrown when user already exists

removeUser

public void removeUser(java.lang.String userId)
Removes a user from the database by their userId

Specified by:
removeUser in interface UserManager
Specified by:
removeUser in interface UserService
Parameters:
userId - the user's id

getUserByUsername

public org.appfuse.model.User getUserByUsername(java.lang.String username)
                                         throws org.acegisecurity.userdetails.UsernameNotFoundException
Finds a user by their username.

Specified by:
getUserByUsername in interface UserManager
Specified by:
getUserByUsername in interface UserService
Parameters:
username - the login name of the human
Returns:
User the populated user object
Throws:
org.acegisecurity.userdetails.UsernameNotFoundException - thrown when username not found


Copyright © 2003-2007. All Rights Reserved.