org.apache.james.user.lib.model
Class DefaultUser

java.lang.Object
  extended by org.apache.james.user.lib.model.DefaultUser
All Implemented Interfaces:
Serializable, User
Direct Known Subclasses:
DefaultJamesUser

public class DefaultUser
extends Object
implements User, Serializable

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

See Also:
Serialized Form

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

Constructor Detail

DefaultUser

public DefaultUser(String name,
                   String hashAlg)
Standard constructor.

Parameters:
name - the String name of this user
hashAlg - the algorithm used to generate the hash of the password

DefaultUser

public DefaultUser(String name,
                   String passwordHash,
                   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 String getUserName()
Specified by:
getUserName in interface User
See Also:
User.getUserName()

verifyPassword

public boolean verifyPassword(String pass)
Specified by:
verifyPassword in interface User
See Also:
User.verifyPassword(java.lang.String)

setPassword

public boolean setPassword(String newPass)
Specified by:
setPassword in interface User
See Also:
User.setPassword(java.lang.String)

getHashedPassword

public String getHashedPassword()
Method to access hash of password

Returns:
the String of the hashed Password

getHashAlgorithm

public String getHashAlgorithm()
Method to access the hashing algorithm of the password.

Returns:
the name of the hashing algorithm used for this user's password


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.