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