View Javadoc
1   package fr.ifremer.dali.dao.administration.user;
2   
3   /*
4    * #%L
5    * Dali :: Core
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2013 - 2014 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  
26  import fr.ifremer.quadrige3.core.dao.administration.user.QuserExtendDao;
27  import fr.ifremer.dali.dto.referential.PersonDTO;
28  import fr.ifremer.dali.dto.referential.PrivilegeDTO;
29  import org.springframework.cache.annotation.Cacheable;
30  
31  import java.util.Collection;
32  import java.util.List;
33  
34  /**
35   * <p>DaliQuserDao interface.</p>
36   *
37   */
38  public interface DaliQuserDao extends QuserExtendDao {
39  
40      /** Constant <code>TRANSFORM_PERSON_DTO=100</code> */
41      int TRANSFORM_PERSON_DTO = 100;
42      /** Constant <code>USER_BY_ID_CACHE="userById"</code> */
43      String USER_BY_ID_CACHE = "user_by_id";
44      /** Constant <code>ALL_USER_CACHE="allUsers"</code> */
45      String ALL_USER_CACHE = "all_users";
46  
47      /**
48       * <p>getUserById.</p>
49       *
50       * @param personId a int.
51       * @return a {@link fr.ifremer.dali.dto.referential.PersonDTO} object.
52       */
53      @Cacheable(value = USER_BY_ID_CACHE)
54      PersonDTO getUserById(int personId);
55  
56      /**
57       * <p>getAllUsers.</p>
58       *
59       * @param statusCodes a {@link java.util.List} object.
60       * @return a {@link java.util.List} object.
61       */
62      @Cacheable(value = ALL_USER_CACHE)
63      List<PersonDTO> getAllUsers(List<String> statusCodes);
64  
65      /**
66       * <p>findUsersByCriteria.</p>
67       *
68       * @param lastName a {@link java.lang.String} object.
69       * @param firstName a {@link java.lang.String} object.
70       * @param strictName a boolean.
71       * @param login a {@link java.lang.String} object.
72       * @param departmentId a {@link java.lang.Integer} object.
73       * @param privilegeCode a {@link java.lang.String} object.
74       * @param statusCodes    @return
75       * @return a {@link java.util.List} object.
76       */
77      List<PersonDTO> findUsersByCriteria(String lastName, String firstName, boolean strictName, String login, Integer departmentId, String privilegeCode, List<String> statusCodes);
78  
79      /**
80       * <p>getUserByLogin.</p>
81       *
82       * @param statusCodes a {@link java.util.List} object.
83       * @param login a {@link java.lang.String} object.
84       * @return a {@link fr.ifremer.dali.dto.referential.PersonDTO} object.
85       */
86      PersonDTO getUserByLogin(List<String> statusCodes, String login);
87  
88      /**
89       * <p>getUsersByIds.</p>
90       *
91       * @param userIds a {@link java.util.List} object.
92       * @return a {@link java.util.List} object.
93       */
94      List<PersonDTO> getUsersByIds(List<Integer> userIds);
95  
96      /**
97       * <p>isUserUsedInProgram.</p>
98       *
99       * @param id a int.
100      * @return a boolean.
101      */
102     boolean isUserUsedInProgram(int id);
103 
104     /**
105      * <p>isUserUsedInRules.</p>
106      *
107      * @param id a int.
108      * @return a boolean.
109      */
110     boolean isUserUsedInRules(int id);
111 
112     /**
113      * <p>isUserUsedInData.</p>
114      *
115      * @param id a int.
116      * @return a boolean.
117      */
118     boolean isUserUsedInData(int id);
119 
120     /**
121      * <p>isUserUsedInValidatedData.</p>
122      *
123      * @param id a int.
124      * @return a boolean.
125      */
126     boolean isUserUsedInValidatedData(int id);
127 
128     /**
129      * <p>getAllPrivileges.</p>
130      *
131      * @return a {@link java.util.List} object.
132      */
133     List<PrivilegeDTO> getAllPrivileges();
134 
135     Collection<PrivilegeDTO> getPrivilegesByUserId(Integer userId);
136 
137 }