org.appfuse.service
Interface UserManager

All Superinterfaces:
GenericManager<User,java.lang.Long>
All Known Implementing Classes:
UserManagerImpl

public interface UserManager
extends GenericManager<User,java.lang.Long>

Business Service Interface to handle communication between web and persistence layer.

Author:
Matt Raible Modified by Dan Kibler

Method Summary
 User getUser(java.lang.String userId)
          Retrieves a user by userId.
 User getUserByUsername(java.lang.String username)
          Finds a user by their username.
 java.util.List getUsers()
          Retrieves a list of all users.
 void removeUser(java.lang.String userId)
          Removes a user from the database by their userId
 User saveUser(User user)
          Saves a user's information.
 void setUserDao(UserDao userDao)
          Convenience method for testing - allows you to mock the DAO and set it on an interface.
 
Methods inherited from interface org.appfuse.service.GenericManager
exists, get, getAll, remove, save
 

Method Detail

setUserDao

void setUserDao(UserDao userDao)
Convenience method for testing - allows you to mock the DAO and set it on an interface.

Parameters:
userDao - the UserDao implementation to use

getUser

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

Parameters:
userId - the identifier for the user
Returns:
User

getUserByUsername

User getUserByUsername(java.lang.String username)
                       throws org.springframework.security.userdetails.UsernameNotFoundException
Finds a user by their username.

Parameters:
username - the user's username used to login
Returns:
User a populated user object
Throws:
org.springframework.security.userdetails.UsernameNotFoundException - exception thrown when user not found

getUsers

java.util.List getUsers()
Retrieves a list of all users.

Returns:
List

saveUser

User saveUser(User user)
              throws UserExistsException
Saves a user's information.

Parameters:
user - the user's information
Returns:
user the updated user object
Throws:
UserExistsException - thrown when user already exists

removeUser

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

Parameters:
userId - the user's id


Copyright © 2003-2009. All Rights Reserved.