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.LightQuserVO; 26 import fr.ifremer.quadrige3.core.vo.administration.user.PrivilegeVO; 27 import fr.ifremer.quadrige3.core.vo.administration.user.QuserVO; 28 29 import java.util.List; 30 import java.util.Properties; 31 32 33 /** 34 * <p> 35 * QuserJdbcDao interface. 36 * </p> 37 * 38 */ 39 public interface QuserJdbcDao { 40 41 /** 42 * Method used to get the user ID, from a username. 43 * <p/> 44 * This method allow a used outside Spring context, using the given connection properties. 45 * 46 * @param connectionProperties 47 * if <code>null</code>, use the default connection from datasource 48 * @param username 49 * The user login (PERSON.USERNAME or PERSON.USERNAME_EXTRANET) 50 * @return the value of the column PERSON.ID 51 */ 52 Integer getUserIdByUsername(Properties connectionProperties, String username); 53 54 /** 55 * Method used to get the user ID, from a username. 56 * <p/> 57 * This method use the default dataSource bean. 58 * 59 * @param username 60 * The user login (PERSON.USERNAME or PERSON.USERNAME_EXTRANET) 61 * @return the value of the column PERSON.ID 62 */ 63 Integer getUserIdByUsername(String username); 64 65 /** 66 * Get full data on user 67 * <p/> 68 * This method use the default dataSource bean. 69 * 70 * @param userId 71 * a int. 72 * @return a {@link fr.ifremer.quadrige3.core.vo.administration.user.QuserVO} object. 73 */ 74 QuserVO getUserById(int userId); 75 76 /** 77 * Get full data on user. 78 * <p/> 79 * This method allow a used outside Spring context, using the given connection properties. 80 * 81 * @param connectionProperties 82 * if <code>null</code>, use the default connection from datasource 83 * @param userId 84 * a int. 85 * @return a {@link fr.ifremer.quadrige3.core.vo.administration.user.QuserVO} object. 86 */ 87 QuserVO getUserById(Properties connectionProperties, int userId); 88 89 /** 90 * Get minimal data on an user 91 * <p/> 92 * This method use the default dataSource bean. 93 * 94 * @param userId 95 * a int. 96 * @return a {@link fr.ifremer.quadrige3.core.vo.administration.user.LightQuserVO} object. 97 */ 98 LightQuserVO getLightUserById(int userId); 99 100 /** 101 * Get minimal data on an user, from the given connection 102 * <p/> 103 * This method allow a used outside Spring context, using the given connection properties. 104 * 105 * @param connectionProperties 106 * if <code>null</code>, use the default connection from datasource 107 * @param userId 108 * a int. 109 * @return a {@link fr.ifremer.quadrige3.core.vo.administration.user.LightQuserVO} object. 110 */ 111 LightQuserVO getLightUserById(Properties connectionProperties, int userId); 112 113 /** 114 * Get users, by ids 115 * <p/> 116 * 117 * @param ids 118 * a {@link java.util.List} object. 119 * @return a {@link java.util.List} object. 120 */ 121 List<LightQuserVO> getUsersByIds(List<Integer> ids); 122 123 /** 124 * Get users, by ids 125 * <p/> 126 * This method allow a used outside Spring context, using the given connection properties. 127 * 128 * @param connectionProperties 129 * if <code>null</code>, use the default connection from datasource 130 * @param ids 131 * List of user identifiers 132 * @return a {@link java.util.List} object. 133 */ 134 List<LightQuserVO> getUsersByIds(Properties connectionProperties, List<Integer> ids); 135 136 /** 137 * Get user privileges, by user iddentifier 138 * 139 * @param userId 140 * User identifier 141 * @return List of programs 142 */ 143 List<PrivilegeVO> getPrivilegesByUserId(int userId); 144 145 /** 146 * Get privileges by user iddentifier, from the given connection 147 * <p/> 148 * This method allow a used outside Spring context, using the given connection properties. 149 * 150 * @param connectionProperties 151 * if <code>null</code>, use the default connection from datasource 152 * @param userId 153 * User identifier 154 * @return List of programs 155 */ 156 List<PrivilegeVO> getPrivilegesByUserId(Properties connectionProperties, int userId); 157 }