1 package com.panogenesis.service;
2
3 import java.util.List;
4
5 import com.panogenesis.dao.UserDAO;
6 import com.panogenesis.model.User;
7
8
9 /***
10 * Business Service Interface to handle communication between web and
11 * persistence layer.
12 *
13 * <p><a href="UserManager.java.html"><i>View Source</i></a></p>
14 *
15 * @author <a href="mailto:matt@raibledesigns.com">Matt Raible</a>
16 * Modified by <a href="mailto:dan@getrolling.com">Dan Kibler </a>
17 */
18 public interface UserManager {
19
20
21 public void setUserDAO(UserDAO dao);
22
23 /***
24 * Retrieves a user by username. An exception is thrown if now user
25 * is found.
26 *
27 * @param username
28 * @return User
29 */
30 public User getUser(String username);
31
32 /***
33 * Retrieves a list of users, filtering with parameters on a user object
34 * @param user parameters to filter on
35 * @return List
36 */
37 public List getUsers(User user);
38
39 /***
40 * Saves a user's information
41 *
42 * @param user the user's information
43 * @throws UserExistsException
44 */
45 public void saveUser(User user) throws UserExistsException;
46
47 /***
48 * Removes a user from the database by their username
49 *
50 * @param username the user's username
51 */
52 public void removeUser(String username);
53
54 /***
55 * Validates a user based on a cookie value. If successful, it returns
56 * a new cookie String. If not, then it returns null.
57 *
58 * @param value (in format username|guid)
59 * @return indicator that this is a valid login (null == invalid)
60 */
61 public String checkLoginCookie(String value);
62
63 /***
64 * Creates a cookie string using a username - designed for use when
65 * a user logs in and wants to be remembered.
66 *
67 * @param username
68 * @return String to put in a cookie for remembering user
69 */
70 public String createLoginCookie(String username);
71
72 /***
73 * Deletes all cookies for user.
74 * @param username
75 */
76 public void removeLoginCookies(String username);
77 }