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.identity;
35
36 import fr.paris.lutece.portal.service.util.AppPropertiesService;
37 import org.apache.commons.lang3.StringUtils;
38
39 import javax.validation.constraints.Size;
40 import java.io.Serializable;
41 import java.sql.Timestamp;
42 import java.util.HashMap;
43 import java.util.Map;
44
45
46
47
48 public class Identity implements Serializable
49 {
50 private static final long serialVersionUID = 1L;
51
52
53 private int _nId;
54 @Size( max = 50, message = "#i18n{identitystore.validation.identity.ConnectionId.size}" )
55 private String _strConnectionId;
56 @Size( max = 50, message = "#i18n{identitystore.validation.identity.CustomerId.size}" )
57 private String _strCustomerId;
58 private Map<String, IdentityAttribute> _mapAttributes = new HashMap<>( );
59 private boolean _bIsDeleted;
60 private Timestamp _dateCreationDate;
61
62 private Timestamp _dateLastUpdateDate;
63 private boolean _bIsMerged;
64 private Timestamp _dateMergeDate;
65 private Integer _nMasterIdentityId;
66 private boolean _bIsMonParisActive;
67 private Timestamp _dateExpirationDate;
68 private Timestamp _dateDeleteDate;
69
70
71
72
73
74
75 public int getId( )
76 {
77 return _nId;
78 }
79
80
81
82
83
84
85
86 public void setId( int nId )
87 {
88 _nId = nId;
89 }
90
91
92
93
94
95
96 public String getConnectionId( )
97 {
98 return _strConnectionId;
99 }
100
101
102
103
104
105
106
107 public void setConnectionId( String strConnectionId )
108 {
109 _strConnectionId = strConnectionId;
110 }
111
112
113
114
115
116
117 public String getCustomerId( )
118 {
119 return _strCustomerId;
120 }
121
122
123
124
125
126
127
128 public void setCustomerId( String strCustomerId )
129 {
130 _strCustomerId = strCustomerId;
131 }
132
133
134
135
136 public Map<String, IdentityAttribute> getAttributes( )
137 {
138 return _mapAttributes;
139 }
140
141
142
143
144
145 public void setAttributes( Map<String, IdentityAttribute> mapAttributes )
146 {
147 this._mapAttributes = mapAttributes;
148 }
149
150
151
152
153
154
155 public String getFamilyName( )
156 {
157 String strFamilyName = StringUtils.EMPTY;
158
159 if ( ( _mapAttributes != null )
160 && ( _mapAttributes.get( AppPropertiesService.getProperty( IdentityConstants.PROPERTY_ATTRIBUTE_USER_PREFERRED_NAME ) ) != null ) )
161 {
162 strFamilyName = _mapAttributes.get( AppPropertiesService.getProperty( IdentityConstants.PROPERTY_ATTRIBUTE_USER_PREFERRED_NAME ) ).getValue( );
163 }
164
165 return strFamilyName;
166 }
167
168
169
170
171
172
173 public String getFirstName( )
174 {
175 String strFirstName = StringUtils.EMPTY;
176
177 if ( ( _mapAttributes != null )
178 && ( _mapAttributes.get( AppPropertiesService.getProperty( IdentityConstants.PROPERTY_ATTRIBUTE_USER_NAME_GIVEN ) ) != null ) )
179 {
180 strFirstName = _mapAttributes.get( AppPropertiesService.getProperty( IdentityConstants.PROPERTY_ATTRIBUTE_USER_NAME_GIVEN ) ).getValue( );
181 }
182
183 return strFirstName;
184 }
185
186
187
188
189
190
191 public boolean isConnected( )
192 {
193 return _bIsMonParisActive;
194 }
195
196
197
198
199
200 public boolean isDeleted( )
201 {
202 return _bIsDeleted;
203 }
204
205
206
207
208
209
210
211 public void setDeleted( boolean bIsDeleted )
212 {
213 _bIsDeleted = bIsDeleted;
214 }
215
216 public Timestamp getCreationDate( )
217 {
218 return _dateCreationDate;
219 }
220
221 public void setCreationDate( Timestamp creationDate )
222 {
223 this._dateCreationDate = creationDate;
224 }
225
226 public boolean isMerged( )
227 {
228 return _bIsMerged;
229 }
230
231 public void setMerged( boolean merged )
232 {
233 this._bIsMerged = merged;
234 }
235
236 public Timestamp getMergeDate( )
237 {
238 return _dateMergeDate;
239 }
240
241 public void setMergeDate( Timestamp mergeDate )
242 {
243 this._dateMergeDate = mergeDate;
244 }
245
246 public Integer getMasterIdentityId( )
247 {
248 return _nMasterIdentityId;
249 }
250
251 public void setMasterIdentityId( Integer _nMasterIdentityId )
252 {
253 this._nMasterIdentityId = _nMasterIdentityId;
254 }
255
256 public Timestamp getLastUpdateDate( )
257 {
258 return _dateLastUpdateDate;
259 }
260
261 public void setLastUpdateDate( Timestamp lastUpdateDate )
262 {
263 this._dateLastUpdateDate = lastUpdateDate;
264 }
265
266 public boolean isMonParisActive( )
267 {
268 return _bIsMonParisActive;
269 }
270
271 public void setMonParisActive( boolean _bIsMonParisActive )
272 {
273 this._bIsMonParisActive = _bIsMonParisActive;
274 }
275
276 public Timestamp getExpirationDate( )
277 {
278 return _dateExpirationDate;
279 }
280
281 public void setExpirationDate( Timestamp _dateExpirationDate )
282 {
283 this._dateExpirationDate = _dateExpirationDate;
284 }
285
286 public Timestamp getDeleteDate( )
287 {
288 return _dateDeleteDate;
289 }
290
291 public void setDeleteDate( Timestamp _dateDeleteDate )
292 {
293 this._dateDeleteDate = _dateDeleteDate;
294 }
295 }