1 package fr.ifremer.dali.service.synchro; 2 3 /* 4 * #%L 5 * Dali :: Core 6 * $Id:$ 7 * $HeadURL:$ 8 * %% 9 * Copyright (C) 2014 - 2015 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 com.google.common.collect.Multimap; 27 import fr.ifremer.quadrige3.core.ProgressionCoreModel; 28 import fr.ifremer.quadrige3.synchro.vo.SynchroImportContextVO; 29 import fr.ifremer.dali.dto.system.synchronization.SynchroChangesDTO; 30 import org.springframework.transaction.annotation.Propagation; 31 import org.springframework.transaction.annotation.Transactional; 32 33 import java.io.File; 34 35 /** 36 * Created by blavenie on 03/09/15. 37 */ 38 @Transactional(propagation = Propagation.REQUIRED) 39 public interface SynchroClientService extends fr.ifremer.quadrige3.synchro.service.client.SynchroClientService { 40 41 /** 42 * Compute change log from a file to import 43 * 44 * @param userId a int. 45 * @param dbZipFile a {@link File} object. 46 * @param importContext a {@link SynchroImportContextVO} object. 47 * @param progressionModel progression model 48 * @param progressionModelMaxCount a int. 49 * @return a DTO to return 50 */ 51 @Transactional(propagation = Propagation.NEVER) 52 SynchroChangesDTO getImportFileChangesAsDTO( 53 int userId, 54 File dbZipFile, 55 SynchroImportContextVO importContext, 56 ProgressionCoreModel progressionModel, 57 int progressionModelMaxCount); 58 59 /** 60 * <p>toPkToIncludesMap.</p> 61 * 62 * @param changes a {@link fr.ifremer.dali.dto.system.synchronization.SynchroChangesDTO} object. 63 * @return a {@link com.google.common.collect.Multimap} object. 64 */ 65 @Transactional(readOnly = true, propagation = Propagation.SUPPORTS) 66 Multimap<String, String> toPkToIncludesMap(SynchroChangesDTO changes); 67 68 /** 69 * Check if SynchroChangesDTO bean has at least one table from program/strategy or rules 70 * 71 * @param synchroChanges a {@link fr.ifremer.dali.dto.system.synchronization.SynchroChangesDTO} object. 72 * @return true if one of those tables is found 73 */ 74 @Transactional(readOnly = true, propagation = Propagation.SUPPORTS) 75 boolean hasProgramOrRulesChanges(SynchroChangesDTO synchroChanges); 76 77 /** 78 * Filter SynchroTableDTO and SynchroRowDTO with INSERT operation only on referential tables.<br/> 79 * Keep UPDATE for program/strategy or rules tables. 80 * 81 * @param synchroChanges a {@link fr.ifremer.dali.dto.system.synchronization.SynchroChangesDTO} object. 82 * @return the filtered SynchroChangesDTO bean 83 */ 84 @Transactional(readOnly = true, propagation = Propagation.SUPPORTS) 85 SynchroChangesDTO getReferentialSynchroChangesToApplyFromFile(SynchroChangesDTO synchroChanges); 86 87 /** 88 * Filter SynchroTableDTO and SynchroRowDTO with INSERT and DUPLICATE operation only on SURVEY table 89 * 90 * @param synchroChanges a {@link fr.ifremer.dali.dto.system.synchronization.SynchroChangesDTO} object. 91 * @return the filtered SynchroChangesDTO bean 92 */ 93 @Transactional(readOnly = true, propagation = Propagation.SUPPORTS) 94 SynchroChangesDTO getSurveySynchroChangesFromFile(SynchroChangesDTO synchroChanges); 95 96 97 }