org.apache.james.userrepository
Class DefaultUser

java.lang.Object
  |
  +--org.apache.james.userrepository.DefaultUser
All Implemented Interfaces:
java.io.Serializable, User
Direct Known Subclasses:
DefaultJamesUser

public class DefaultUser
extends java.lang.Object
implements User, java.io.Serializable

Implementation of User Interface. Instances of this class do not allow the the user name to be reset.

Author:
Charles Benett Last changed by: $Author: charlesb $ on $Date: 2001/06/11 09:29:35 $ $Revision: 1.1 $
See Also:
Serialized Form

Constructor Summary
DefaultUser(java.lang.String name, java.lang.String hashAlg)
          Standard constructor.
DefaultUser(java.lang.String name, java.lang.String passwordHash, java.lang.String hashAlg)
          Constructor for repositories that are construcing user objects from separate fields, e.g.
 
Method Summary
protected  java.lang.String getHashAlgorithm()
          Method to access the hashing algorithm of the password.
protected  java.lang.String getHashedPassword()
          Method to access hash of password
 java.lang.String getUserName()
          Accessor for immutable name
 boolean setPassword(java.lang.String newPass)
          Sets new password from String.
 boolean verifyPassword(java.lang.String pass)
          Method to verify passwords.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUser

public DefaultUser(java.lang.String name,
                   java.lang.String hashAlg)
Standard constructor.
Parameters:
name - the String name of this user

DefaultUser

public DefaultUser(java.lang.String name,
                   java.lang.String passwordHash,
                   java.lang.String hashAlg)
Constructor for repositories that are construcing user objects from separate fields, e.g. databases.
Parameters:
name - the String name of this user
passwordHash - the String hash of this users current password
hashAlg - the String algorithm used to generate the hash of the password
Method Detail

getUserName

public java.lang.String getUserName()
Accessor for immutable name
Specified by:
getUserName in interface User

verifyPassword

public boolean verifyPassword(java.lang.String pass)
Method to verify passwords.
Specified by:
verifyPassword in interface User
Parameters:
pass - the String that is claimed to be the password for this user

setPassword

public boolean setPassword(java.lang.String newPass)
Sets new password from String. No checks made on guessability of password.
Specified by:
setPassword in interface User
Parameters:
newPass - the String that is the new password.

getHashedPassword

protected java.lang.String getHashedPassword()
Method to access hash of password

getHashAlgorithm

protected java.lang.String getHashAlgorithm()
Method to access the hashing algorithm of the password.


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.