1 package fr.ifremer.quadrige3.core.dao.administration.program; 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 26 import fr.ifremer.quadrige3.core.vo.administration.program.ProgramVO; 27 import fr.ifremer.quadrige3.core.vo.administration.strategy.StrategyVO; 28 29 import java.util.List; 30 import java.util.Properties; 31 32 /** 33 * Created by blavenie on 31/08/15. 34 */ 35 public interface ProgramStrategyJdbcDao { 36 37 /** 38 * <p> 39 * getProgramsByCodes. 40 * </p> 41 * 42 * @param codes 43 * a {@link java.util.List} object. 44 * @return a {@link java.util.List} object. 45 */ 46 // todo this method is really used 47 List<ProgramVO> getProgramsByCodes(List<String> codes); 48 49 /** 50 * <p> 51 * getProgramByCode. 52 * </p> 53 * 54 * @param code 55 * a {@link java.lang.String} object. 56 * @return a {@link fr.ifremer.quadrige3.core.vo.administration.program.ProgramVO} object. 57 */ 58 ProgramVO getProgramByCode(String code); 59 60 List<String> getAllProgramCodes(); 61 62 /** 63 * <p> 64 * getLocalProgramCodes. 65 * </p> 66 * 67 * @return a {@link java.util.List} object. 68 */ 69 List<String> getLocalProgramCodes(); 70 71 /** 72 * <p> 73 * getStrategiesByIds. 74 * </p> 75 * 76 * @param ids 77 * a {@link java.util.List} object. 78 * @return a {@link java.util.List} object. 79 */ 80 // todo this method is really used 81 List<StrategyVO> getStrategiesByIds(List<Integer> ids); 82 83 /** 84 * <p> 85 * getStrategyById. 86 * </p> 87 * 88 * @param id 89 * a int. 90 * @return a {@link fr.ifremer.quadrige3.core.vo.administration.strategy.StrategyVO} object. 91 */ 92 StrategyVO getStrategyById(int id); 93 94 /** 95 * Get programs of an user (with read access rights on data). 96 * 97 * @param userId 98 * User identifier 99 * @return List of programs 100 */ 101 List<ProgramVO> getReadableProgramsByUserId(int userId); 102 103 /** 104 * Get programs of an user (with read access rights), from the given connection 105 * <p/> 106 * This method allow a used outside Spring context, using the given connection properties. 107 * 108 * @param connectionProperties 109 * if <code>null</code>, use the default connection from datasource 110 * @param userId 111 * User identifier 112 * @return List of programs 113 */ 114 List<ProgramVO> getReadableProgramsByUserId(Properties connectionProperties, int userId); 115 116 /** 117 * Get programs of an user (with read/write access rights on data). 118 * 119 * @param userId 120 * User identifier 121 * @return List of programs 122 */ 123 List<ProgramVO> getWritableProgramsByUserId(int userId); 124 125 /** 126 * Get programs of an user (with read/write access rights), from the given connection 127 * <p/> 128 * This method allow a used outside Spring context, using the given connection properties. 129 * 130 * @param connectionProperties 131 * if <code>null</code>, use the default connection from datasource 132 * @param userId 133 * User identifier 134 * @return List of programs 135 */ 136 List<ProgramVO> getWritableProgramsByUserId(Properties connectionProperties, int userId); 137 138 /** 139 * Get programs of an user (with manager access rights: user can update program & strategies). 140 * 141 * @param userId 142 * User identifier 143 * @return List of programs 144 */ 145 List<ProgramVO> getManagedProgramsByUserId(int userId); 146 147 /** 148 * Get programs of an user (with manager access rights: user can update program & strategies). 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<ProgramVO> getManagedProgramsByUserId(Properties connectionProperties, int userId); 157 158 }