1 package fr.ifremer.quadrige2.core.dao.administration.program; 2 3 /*- 4 * #%L 5 * Quadrige2 Core :: Quadrige2 Server 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.quadrige2.core.vo.administration.program.ProgramVO; 27 import fr.ifremer.quadrige2.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 List<ProgramVO> getProgramsByCodes(List<String> codes); 47 48 /** 49 * <p> 50 * getProgramByCode. 51 * </p> 52 * 53 * @param code 54 * a {@link java.lang.String} object. 55 * @return a {@link fr.ifremer.quadrige2.core.vo.administration.program.ProgramVO} object. 56 */ 57 ProgramVO getProgramByCode(String code); 58 59 /** 60 * <p> 61 * getStrategiesByIds. 62 * </p> 63 * 64 * @param ids 65 * a {@link java.util.List} object. 66 * @return a {@link java.util.List} object. 67 */ 68 List<StrategyVO> getStrategiesByIds(List<Integer> ids); 69 70 /** 71 * <p> 72 * getStrategyById. 73 * </p> 74 * 75 * @param id 76 * a int. 77 * @return a {@link fr.ifremer.quadrige2.core.vo.administration.strategy.StrategyVO} object. 78 */ 79 StrategyVO getStrategyById(int id); 80 81 /** 82 * Get programs of an user (with read/write access rights on data). 83 * 84 * @param userId 85 * User identifier 86 * @return List of programs 87 */ 88 List<ProgramVO> getWritableProgramsByUserId(int userId); 89 90 /** 91 * Get programs of an user (with read/write access rights), from the given connection 92 * <p/> 93 * This method allow a used outside Spring context, using the given connection properties. 94 * 95 * @param connectionProperties 96 * if <code>null</code>, use the default connection from datasource 97 * @param userId 98 * User identifier 99 * @return List of programs 100 */ 101 List<ProgramVO> getWritableProgramsByUserId(Properties connectionProperties, int userId); 102 103 /** 104 * Get programs of an user (with manager access rights: user can update program & strategies). 105 * 106 * @param userId 107 * User identifier 108 * @return List of programs 109 */ 110 List<ProgramVO> getManagedProgramsByUserId(int userId); 111 112 /** 113 * Get programs of an user (with manager access rights: user can update program & strategies). 114 * 115 * @param connectionProperties 116 * if <code>null</code>, use the default connection from datasource 117 * @param userId 118 * User identifier 119 * @return List of programs 120 */ 121 List<ProgramVO> getManagedProgramsByUserId(Properties connectionProperties, int userId); 122 123 }