View Javadoc
1   package fr.ifremer.quadrige2.synchro.server.service.synchro.job;
2   
3   /*-
4    * #%L
5    * Quadrige2 Core :: Quadrige2 Synchro server
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  
27  
28  import fr.ifremer.quadrige2.synchro.server.vo.synchro.SynchroJobVO;
29  import fr.ifremer.quadrige2.synchro.vo.SynchroExportContextVO;
30  import fr.ifremer.quadrige2.synchro.vo.SynchroImportContextVO;
31  import fr.ifremer.quadrige2.synchro.vo.SynchroProgressionModel;
32  import org.springframework.transaction.annotation.Transactional;
33  
34  import java.io.File;
35  import java.util.List;
36  import java.util.Locale;
37  
38  @Transactional(readOnly = true)
39  public interface SynchroJobService {
40  
41      String DB_FILE_PATTERN = "%s-db-%s";
42  
43      List<SynchroJobVO> getImportationJobs();
44      
45      List<SynchroJobVO> getExportationJobs();
46  
47      SynchroNewInstallDbJob startNewInstallDb(String sessionId, Locale locale);
48      
49      SynchroImportJob startImport(
50              String jobId,
51              int userId, 
52              Locale locale);
53  
54      SynchroImportJob startImport(
55              String jobId,
56              int userId, 
57              Locale locale,
58              SynchroImportContextVO context);
59  
60      SynchroExportDataJob startExportData(
61              String jobId,
62              int userId,
63              Locale locale,
64              File uploadedFile,
65              SynchroExportContextVO context);
66  
67      void finalizeExportData(
68              String jobId,
69              int userId,
70              Locale locale,
71              SynchroExportContextVO context);
72  
73      void stopJob(String jobId);
74  
75      void acknowledge(int userId, Locale locale, SynchroImportContextVO context);
76  
77      SynchroJob getJobById(String jobId);
78  
79      SynchroJob getJobByUploadFilename(String filename);
80  
81      SynchroProgressionModel getProgressionByJobId(String sessionId);
82  }