1 package fr.ifremer.quadrige3.core.dao.data.survey;
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.quadrige3.core.dao.system.synchronization.SynchronizationStatus;
27 import fr.ifremer.quadrige3.core.vo.data.survey.LightSurveyVO;
28
29 import java.util.Collection;
30 import java.util.List;
31
32 /**
33 * <p>
34 * SurveyExtendDao interface.
35 * </p>
36 *
37 */
38 public interface SurveyExtendDao extends SurveyDao {
39
40 /**
41 * Delete the survey direclty if data has never been synchronized (no remoteId)
42 * else by DeletedItemHistory
43 *
44 * @param surveyId
45 * a int.
46 * @param recorderPersonId
47 * mandatory if the data has been synchronized. Used to fill DeletedItemHistory.recorderPerson
48 */
49 void removeUsingDeletedItemHistory(int surveyId, Integer recorderPersonId);
50
51 /**
52 * <p>
53 * removeByIds.
54 * </p>
55 *
56 * @param ids
57 * a {@link java.util.Collection} object.
58 */
59 void removeByIds(Collection<Integer> ids);
60
61 /**
62 * <p>
63 * updateSynchronizationStatus.
64 * </p>
65 *
66 * @param surveyId
67 * a int.
68 * @param synchronizationStatus
69 * a {@link fr.ifremer.quadrige3.core.dao.system.synchronization.SynchronizationStatus} object.
70 * @return a int.
71 */
72 int updateSynchronizationStatus(int surveyId, SynchronizationStatus synchronizationStatus);
73
74 /**
75 * <p>
76 * updateSynchronizationStatus.
77 * </p>
78 *
79 * @param surveyIds
80 * a {@link java.util.List} object.
81 * @param synchronizationStatus
82 * a {@link fr.ifremer.quadrige3.core.dao.system.synchronization.SynchronizationStatus} object.
83 * @return a int.
84 */
85 int updateSynchronizationStatus(List<Integer> surveyIds, SynchronizationStatus synchronizationStatus);
86
87 /**
88 * Update HAS_MEAS flags on one survey. And optionnally on child sampling operation
89 *
90 * @param surveyId
91 * a int.
92 * @return updated rows count
93 */
94 int updateHasMeasFlag(int surveyId);
95
96 /**
97 * Update HAS_MEAS flags on a list of surveys. And optionnally on child sampling operation
98 *
99 * @return updated rows count
100 * @param surveyIds
101 * a {@link java.util.List} object.
102 */
103 int updateHasMeasFlag(List<Integer> surveyIds);
104
105 /**
106 * Apply the survey program to all children entities
107 * @param surveyId the survey id
108 */
109 void applySurveyProgramsToChildren(int surveyId);
110
111 /**
112 * <p>
113 * isReadyToSynchronizeStatusForRecorderPerson.
114 * </p>
115 *
116 * @param recorderPersonId
117 * a int.
118 * @return a boolean.
119 */
120 boolean isReadyToSynchronizeStatusForRecorderPerson(int recorderPersonId);
121
122 /**
123 * Get IDs of observed locations that could be clean (ObservedLocation without ANY access rights on local DB)
124 *
125 * @return a {@link java.util.List} object.
126 */
127 List<Integer> getCleanableSurveyIds();
128
129 /**
130 * Get a light representation of a Survey.
131 *
132 * @param surveyId
133 * a int.
134 * @return a light value object
135 */
136 LightSurveyVO getLightSurveyById(int surveyId);
137 }