org.appfuse.service
Interface UserManager

All Superinterfaces:
GenericManager<org.appfuse.model.User,Long>
All Known Implementing Classes:
UserManagerImpl

public interface UserManager
extends GenericManager<org.appfuse.model.User,Long>

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

Author:
Matt Raible Modified by Dan Kibler

Method Summary
 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.
 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 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, reindex, reindexAll, remove, remove, save, search
 

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

org.appfuse.model.User getUser(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

org.appfuse.model.User getUserByUsername(String username)
                                         throws org.springframework.security.core.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.core.userdetails.UsernameNotFoundException - exception thrown when user not found

getUsers

List<org.appfuse.model.User> getUsers()
Retrieves a list of all users.

Returns:
List

saveUser

org.appfuse.model.User saveUser(org.appfuse.model.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(org.appfuse.model.User user)
Removes a user from the database

Parameters:
user - the user to remove

removeUser

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

Parameters:
userId - the user's id

search

List<org.appfuse.model.User> search(String searchTerm)
Search a user for search terms.

Parameters:
searchTerm - the search terms.
Returns:
a list of matches, or all if no searchTerm.


Copyright © 2003-2012. All Rights Reserved.