View Javadoc
1   package fr.ifremer.quadrige3.synchro.service.client;
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.common.synchro.service.SynchroResult;
27  import fr.ifremer.quadrige3.synchro.service.client.vo.*;
28  import fr.ifremer.quadrige3.synchro.vo.SynchroExportContextVO;
29  
30  import java.io.File;
31  import java.util.Set;
32  
33  /**
34   * Created by Benoit on 23/06/2015.
35   */
36  public interface SynchroHistoryService {
37  
38  	/**
39  	 * Save import result (to history file)
40  	 *
41  	 * @param userId
42  	 *            a int.
43  	 * @param result
44  	 *            a {@link fr.ifremer.quadrige3.synchro.service.client.vo.SynchroClientImportResult} object.
45  	 */
46  	void save(int userId, SynchroClientImportResult result);
47  
48  	/**
49  	 * Save export result (to history file)
50  	 *
51  	 * @param userId
52  	 *            a int.
53  	 * @param result
54  	 *            a {@link fr.ifremer.quadrige3.synchro.service.client.vo.SynchroClientExportResult} object.
55  	 */
56  	void save(int userId, SynchroClientExportResult result);
57  
58  	/**
59  	 * Save export result (to history file)
60  	 *
61  	 * @param userId
62  	 *            a int.
63  	 * @param exportServerResult
64  	 *            a {@link SynchroResult} object.
65  	 */
66  	void saveExportServerResult(int userId, SynchroResult exportServerResult, Set<String> programCodes);
67  
68  	/**
69  	 * Save import result (to history file)
70  	 *
71  	 * @param userId
72  	 *            a int.
73  	 * @param result
74  	 *            a {@link fr.ifremer.quadrige3.synchro.service.client.vo.SynchroClientImportFromFileResult} object.
75  	 */
76  	void save(int userId, SynchroClientImportFromFileResult result);
77  
78  	/**
79  	 * Save export result (from history file)
80  	 *
81  	 * @param userId
82  	 *            a int.
83  	 * @param result
84  	 *            a {@link fr.ifremer.quadrige3.synchro.service.client.vo.SynchroClientExportToFileResult} object.
85  	 */
86  	void save(int userId, SynchroClientExportToFileResult result);
87  
88  	/**
89  	 * Get the history content, for the user
90  	 *
91  	 * @param userId
92  	 *            a int.
93  	 * @return a {@link java.lang.String} object.
94  	 */
95  	String getContent(int userId);
96  
97  	/**
98  	 * Get history file
99  	 *
100 	 * @param userId
101 	 *            a int.
102 	 * @return a {@link java.io.File} object.
103 	 */
104 	File getHistoryFileByUserId(int userId);
105 
106 	/**
107 	 * Get history file
108 	 *
109 	 * @param userId a int.
110 	 * @param message a message.
111 	 */
112 	void saveExportError(int userId, SynchroExportContextVO exportContext, String message);
113 }