View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.codehaus.plexus.security.user.jdo.v0_9_0;
9   
10  /**
11   * 
12   *         @plexus.component
13   * role="org.codehaus.plexus.security.user.User"
14   *         role-hint="jdo"
15   *       .
16   * 
17   * @version $Revision$ $Date$
18   */
19  public class JdoUser
20      implements org.codehaus.plexus.security.user.User, java.io.Serializable
21  {
22  
23        //--------------------------/
24       //- Class/Member Variables -/
25      //--------------------------/
26  
27      /**
28       * Field username.
29       */
30      private String username;
31  
32      /**
33       * Field password.
34       */
35      private String password;
36  
37      /**
38       * Field encodedPassword.
39       */
40      private String encodedPassword;
41  
42      /**
43       * Field fullName.
44       */
45      private String fullName;
46  
47      /**
48       * Field email.
49       */
50      private String email;
51  
52      /**
53       * Field lastPasswordChange.
54       */
55      private java.util.Date lastPasswordChange;
56  
57      /**
58       * Field lastLoginDate.
59       */
60      private java.util.Date lastLoginDate;
61  
62      /**
63       * Field countFailedLoginAttempts.
64       */
65      private int countFailedLoginAttempts = 0;
66  
67      /**
68       * Field locked.
69       */
70      private boolean locked = false;
71  
72      /**
73       * Field permanent.
74       */
75      private boolean permanent = false;
76  
77      /**
78       * Field validated.
79       */
80      private boolean validated = false;
81  
82      /**
83       * Field passwordChangeRequired.
84       */
85      private boolean passwordChangeRequired = false;
86  
87      /**
88       * Field previousEncodedPasswords.
89       */
90      private java.util.List/*<String>*/ previousEncodedPasswords;
91  
92      /**
93       * Field accountCreationDate.
94       */
95      private java.util.Date accountCreationDate;
96  
97  
98        //-----------/
99       //- Methods -/
100     //-----------/
101 
102     /**
103      * Method addPreviousEncodedPassword.
104      * 
105      * @param string
106      */
107     public void addPreviousEncodedPassword( String string )
108     {
109         getPreviousEncodedPasswords().add( string );
110     } //-- void addPreviousEncodedPassword( String )
111 
112     /**
113      * Method equals.
114      * 
115      * @param other
116      * @return boolean
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     } //-- boolean equals( Object )
145 
146     /**
147      * Get the accountCreationDate field.
148      * 
149      * @return Date
150      */
151     public java.util.Date getAccountCreationDate()
152     {
153         return this.accountCreationDate;
154     } //-- java.util.Date getAccountCreationDate()
155 
156     /**
157      * Get the countFailedLoginAttempts field.
158      * 
159      * @return int
160      */
161     public int getCountFailedLoginAttempts()
162     {
163         return this.countFailedLoginAttempts;
164     } //-- int getCountFailedLoginAttempts()
165 
166     /**
167      * Get the email field.
168      * 
169      * @return String
170      */
171     public String getEmail()
172     {
173         return this.email;
174     } //-- String getEmail()
175 
176     /**
177      * Get the encodedPassword field.
178      * 
179      * @return String
180      */
181     public String getEncodedPassword()
182     {
183         return this.encodedPassword;
184     } //-- String getEncodedPassword()
185 
186     /**
187      * Get the fullName field.
188      * 
189      * @return String
190      */
191     public String getFullName()
192     {
193         return this.fullName;
194     } //-- String getFullName()
195 
196     /**
197      * Get the lastLoginDate field.
198      * 
199      * @return Date
200      */
201     public java.util.Date getLastLoginDate()
202     {
203         return this.lastLoginDate;
204     } //-- java.util.Date getLastLoginDate()
205 
206     /**
207      * Get the lastPasswordChange field.
208      * 
209      * @return Date
210      */
211     public java.util.Date getLastPasswordChange()
212     {
213         return this.lastPasswordChange;
214     } //-- java.util.Date getLastPasswordChange()
215 
216     /**
217      * Get the password field.
218      * 
219      * @return String
220      */
221     public String getPassword()
222     {
223         return this.password;
224     } //-- String getPassword()
225 
226     /**
227      * Method getPreviousEncodedPasswords.
228      * 
229      * @return List
230      */
231     public java.util.List/*<String>*/ getPreviousEncodedPasswords()
232     {
233         if ( this.previousEncodedPasswords == null )
234         {
235             this.previousEncodedPasswords = new java.util.ArrayList/*<String>*/();
236         }
237 
238         return this.previousEncodedPasswords;
239     } //-- java.util.List/*<String>*/ getPreviousEncodedPasswords()
240 
241     /**
242      * Get the username field.
243      * 
244      * @return String
245      */
246     public String getUsername()
247     {
248         return this.username;
249     } //-- String getUsername()
250 
251     /**
252      * Method hashCode.
253      * 
254      * @return int
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     } //-- int hashCode()
272 
273     /**
274      * Get the locked field.
275      * 
276      * @return boolean
277      */
278     public boolean isLocked()
279     {
280         return this.locked;
281     } //-- boolean isLocked()
282 
283     /**
284      * Get the passwordChangeRequired field.
285      * 
286      * @return boolean
287      */
288     public boolean isPasswordChangeRequired()
289     {
290         return this.passwordChangeRequired;
291     } //-- boolean isPasswordChangeRequired()
292 
293     /**
294      * Get the permanent field.
295      * 
296      * @return boolean
297      */
298     public boolean isPermanent()
299     {
300         return this.permanent;
301     } //-- boolean isPermanent()
302 
303     /**
304      * Get the validated field.
305      * 
306      * @return boolean
307      */
308     public boolean isValidated()
309     {
310         return this.validated;
311     } //-- boolean isValidated()
312 
313     /**
314      * Method removePreviousEncodedPassword.
315      * 
316      * @param string
317      */
318     public void removePreviousEncodedPassword( String string )
319     {
320         getPreviousEncodedPasswords().remove( string );
321     } //-- void removePreviousEncodedPassword( String )
322 
323     /**
324      * Set the accountCreationDate field.
325      * 
326      * @param accountCreationDate
327      */
328     public void setAccountCreationDate( java.util.Date accountCreationDate )
329     {
330         this.accountCreationDate = accountCreationDate;
331     } //-- void setAccountCreationDate( java.util.Date )
332 
333     /**
334      * Set the countFailedLoginAttempts field.
335      * 
336      * @param countFailedLoginAttempts
337      */
338     public void setCountFailedLoginAttempts( int countFailedLoginAttempts )
339     {
340         this.countFailedLoginAttempts = countFailedLoginAttempts;
341     } //-- void setCountFailedLoginAttempts( int )
342 
343     /**
344      * Set the email field.
345      * 
346      * @param email
347      */
348     public void setEmail( String email )
349     {
350         this.email = email;
351     } //-- void setEmail( String )
352 
353     /**
354      * Set the encodedPassword field.
355      * 
356      * @param encodedPassword
357      */
358     public void setEncodedPassword( String encodedPassword )
359     {
360         this.encodedPassword = encodedPassword;
361     } //-- void setEncodedPassword( String )
362 
363     /**
364      * Set the fullName field.
365      * 
366      * @param fullName
367      */
368     public void setFullName( String fullName )
369     {
370         this.fullName = fullName;
371     } //-- void setFullName( String )
372 
373     /**
374      * Set the lastLoginDate field.
375      * 
376      * @param lastLoginDate
377      */
378     public void setLastLoginDate( java.util.Date lastLoginDate )
379     {
380         this.lastLoginDate = lastLoginDate;
381     } //-- void setLastLoginDate( java.util.Date )
382 
383     /**
384      * Set the lastPasswordChange field.
385      * 
386      * @param lastPasswordChange
387      */
388     public void setLastPasswordChange( java.util.Date lastPasswordChange )
389     {
390         this.lastPasswordChange = lastPasswordChange;
391     } //-- void setLastPasswordChange( java.util.Date )
392 
393     /**
394      * Set the locked field.
395      * 
396      * @param locked
397      */
398     public void setLocked( boolean locked )
399     {
400         this.locked = locked;
401     } //-- void setLocked( boolean )
402 
403     /**
404      * Set the password field.
405      * 
406      * @param password
407      */
408     public void setPassword( String password )
409     {
410         this.password = password;
411     } //-- void setPassword( String )
412 
413     /**
414      * Set the passwordChangeRequired field.
415      * 
416      * @param passwordChangeRequired
417      */
418     public void setPasswordChangeRequired( boolean passwordChangeRequired )
419     {
420         this.passwordChangeRequired = passwordChangeRequired;
421     } //-- void setPasswordChangeRequired( boolean )
422 
423     /**
424      * Set the permanent field.
425      * 
426      * @param permanent
427      */
428     public void setPermanent( boolean permanent )
429     {
430         this.permanent = permanent;
431     } //-- void setPermanent( boolean )
432 
433     /**
434      * Set the previousEncodedPasswords field.
435      * 
436      * @param previousEncodedPasswords
437      */
438     public void setPreviousEncodedPasswords( java.util.List/*<String>*/ previousEncodedPasswords )
439     {
440         this.previousEncodedPasswords = previousEncodedPasswords;
441     } //-- void setPreviousEncodedPasswords( java.util.List )
442 
443     /**
444      * Set the username field.
445      * 
446      * @param username
447      */
448     public void setUsername( String username )
449     {
450         this.username = username;
451     } //-- void setUsername( String )
452 
453     /**
454      * Set the validated field.
455      * 
456      * @param validated
457      */
458     public void setValidated( boolean validated )
459     {
460         this.validated = validated;
461     } //-- void setValidated( boolean )
462 
463     /**
464      * Method toString.
465      * 
466      * @return String
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     } //-- java.lang.String toString()
510 
511     
512               public JdoUser()
513               {
514                  // Intentionally initialize List to avoid JPOX NullPointerException Issues.
515               	 previousEncodedPasswords = new java.util.ArrayList();
516               }
517 
518               public Object getPrincipal()
519               {
520                  return username;
521               }
522           
523 }