1 package fr.ifremer.quadrige3.synchro.meta.data;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 import com.google.common.collect.ImmutableSet;
27 import com.google.common.collect.Sets;
28 import fr.ifremer.quadrige3.core.config.QuadrigeConfiguration;
29 import org.apache.commons.collections4.CollectionUtils;
30
31 import java.util.Set;
32
33
34
35
36
37
38
39 public enum DataSynchroTables {
40
41
42
43
44 SURVEY,
45 SURVEY_PROG,
46 SURVEY_QUSER,
47
48 EVENT_SURVEY,
49
50 SURVEY_POINT,
51 SURVEY_LINE,
52 SURVEY_AREA,
53
54 SAMPLING_OPERATION,
55 SAMPLING_OPER_PROG,
56 SAMPLING_OPER_AREA,
57 SAMPLING_OPER_LINE,
58 SAMPLING_OPER_POINT,
59
60 SAMPLE,
61 SAMPLE_PROG,
62
63 FIELD_OBSERVATION,
64
65 MEASUREMENT,
66 PROG_MEAS,
67
68 TAXON_MEASUREMENT,
69 PROG_TAXON_MEAS,
70
71 MEASUREMENT_FILE,
72 PROG_MEAS_FILE,
73
74 MEASURED_PROFILE,
75 MEAS_PROF_PROG,
76
77 PHOTO,
78
79 QUALIFICATION_HISTORY,
80 VALIDATION_HISTORY,
81 DELETED_ITEM_HISTORY;
82
83
84 private static Set<String> tableNames = null;
85
86
87
88
89
90
91
92
93 public static Set<String> tableNames() {
94 if (tableNames != null) {
95 return tableNames;
96 }
97
98 tableNames = Sets.newLinkedHashSet();
99 for (DataSynchroTables value : values()) {
100 tableNames.add(value.name());
101 }
102
103 tableNames = ImmutableSet.copyOf(tableNames);
104 return tableNames;
105 }
106
107
108
109
110
111
112
113 public static Set<String> getImportTablesIncludes() {
114
115 Set<String> tableNames = QuadrigeConfiguration.getInstance().getImportDataTablesIncludes();
116 if (CollectionUtils.isNotEmpty(tableNames)) {
117 return tableNames;
118 }
119
120 return tableNames();
121 }
122 }