KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > persistence > core > UserDAO


1 /*
2  * Copyright 2004 Blandware (http://www.blandware.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.blandware.atleap.persistence.core;
17
18 import com.blandware.atleap.common.util.PartialCollection;
19 import com.blandware.atleap.common.util.QueryInfo;
20 import com.blandware.atleap.model.core.User;
21 import com.blandware.atleap.model.core.UserCookie;
22
23 /**
24  * <p>User Data Access Object (DAO) interface.
25  * </p>
26  * <p><a HREF="UserDAO.java.htm"><i>View Source</i></a>
27  * </p>
28  *
29  * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com">&lt;sergey.zubtcovskii@blandware.com&gt;</a>
30  * @version $Revision: 1.7 $ $Date: 2006/03/16 11:09:38 $
31  */

32 public interface UserDAO extends DAO {
33
34     // U S E R
35

36     // ~ CRUD Methods ================================================================
37

38     /**
39      * Creates new user
40      *
41      * @param user Value object that represents what user must be created
42      */

43     public void createUser(User user);
44
45     /**
46      * Retrieves user with specified name
47      *
48      * @param userName Name to search by
49      * @return User or null if no user with specified ID exists in database
50      */

51     public User retrieveUser(String JavaDoc userName);
52
53     /**
54      * Updates user
55      *
56      * @param user User to update
57      */

58     public void updateUser(User user);
59
60     /**
61      * Deletes user
62      *
63      * @param user User to delete
64      */

65     public void deleteUser(User user);
66
67     // ~ Additional methods ================================================================
68

69     /**
70      * Retrieves filtered/sorted collection of users.
71      *
72      * @param queryInfo Object that contains information about how to filter and sort data
73      * @return Collection of users
74      */

75     public PartialCollection listUsers(QueryInfo queryInfo);
76
77     // U S E R C O O K I E
78

79     // ~ CRUD Methods ================================================================
80

81     /**
82      * Creates new user cookie
83      *
84      * @param userCookie Value object that represents what userCookie must be created
85      * @param user User for which cookie is created
86      * @return cookie ID
87      */

88     public Long JavaDoc createUserCookie(UserCookie userCookie, User user);
89
90     /**
91      * Retrieves userCookie with specified ID
92      *
93      * @param cookieId ID to search by
94      * @return UserCookie or null if no user cookie with specified ID exists in database
95      */

96     public UserCookie retrieveUserCookie(String JavaDoc cookieId);
97
98     /**
99      * Deletes all cookies of user with specified name
100      *
101      * @param userName Name of userCookie to delete
102      */

103     public void deleteUserCookies(String JavaDoc userName);
104 }
105
Popular Tags