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.base.Preconditions;
27
28 import java.io.File;
29 import java.io.Serializable;
30
31
32
33
34
35
36
37
38
39 public class SynchroProgressionVO implements Serializable {
40
41 private static final long serialVersionUID = 64396395159800607L;
42
43 private final String jobId;
44 private final int increment;
45 private final String message;
46 private final String status;
47 private String fileName;
48
49
50
51
52
53
54
55
56
57
58
59
60
61 public SynchroProgressionVO(String jobId, String fileName, SynchroProgressionModel progressionModel) {
62 Preconditions.checkNotNull(jobId);
63 Preconditions.checkNotNull(fileName);
64 Preconditions.checkNotNull(progressionModel);
65 this.jobId = jobId;
66 this.fileName = fileName;
67 this.increment = progressionModel.getCurrent();
68 this.message = progressionModel.getMessage();
69 this.status = progressionModel.getStatus().toString();
70 }
71
72
73
74
75
76
77
78
79
80
81
82
83
84 public SynchroProgressionVO(String jobId, File outputFile, SynchroProgressionModel progressionModel) {
85 Preconditions.checkNotNull(jobId);
86 Preconditions.checkNotNull(outputFile);
87 Preconditions.checkNotNull(progressionModel);
88 this.jobId = jobId;
89 this.fileName = outputFile.getName();
90 this.increment = progressionModel.getCurrent();
91 this.message = progressionModel.getMessage();
92 this.status = progressionModel.getStatus().toString();
93 }
94
95
96
97
98
99
100
101
102 public int getIncrement() {
103 return increment;
104 }
105
106
107
108
109
110
111
112
113 public String getJobId() {
114 return jobId;
115 }
116
117
118
119
120
121
122
123
124 public String getMessage() {
125 return message;
126 }
127
128
129
130
131
132
133
134
135 public String getStatus() {
136 return status;
137 }
138
139
140
141
142
143
144
145
146 public String getFileName() {
147 return fileName;
148 }
149
150
151
152
153
154
155
156
157
158 public void setFileName(String fileName) {
159 this.fileName = fileName;
160 }
161
162 }