KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > appfuse > service > UserManager


1 package org.appfuse.service;
2
3 import java.util.List JavaDoc;
4
5 import org.acegisecurity.userdetails.UsernameNotFoundException;
6 import org.appfuse.dao.UserDao;
7 import org.appfuse.model.User;
8
9
10 /**
11  * Business Service Interface to handle communication between web and
12  * persistence layer.
13  *
14  * <p><a HREF="UserManager.java.htm"><i>View Source</i></a></p>
15  *
16  * @author <a HREF="mailto:matt@raibledesigns.com">Matt Raible</a>
17  * Modified by <a HREF="mailto:dan@getrolling.com">Dan Kibler </a>
18  */

19 public interface UserManager {
20     
21     public void setUserDao(UserDao userDao);
22
23     /**
24      * Retrieves a user by userId. An exception is thrown if user not found
25      *
26      * @param userId
27      * @return User
28      */

29     public User getUser(String JavaDoc userId);
30     
31     /**
32      * Finds a user by their username.
33      * @param username
34      * @return User a populated user object
35      */

36     public User getUserByUsername(String JavaDoc username) throws UsernameNotFoundException;
37
38     /**
39      * Retrieves a list of users, filtering with parameters on a user object
40      * @param user parameters to filter on
41      * @return List
42      */

43     public List JavaDoc getUsers(User user);
44
45     /**
46      * Saves a user's information
47      *
48      * @param user the user's information
49      * @throws UserExistsException
50      */

51     public void saveUser(User user) throws UserExistsException;
52
53     /**
54      * Removes a user from the database by their userId
55      *
56      * @param userId the user's id
57      */

58     public void removeUser(String JavaDoc userId);
59 }
60
Popular Tags