1 package fr.ifremer.quadrige2.synchro.vo;
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.Multimap;
27
28 import java.beans.PropertyChangeListener;
29 import java.beans.PropertyChangeSupport;
30 import java.io.Serializable;
31 import java.util.Date;
32 import java.util.Set;
33
34
35
36
37
38
39
40
41
42 public class SynchroImportContextVO implements Serializable, Cloneable {
43
44 private static final long serialVersionUID = 2375804877480968569L;
45
46
47 public static final String PROPERTY_JOB_ID = "jobId";
48
49 public static final String PROPERTY_REFERENTIAL_UPDATE_DATE = "referentialUpdateDate";
50
51 public static final String PROPERTY_DATA_UPDATE_DATE = "dataUpdateDate";
52
53 public static final String PROPERTY_DATA_START_DATE = "dataStartDate";
54
55 public static final String PROPERTY_DATA_END_DATE = "dataEndDate";
56
57 public static final String PROPERTY_WITH_REFERENTIAL = "withReferential";
58
59 public static final String PROPERTY_WITH_DATA = "withData";
60
61 public static final String PROPERTY_REFERENTIAL_PK_INCLUDES = "referentialPkIncludes";
62
63 public static final String PROPERTY_DATA_PK_INCLUDES = "dataPkIncludes";
64
65 public static final String PROPERTY_FORCE_DUPLICATION = "forceDuplication";
66
67 public static final String PROPERTY_DATA_PROGRAM_CODES = "dataProgramCodes";
68
69 public static final String PROPERTY_REFERENTIAL_PROGRAM_CODES = "referentialProgramCodes";
70
71 public static final String PROPERTY_DATA_FORCE_EDITED_ROW_OVERRIDE = "dataForceEditedRowOverride";
72
73 private String jobId;
74 private Date referentialUpdateDate;
75 private Date dataUpdateDate;
76 private Date dataStartDate;
77 private Date dataEndDate;
78 private Multimap<String, String> referentialPkIncludes;
79 private Multimap<String, String> dataPkIncludes;
80 private boolean forceDuplication = false;
81 private Set<String> dataProgramCodes;
82 private Set<String> referentialProgramCodes;
83 private boolean dataForceEditedRowOverride = false;
84 private boolean withReferential = false;
85 private boolean withData = false;
86 private boolean referentialProgramsForceImport = false;
87
88 transient PropertyChangeSupport pcs = new PropertyChangeSupport(this);
89
90
91
92
93
94
95 public SynchroImportContextVO() {
96 }
97
98
99
100
101
102
103
104
105
106 protected SynchroImportContextVO(SynchroImportContextVO otherBean) {
107 this();
108 copy(otherBean);
109 }
110
111
112
113
114
115
116
117
118
119 public void addPropertyChangeListener(PropertyChangeListener listener) {
120 this.pcs.addPropertyChangeListener(listener);
121 }
122
123
124
125
126
127
128
129
130
131 public void removePropertyChangeListener(PropertyChangeListener listener) {
132 this.pcs.removePropertyChangeListener(listener);
133 }
134
135
136 @Override
137 public Object clone() {
138 return new SynchroImportContextVO().copy(this);
139 }
140
141
142
143
144
145
146
147
148 public String getJobId() {
149 return jobId;
150 }
151
152
153
154
155
156
157
158
159
160 public void setJobId(String jobId) {
161 this.jobId = jobId;
162 this.pcs.firePropertyChange(PROPERTY_JOB_ID, null, jobId);
163 }
164
165
166
167
168
169
170
171
172 public Date getReferentialUpdateDate() {
173 return referentialUpdateDate;
174 }
175
176
177
178
179
180
181
182
183
184 public void setReferentialUpdateDate(Date referentialUpdateDate) {
185 this.referentialUpdateDate = referentialUpdateDate;
186 }
187
188
189
190
191
192
193
194
195 public Date getDataUpdateDate() {
196 return dataUpdateDate;
197 }
198
199
200
201
202
203
204
205
206
207 public void setDataUpdateDate(Date dataUpdateDate) {
208 this.dataUpdateDate = dataUpdateDate;
209 }
210
211
212
213
214
215
216
217
218 public Date getDataStartDate() {
219 return dataStartDate;
220 }
221
222
223
224
225
226
227
228
229
230 public void setDataStartDate(Date dataStartDate) {
231 this.dataStartDate = dataStartDate;
232 }
233
234
235
236
237
238
239
240
241 public Date getDataEndDate() {
242 return dataEndDate;
243 }
244
245
246
247
248
249
250
251
252
253 public void setDataEndDate(Date dataEndDate) {
254 this.dataEndDate = dataEndDate;
255 }
256
257
258
259
260
261
262
263
264 public Multimap<String, String> getReferentialPkIncludes() {
265 return referentialPkIncludes;
266 }
267
268
269
270
271
272
273
274
275
276 public void setReferentialPkIncludes(Multimap<String, String> referentialPkIncludes) {
277 this.referentialPkIncludes = referentialPkIncludes;
278 }
279
280
281
282
283
284
285
286
287 public Multimap<String, String> getDataPkIncludes() {
288 return dataPkIncludes;
289 }
290
291
292
293
294
295
296
297
298
299 public void setDataPkIncludes(Multimap<String, String> dataPkIncludes) {
300 this.dataPkIncludes = dataPkIncludes;
301 }
302
303
304
305
306
307
308
309
310 public boolean isForceDuplication() {
311 return forceDuplication;
312 }
313
314
315
316
317
318
319
320
321
322 public void setForceDuplication(boolean forceDuplication) {
323 this.forceDuplication = forceDuplication;
324 }
325
326
327
328
329
330
331
332
333 public boolean isWithReferential() {
334 return withReferential;
335 }
336
337
338
339
340
341
342
343
344
345 public void setWithReferential(boolean referential) {
346 this.withReferential = referential;
347 }
348
349
350
351
352
353
354
355
356 public boolean isWithData() {
357 return withData;
358 }
359
360
361
362
363
364
365
366
367
368 public void setWithData(boolean data) {
369 this.withData = data;
370 }
371
372
373
374
375
376
377
378
379 public boolean isDataForceEditedRowOverride() {
380 return dataForceEditedRowOverride;
381 }
382
383
384
385
386
387
388
389
390
391 public void setDataForceEditedRowOverride(boolean dataForceEditedRowOverride) {
392 this.dataForceEditedRowOverride = dataForceEditedRowOverride;
393 }
394
395
396
397
398
399
400
401
402 public Set<String> getDataProgramCodes() {
403 return dataProgramCodes;
404 }
405
406
407
408
409
410
411
412
413
414 public void setDataProgramCodes(Set<String> dataProgramCodes) {
415 this.dataProgramCodes = dataProgramCodes;
416 }
417
418
419
420
421
422
423
424
425 public Set<String> getReferentialProgramCodes() {
426 return referentialProgramCodes;
427 }
428
429
430
431
432
433
434
435
436
437 public void setReferentialProgramCodes(Set<String> referentialProgramCodes) {
438 this.referentialProgramCodes = referentialProgramCodes;
439 }
440
441
442
443
444
445
446
447
448
449 public void setReferentialProgramsForceImport(boolean referentialProgramsForceImport) {
450 this.referentialProgramsForceImport = referentialProgramsForceImport;
451 }
452
453
454
455
456
457
458
459
460 public boolean getReferentialProgramsForceImport() {
461 return this.referentialProgramsForceImport;
462 }
463
464
465
466
467
468
469
470
471
472
473
474
475 protected SynchroImportContextVO copy(SynchroImportContextVO other) {
476 this.jobId = other.jobId;
477 this.referentialUpdateDate = other.referentialUpdateDate;
478 this.dataUpdateDate = other.dataUpdateDate;
479 this.dataStartDate = other.dataStartDate;
480 this.dataEndDate = other.dataEndDate;
481 this.dataPkIncludes = other.dataPkIncludes;
482 this.dataProgramCodes = other.dataProgramCodes;
483 this.dataForceEditedRowOverride = other.dataForceEditedRowOverride;
484 this.withReferential = other.withReferential;
485 this.withData = other.withData;
486 this.referentialProgramCodes = other.referentialProgramCodes;
487 this.referentialProgramsForceImport = other.referentialProgramsForceImport;
488 return this;
489 }
490 }