1 package net.sumaris.importation.service.ices; 2 3 /*- 4 * #%L 5 * SUMARiS:: Core Importation 6 * %% 7 * Copyright (C) 2018 - 2019 SUMARiS Consortium 8 * %% 9 * This program is free software: you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License as 11 * published by the Free Software Foundation, either version 3 of the 12 * License, or (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public 20 * License along with this program. If not, see 21 * <http://www.gnu.org/licenses/gpl-3.0.html>. 22 * #L% 23 */ 24 25 import net.sumaris.importation.exception.FileValidationException; 26 27 import javax.transaction.Transactional; 28 import java.io.File; 29 import java.io.IOException; 30 31 @Transactional 32 public interface IcesDataLoaderService { 33 34 /** 35 * Import a CL file (landing statistics) into the database 36 * 37 * @param inputFile the input data file to import 38 * @param country the country data to import (null=all countries) 39 * @param validate Should apply a validation before importation ? 40 * @param appendData Should append data, or remove previous before (using the country) ? 41 * @return 42 * @throws IOException 43 */ 44 void loadLanding(File inputFile, String country, boolean validate, boolean appendData) throws IOException, 45 FileValidationException; 46 47 /** 48 * Import a TR file (trip) into the database 49 * 50 * @param inputFile the input data file to import 51 * @param country the country data to import (null=all countries) 52 * @param validate Should apply a validation before importation ? 53 * @param appendData Should append data, or remove previous before (using the country) ? 54 * @return 55 * @throws IOException 56 */ 57 void loadTrip(File inputFile, String country, boolean validate, boolean appendData) throws IOException, 58 FileValidationException; 59 60 /** 61 * Import a data file with mixed rows (TR, HH, SL...) 62 * 63 * @param inputFile the input data file to import 64 * @param country the country data to import (null=all countries) 65 * @param validate Should apply a validation before importation ? 66 * @param appendData Should append data, or remove previous before (using the country) ? 67 * @return 68 * @throws IOException 69 */ 70 void loadMixed(File inputFile, String country, boolean validate, boolean appendData) throws IOException, 71 FileValidationException; 72 73 /** 74 * Will detect the file format, then load the file 75 * @param inputFile 76 * @param country 77 * @param validate 78 * @param appendData 79 * @throws IOException 80 * @throws FileValidationException 81 */ 82 void detectFormatAndLoad(File inputFile, String country, boolean validate, boolean appendData) throws IOException, FileValidationException; 83 }