[abportal] Annotation of /src/main/java/eu/smartlm/abs/portal/security/login/dao/UserDao.java
Annotation of /src/main/java/eu/smartlm/abs/portal/security/login/dao/UserDao.java
Parent Directory
| Revision Log
Revision 1 -
(view)
(download)
1 : |
dgarcia |
1 |
package eu.smartlm.abs.portal.security.login.dao;
|
2 : |
|
|
|
3 : |
|
|
import java.util.List;
|
4 : |
|
|
|
5 : |
|
|
import eu.smartlm.abs.portal.security.login.model.User;
|
6 : |
|
|
|
7 : |
|
|
/**
|
8 : |
|
|
* Interface that abstract the User database implementation from the rest of the project
|
9 : |
|
|
* @author David García Pérez - CESGA
|
10 : |
|
|
**/
|
11 : |
|
|
public interface UserDao {
|
12 : |
|
|
public static int USER_ADDED = 100;
|
13 : |
|
|
public static int ALREADY_USED_USERNAME = 200;
|
14 : |
|
|
/**
|
15 : |
|
|
* Gives back a list with all the users stored in teh database
|
16 : |
|
|
* @return a list of all users
|
17 : |
|
|
*/
|
18 : |
|
|
public List<User> getUsers();
|
19 : |
|
|
|
20 : |
|
|
/**
|
21 : |
|
|
* Adds an user to the database
|
22 : |
|
|
* @param user to be added
|
23 : |
|
|
*/
|
24 : |
|
|
public int addUser(User user);
|
25 : |
|
|
|
26 : |
|
|
/**
|
27 : |
|
|
* Removes an specific user from the database
|
28 : |
|
|
* @param username of the user to be removed
|
29 : |
|
|
*/
|
30 : |
|
|
public void removeUser(String username);
|
31 : |
|
|
|
32 : |
|
|
/**
|
33 : |
|
|
* Edits the information of an user stored in the database
|
34 : |
|
|
* @param user with the same id but with the updated information
|
35 : |
|
|
*/
|
36 : |
|
|
public void editUser(User user);
|
37 : |
|
|
|
38 : |
|
|
/**
|
39 : |
|
|
* Retrieves an user form the database by username field
|
40 : |
|
|
* @param username of the user to be retrieved
|
41 : |
|
|
* @return the User or <code>null</code> if the users does not exists in the database
|
42 : |
|
|
*/
|
43 : |
|
|
public User getUser(String username);
|
44 : |
|
|
}
|
|