1
2
3
4
5
6
7
8 package org.codehaus.plexus.security.user.jdo.v0_9_0;
9
10
11
12
13
14
15
16
17
18
19 public class JdoUser
20 implements org.codehaus.plexus.security.user.User, java.io.Serializable
21 {
22
23
24
25
26
27
28
29
30 private String username;
31
32
33
34
35 private String password;
36
37
38
39
40 private String encodedPassword;
41
42
43
44
45 private String fullName;
46
47
48
49
50 private String email;
51
52
53
54
55 private java.util.Date lastPasswordChange;
56
57
58
59
60 private java.util.Date lastLoginDate;
61
62
63
64
65 private int countFailedLoginAttempts = 0;
66
67
68
69
70 private boolean locked = false;
71
72
73
74
75 private boolean permanent = false;
76
77
78
79
80 private boolean validated = false;
81
82
83
84
85 private boolean passwordChangeRequired = false;
86
87
88
89
90 private java.util.List
91
92
93
94
95 private java.util.Date accountCreationDate;
96
97
98
99
100
101
102
103
104
105
106
107 public void addPreviousEncodedPassword( String string )
108 {
109 getPreviousEncodedPasswords().add( string );
110 }
111
112
113
114
115
116
117
118 public boolean equals( Object other )
119 {
120 if ( this == other )
121 {
122 return true;
123 }
124
125 if ( !( other instanceof JdoUser ) )
126 {
127 return false;
128 }
129
130 JdoUser that = (JdoUser) other;
131 boolean result = true;
132
133 result = result && ( getUsername() == null ? that.getUsername() == null : getUsername().equals( that.getUsername() ) );
134 result = result && ( getPassword() == null ? that.getPassword() == null : getPassword().equals( that.getPassword() ) );
135 result = result && ( getEncodedPassword() == null ? that.getEncodedPassword() == null : getEncodedPassword().equals( that.getEncodedPassword() ) );
136 result = result && ( getFullName() == null ? that.getFullName() == null : getFullName().equals( that.getFullName() ) );
137 result = result && ( getEmail() == null ? that.getEmail() == null : getEmail().equals( that.getEmail() ) );
138 result = result && locked == that.locked;
139 result = result && permanent == that.permanent;
140 result = result && validated == that.validated;
141 result = result && passwordChangeRequired == that.passwordChangeRequired;
142
143 return result;
144 }
145
146
147
148
149
150
151 public java.util.Date getAccountCreationDate()
152 {
153 return this.accountCreationDate;
154 }
155
156
157
158
159
160
161 public int getCountFailedLoginAttempts()
162 {
163 return this.countFailedLoginAttempts;
164 }
165
166
167
168
169
170
171 public String getEmail()
172 {
173 return this.email;
174 }
175
176
177
178
179
180
181 public String getEncodedPassword()
182 {
183 return this.encodedPassword;
184 }
185
186
187
188
189
190
191 public String getFullName()
192 {
193 return this.fullName;
194 }
195
196
197
198
199
200
201 public java.util.Date getLastLoginDate()
202 {
203 return this.lastLoginDate;
204 }
205
206
207
208
209
210
211 public java.util.Date getLastPasswordChange()
212 {
213 return this.lastPasswordChange;
214 }
215
216
217
218
219
220
221 public String getPassword()
222 {
223 return this.password;
224 }
225
226
227
228
229
230
231 public java.util.List
232 {
233 if ( this.previousEncodedPasswords == null )
234 {
235 this.previousEncodedPasswords = new java.util.ArrayList
236 }
237
238 return this.previousEncodedPasswords;
239 }
240
241
242
243
244
245
246 public String getUsername()
247 {
248 return this.username;
249 }
250
251
252
253
254
255
256 public int hashCode()
257 {
258 int result = 17;
259
260 result = 37 * result + ( username != null ? username.hashCode() : 0 );
261 result = 37 * result + ( password != null ? password.hashCode() : 0 );
262 result = 37 * result + ( encodedPassword != null ? encodedPassword.hashCode() : 0 );
263 result = 37 * result + ( fullName != null ? fullName.hashCode() : 0 );
264 result = 37 * result + ( email != null ? email.hashCode() : 0 );
265 result = 37 * result + ( locked ? 0 : 1 );
266 result = 37 * result + ( permanent ? 0 : 1 );
267 result = 37 * result + ( validated ? 0 : 1 );
268 result = 37 * result + ( passwordChangeRequired ? 0 : 1 );
269
270 return result;
271 }
272
273
274
275
276
277
278 public boolean isLocked()
279 {
280 return this.locked;
281 }
282
283
284
285
286
287
288 public boolean isPasswordChangeRequired()
289 {
290 return this.passwordChangeRequired;
291 }
292
293
294
295
296
297
298 public boolean isPermanent()
299 {
300 return this.permanent;
301 }
302
303
304
305
306
307
308 public boolean isValidated()
309 {
310 return this.validated;
311 }
312
313
314
315
316
317
318 public void removePreviousEncodedPassword( String string )
319 {
320 getPreviousEncodedPasswords().remove( string );
321 }
322
323
324
325
326
327
328 public void setAccountCreationDate( java.util.Date accountCreationDate )
329 {
330 this.accountCreationDate = accountCreationDate;
331 }
332
333
334
335
336
337
338 public void setCountFailedLoginAttempts( int countFailedLoginAttempts )
339 {
340 this.countFailedLoginAttempts = countFailedLoginAttempts;
341 }
342
343
344
345
346
347
348 public void setEmail( String email )
349 {
350 this.email = email;
351 }
352
353
354
355
356
357
358 public void setEncodedPassword( String encodedPassword )
359 {
360 this.encodedPassword = encodedPassword;
361 }
362
363
364
365
366
367
368 public void setFullName( String fullName )
369 {
370 this.fullName = fullName;
371 }
372
373
374
375
376
377
378 public void setLastLoginDate( java.util.Date lastLoginDate )
379 {
380 this.lastLoginDate = lastLoginDate;
381 }
382
383
384
385
386
387
388 public void setLastPasswordChange( java.util.Date lastPasswordChange )
389 {
390 this.lastPasswordChange = lastPasswordChange;
391 }
392
393
394
395
396
397
398 public void setLocked( boolean locked )
399 {
400 this.locked = locked;
401 }
402
403
404
405
406
407
408 public void setPassword( String password )
409 {
410 this.password = password;
411 }
412
413
414
415
416
417
418 public void setPasswordChangeRequired( boolean passwordChangeRequired )
419 {
420 this.passwordChangeRequired = passwordChangeRequired;
421 }
422
423
424
425
426
427
428 public void setPermanent( boolean permanent )
429 {
430 this.permanent = permanent;
431 }
432
433
434
435
436
437
438 public void setPreviousEncodedPasswords( java.util.List
439 {
440 this.previousEncodedPasswords = previousEncodedPasswords;
441 }
442
443
444
445
446
447
448 public void setUsername( String username )
449 {
450 this.username = username;
451 }
452
453
454
455
456
457
458 public void setValidated( boolean validated )
459 {
460 this.validated = validated;
461 }
462
463
464
465
466
467
468 public java.lang.String toString()
469 {
470 StringBuffer buf = new StringBuffer( 128 );
471
472 buf.append( "username = '" );
473 buf.append( getUsername() );
474 buf.append( "'" );
475 buf.append( "\n" );
476 buf.append( "password = '" );
477 buf.append( getPassword() );
478 buf.append( "'" );
479 buf.append( "\n" );
480 buf.append( "encodedPassword = '" );
481 buf.append( getEncodedPassword() );
482 buf.append( "'" );
483 buf.append( "\n" );
484 buf.append( "fullName = '" );
485 buf.append( getFullName() );
486 buf.append( "'" );
487 buf.append( "\n" );
488 buf.append( "email = '" );
489 buf.append( getEmail() );
490 buf.append( "'" );
491 buf.append( "\n" );
492 buf.append( "locked = '" );
493 buf.append( isLocked() );
494 buf.append( "'" );
495 buf.append( "\n" );
496 buf.append( "permanent = '" );
497 buf.append( isPermanent() );
498 buf.append( "'" );
499 buf.append( "\n" );
500 buf.append( "validated = '" );
501 buf.append( isValidated() );
502 buf.append( "'" );
503 buf.append( "\n" );
504 buf.append( "passwordChangeRequired = '" );
505 buf.append( isPasswordChangeRequired() );
506 buf.append( "'" );
507
508 return buf.toString();
509 }
510
511
512 public JdoUser()
513 {
514
515 previousEncodedPasswords = new java.util.ArrayList();
516 }
517
518 public Object getPrincipal()
519 {
520 return username;
521 }
522
523 }