View Javadoc
1   package fr.ifremer.quadrige3.core.dao.administration.user;
2   
3   /*-
4    * #%L
5    * Quadrige3 Core :: Quadrige3 Client Core
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2017 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
24   */
25  import fr.ifremer.quadrige3.core.vo.administration.user.QuserVO;
26  
27  import java.util.List;
28  
29  
30  /**
31   * <p>
32   * QuserExtendDao interface.
33   * </p>
34   * 
35   */
36  public interface QuserExtendDao extends QuserDao {
37  
38  	/**
39  	 * Create a new temporary user
40  	 * 
41  	 * @param lastname
42  	 *            a {@link java.lang.String} object.
43  	 * @param firstname
44  	 *            a {@link java.lang.String} object.
45  	 * @param departmentId
46  	 *            a {@link java.lang.Integer} object.
47  	 * @return a {@link fr.ifremer.quadrige3.core.dao.administration.user.Quser} object.
48  	 */
49  	Quser createAsTemporary(String lastname, String firstname, Integer departmentId);
50  
51  	/**
52  	 * Save the given user
53  	 * 
54  	 * @param bean
55  	 *            a {@link QuserVO} object.
56  	 */
57  	void save(QuserVO bean);
58  
59  	/**
60  	 * Get the departement id of an user.
61  	 * 
62  	 * @param userId
63  	 *            a int.
64  	 * @return The department id
65  	 */
66  	Integer getDepartmentIdByUserId(int userId);
67  
68  	/**
69  	 * Get privileges (code) by user id
70  	 * 
71  	 * @param quserId
72  	 *            a int.
73  	 * @return a {@link java.util.List} object.
74  	 */
75  	List<String> getPrivilegeCodesByUserId(int quserId);
76  
77  	/**
78  	 * <p>
79  	 * isLoginExtranet.
80  	 * </p>
81  	 * 
82  	 * @param login
83  	 *            a {@link java.lang.String} object.
84  	 * @return a {@link java.lang.Boolean} object.
85  	 */
86  	Boolean isLoginExtranet(String login);
87  
88  	/**
89  	 * <p>
90  	 * hasPassword.
91  	 * </p>
92  	 * 
93  	 * @param login
94  	 *            a {@link java.lang.String} object.
95  	 * @return a boolean.
96  	 */
97  	boolean hasPassword(String login);
98  
99  	/**
100 	 * <p>
101 	 * isLocalUserWithNoPassword.
102 	 * </p>
103 	 * 
104 	 * @param login
105 	 *            a {@link java.lang.String} object.
106 	 * @return a boolean.
107 	 */
108 	boolean isLocalUserWithNoPassword(String login);
109 
110 	/**
111 	 * <p>
112 	 * getPasswordByUserId.
113 	 * </p>
114 	 * 
115 	 * @param userId
116 	 *            a int.
117 	 * @return a {@link java.lang.String} object.
118 	 */
119 	String getPasswordByUserId(int userId);
120 
121 	/**
122 	 * <p>
123 	 * updatePasswordByUserId.
124 	 * </p>
125 	 * 
126 	 * @param userId
127 	 *            a int.
128 	 * @param cryptedPassword
129 	 *            a {@link java.lang.String} object.
130 	 */
131 	void updatePasswordByUserId(int userId, String cryptedPassword);
132 
133 	/**
134 	 * <p>
135 	 * resetPassword.
136 	 * </p>
137 	 * 
138 	 * @param login
139 	 *            a {@link java.lang.String} object.
140 	 */
141 	void resetPassword(String login);
142 
143 }