com.gisgraphy.service
Interface UserManager

All Superinterfaces:
UniversalManager
All Known Implementing Classes:
UserManagerImpl

public interface UserManager
extends UniversalManager

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<User> getUsers(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
 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 com.gisgraphy.service.UniversalManager
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.acegisecurity.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.acegisecurity.userdetails.UsernameNotFoundException - exception thrown when user not found

getUsers

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

Parameters:
user - parameters to filter on
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 © 2010. All Rights Reserved.