1 package fr.ifremer.quadrige2.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.quadrige2.core.config.Quadrige2Configuration;
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
78
79
80 QUALIFICATION_HISTORY,
81 VALIDATION_HISTORY,
82 DELETED_ITEM_HISTORY;
83
84
85 private static Set<String> tableNames = null;
86
87
88
89
90
91
92
93
94 public static Set<String> tableNames() {
95 if (tableNames != null) {
96 return tableNames;
97 }
98
99 tableNames = Sets.newLinkedHashSet();
100 for (DataSynchroTables value : values()) {
101 tableNames.add(value.name());
102 }
103
104 tableNames = ImmutableSet.copyOf(tableNames);
105 return tableNames;
106 }
107
108
109
110
111
112
113
114 public static Set<String> getImportTablesIncludes() {
115
116 Set<String> tableNames = Quadrige2Configuration.getInstance().getImportDataTablesIncludes();
117 if (CollectionUtils.isNotEmpty(tableNames)) {
118 return tableNames;
119 }
120
121 return tableNames();
122 }
123 }