1
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
27
28
29
30
31
32
33
34 package fr.paris.lutece.plugins.identitystore.business.contract;
35
36 import javax.validation.constraints.NotEmpty;
37 import javax.validation.constraints.Size;
38 import java.io.Serializable;
39 import java.sql.Date;
40 import java.sql.Timestamp;
41 import java.time.Instant;
42 import java.util.ArrayList;
43 import java.util.List;
44
45
46
47
48 public class ServiceContract implements Serializable
49 {
50 private static final long serialVersionUID = 1L;
51
52
53 private int _nId;
54
55 private String _strClientCode;
56
57 @NotEmpty( message = "#i18n{contractservice.validation.servicecontract.Name.notEmpty}" )
58 @Size( max = 50, message = "#i18n{contractservice.validation.servicecontract.Name.size}" )
59 private String _strName;
60
61 @NotEmpty( message = "#i18n{contractservice.validation.servicecontract.OrganizationalEntity.notEmpty}" )
62 @Size( max = 50, message = "#i18n{contractservice.validation.servicecontract.OrganizationalEntity.size}" )
63 private String _strMoaEntityName;
64
65 private String _strMoeEntityName;
66
67 @NotEmpty( message = "#i18n{contractservice.validation.servicecontract.ResponsibleName.notEmpty}" )
68 @Size( max = 50, message = "#i18n{contractservice.validation.servicecontract.ResponsibleName.size}" )
69 private String _strMoeResponsibleName;
70
71 @NotEmpty( message = "#i18n{contractservice.validation.servicecontract.ContactName.notEmpty}" )
72 @Size( max = 50, message = "#i18n{contractservice.validation.servicecontract.ContactName.size}" )
73 private String _strMoaContactName;
74
75 @NotEmpty( message = "#i18n{contractservice.validation.servicecontract.ServiceType.notEmpty}" )
76 @Size( max = 50, message = "#i18n{contractservice.validation.servicecontract.ServiceType.size}" )
77 private String _strServiceType;
78
79 private Date _dateStartingDate;
80 private Date _dateEndingDate;
81
82 private boolean _bAuthorizedCreation;
83
84 private boolean _bAuthorizedUpdate;
85
86 private boolean _bAuthorizedMerge;
87
88 private boolean _bAuthorizedAccountUpdate;
89
90 private boolean _bAuthorizedDeletion;
91
92 private boolean _bAuthorizedImport;
93
94 private boolean _bAuthorizedExport;
95
96 private boolean _bAuthorizedSearch;
97
98 private boolean _bAuthorizedDecertification;
99
100 private boolean _bAuthorizedAgentHistoryRead;
101
102 private int _nDataRetentionPeriodInMonths;
103
104 private List<AttributeRight> _listAttributeRights = new ArrayList<>( );
105
106 private List<AttributeCertification> _listAttributeCertifications = new ArrayList<>( );
107
108 private List<AttributeRequirement> _listAttributeRequirements = new ArrayList<>( );
109
110 public boolean isActive( )
111 {
112 final Timestamp actualTimestamp = Timestamp.from( Instant.now( ) );
113 return ( this.getStartingDate( ).before( actualTimestamp ) && ( this.getEndingDate( ) == null || this.getEndingDate( ).after( actualTimestamp ) ) );
114 }
115
116
117
118
119
120
121 public int getId( )
122 {
123 return _nId;
124 }
125
126
127
128
129
130
131
132 public void setId( int nId )
133 {
134 _nId = nId;
135 }
136
137 public String getClientCode( )
138 {
139 return _strClientCode;
140 }
141
142 public void setClientCode( String _strClientCode )
143 {
144 this._strClientCode = _strClientCode;
145 }
146
147
148
149
150
151
152 public String getName( )
153 {
154 return _strName;
155 }
156
157
158
159
160
161
162
163 public void setName( String strName )
164 {
165 _strName = strName;
166 }
167
168
169
170
171
172
173 public String getMoaEntityName( )
174 {
175 return _strMoaEntityName;
176 }
177
178
179
180
181
182
183
184 public void setMoaEntityName( String strMoaEntityName )
185 {
186 _strMoaEntityName = strMoaEntityName;
187 }
188
189 public String getMoeEntityName( )
190 {
191 return _strMoeEntityName;
192 }
193
194 public void setMoeEntityName( String _strMoeEntityName )
195 {
196 this._strMoeEntityName = _strMoeEntityName;
197 }
198
199
200
201
202
203
204 public String getMoeResponsibleName( )
205 {
206 return _strMoeResponsibleName;
207 }
208
209
210
211
212
213
214
215 public void setMoeResponsibleName( String strMoeResponsibleName )
216 {
217 _strMoeResponsibleName = strMoeResponsibleName;
218 }
219
220
221
222
223
224
225 public String getMoaContactName( )
226 {
227 return _strMoaContactName;
228 }
229
230
231
232
233
234
235
236 public void setMoaContactName( String strMoaContactName )
237 {
238 _strMoaContactName = strMoaContactName;
239 }
240
241
242
243
244
245
246 public String getServiceType( )
247 {
248 return _strServiceType;
249 }
250
251
252
253
254
255
256
257 public void setServiceType( String strServiceType )
258 {
259 _strServiceType = strServiceType;
260 }
261
262 public Date getStartingDate( )
263 {
264 return _dateStartingDate;
265 }
266
267 public void setStartingDate( Date _dateStartingDate )
268 {
269 this._dateStartingDate = _dateStartingDate;
270 }
271
272 public Date getEndingDate( )
273 {
274 return _dateEndingDate;
275 }
276
277 public void setEndingDate( Date _dateEndingDate )
278 {
279 this._dateEndingDate = _dateEndingDate;
280 }
281
282 public boolean getAuthorizedCreation( )
283 {
284 return _bAuthorizedCreation;
285 }
286
287 public void setAuthorizedCreation( boolean _bAuthorizedCreation )
288 {
289 this._bAuthorizedCreation = _bAuthorizedCreation;
290 }
291
292 public boolean getAuthorizedUpdate( )
293 {
294 return _bAuthorizedUpdate;
295 }
296
297 public void setAuthorizedUpdate( boolean _bAuthorizedUpdate )
298 {
299 this._bAuthorizedUpdate = _bAuthorizedUpdate;
300 }
301
302 public boolean getAuthorizedSearch( )
303 {
304 return _bAuthorizedSearch;
305 }
306
307 public void setAuthorizedSearch( boolean _bAuthorizedSearch )
308 {
309 this._bAuthorizedSearch = _bAuthorizedSearch;
310 }
311
312
313
314
315
316
317 public boolean getAuthorizedMerge( )
318 {
319 return _bAuthorizedMerge;
320 }
321
322
323
324
325
326
327
328 public void setAuthorizedMerge( boolean bAuthorizedMerge )
329 {
330 _bAuthorizedMerge = bAuthorizedMerge;
331 }
332
333
334
335
336
337
338 public boolean getAuthorizedAccountUpdate( )
339 {
340 return _bAuthorizedAccountUpdate;
341 }
342
343
344
345
346
347
348
349 public void setAuthorizedAccountUpdate( boolean bAuthorizedAccountUpdate )
350 {
351 _bAuthorizedAccountUpdate = bAuthorizedAccountUpdate;
352 }
353
354
355
356
357
358
359 public boolean getAuthorizedDeletion( )
360 {
361 return _bAuthorizedDeletion;
362 }
363
364
365
366
367
368
369
370 public void setAuthorizedDeletion( boolean bAuthorizedDeletion )
371 {
372 _bAuthorizedDeletion = bAuthorizedDeletion;
373 }
374
375
376
377
378
379
380 public boolean getAuthorizedImport( )
381 {
382 return _bAuthorizedImport;
383 }
384
385
386
387
388
389
390
391 public void setAuthorizedImport( boolean bAuthorizedImport )
392 {
393 _bAuthorizedImport = bAuthorizedImport;
394 }
395
396
397
398
399
400
401 public boolean getAuthorizedExport( )
402 {
403 return _bAuthorizedExport;
404 }
405
406
407
408
409
410
411
412 public void setAuthorizedExport( boolean bAuthorizedExport )
413 {
414 _bAuthorizedExport = bAuthorizedExport;
415 }
416
417 public boolean getAuthorizedDecertification( )
418 {
419 return _bAuthorizedDecertification;
420 }
421
422 public void setAuthorizedDecertification( boolean _bAuthorizedDecertification )
423 {
424 this._bAuthorizedDecertification = _bAuthorizedDecertification;
425 }
426
427 public boolean getAuthorizedAgentHistoryRead( )
428 {
429 return _bAuthorizedAgentHistoryRead;
430 }
431
432 public void setAuthorizedAgentHistoryRead( boolean _bAuthorizedAgentHistoryRead )
433 {
434 this._bAuthorizedAgentHistoryRead = _bAuthorizedAgentHistoryRead;
435 }
436
437 public int getDataRetentionPeriodInMonths( )
438 {
439 return _nDataRetentionPeriodInMonths;
440 }
441
442 public void setDataRetentionPeriodInMonths( int _nDataRetentionPeriodInMonths )
443 {
444 this._nDataRetentionPeriodInMonths = _nDataRetentionPeriodInMonths;
445 }
446
447 public List<AttributeRight> getAttributeRights( )
448 {
449 return _listAttributeRights;
450 }
451
452 public void setAttributeRights( List<AttributeRight> attributeRights )
453 {
454 this._listAttributeRights = attributeRights;
455 }
456
457 public List<AttributeCertification> getAttributeCertifications( )
458 {
459 return _listAttributeCertifications;
460 }
461
462 public void setAttributeCertifications( List<AttributeCertification> attributeCertifications )
463 {
464 this._listAttributeCertifications = attributeCertifications;
465 }
466
467 public List<AttributeRequirement> getAttributeRequirements( )
468 {
469 return _listAttributeRequirements;
470 }
471
472 public void setAttributeRequirements( List<AttributeRequirement> attributeRequirements )
473 {
474 this._listAttributeRequirements = attributeRequirements;
475 }
476 }