org.apache.lenya.ac.impl
Class AbstractUser

java.lang.Object
  extended by org.apache.lenya.ac.impl.AbstractItem
      extended by org.apache.lenya.ac.impl.AbstractGroupable
          extended by org.apache.lenya.ac.impl.AbstractUser
All Implemented Interfaces:
Accreditable, Groupable, Identifiable, Item, User
Direct Known Subclasses:
FileUser

public abstract class AbstractUser
extends AbstractGroupable
implements User

Abstract user implementation.

Version:
$Id: AbstractUser.java 473841 2006-11-12 00:46:38Z gregor $

Constructor Summary
AbstractUser()
          Creates a new User.
AbstractUser(java.lang.String id, java.lang.String fullName, java.lang.String email, java.lang.String password)
          Create a User instance
 
Method Summary
 boolean authenticate(java.lang.String password)
          Authenticate a user.
 void delete()
          Delete a user
 java.lang.String getEmail()
          Get the email address
protected  java.lang.String getEncryptedPassword()
          Get the encrypted password
 java.lang.String getFullName()
          Deprecated. has been superceded by getName()
abstract  void save()
          Save the user
 void setEmail(java.lang.String email)
          Set the email address
protected  void setEncryptedPassword(java.lang.String encryptedPassword)
          This method can be used for subclasses to set the password without it being encrypted again.
 void setFullName(java.lang.String name)
          Deprecated. has been superceded by setName(String)
 void setPassword(java.lang.String plainTextPassword)
          Sets the password.
 
Methods inherited from class org.apache.lenya.ac.impl.AbstractGroupable
addedToGroup, getAccreditables, getGroups, removedFromGroup, removeFromAllGroups
 
Methods inherited from class org.apache.lenya.ac.impl.AbstractItem
equals, getDescription, getId, getName, hashCode, isValidId, setDescription, setId, setName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.lenya.ac.Accreditable
getAccreditables
 
Methods inherited from interface org.apache.lenya.ac.Item
configure, getDescription, getId, getName, setConfigurationDirectory, setDescription, setName
 
Methods inherited from interface org.apache.lenya.ac.Groupable
addedToGroup, getGroups, removedFromGroup, removeFromAllGroups
 

Constructor Detail

AbstractUser

public AbstractUser()
Creates a new User.


AbstractUser

public AbstractUser(java.lang.String id,
                    java.lang.String fullName,
                    java.lang.String email,
                    java.lang.String password)
Create a User instance

Parameters:
id - the user id
fullName - the full name of the user
email - the users email address
password - the users password
Method Detail

getEmail

public java.lang.String getEmail()
Get the email address

Specified by:
getEmail in interface User
Returns:
a String

getFullName

public java.lang.String getFullName()
Deprecated. has been superceded by getName()

Get the full name

Returns:
a String

setEmail

public void setEmail(java.lang.String email)
Set the email address

Specified by:
setEmail in interface User
Parameters:
email - the new email address

setFullName

public void setFullName(java.lang.String name)
Deprecated. has been superceded by setName(String)

Set the full name

Parameters:
name - the new full name

setPassword

public void setPassword(java.lang.String plainTextPassword)
Sets the password.

Specified by:
setPassword in interface User
Parameters:
plainTextPassword - The plain text passwrod.

setEncryptedPassword

protected void setEncryptedPassword(java.lang.String encryptedPassword)
This method can be used for subclasses to set the password without it being encrypted again. Some subclass might have knowledge of the encrypted password and needs to be able to set it.

Parameters:
encryptedPassword - the encrypted password

getEncryptedPassword

protected java.lang.String getEncryptedPassword()
Get the encrypted password

Returns:
the encrypted password

save

public abstract void save()
                   throws AccessControlException
Save the user

Specified by:
save in interface User
Throws:
AccessControlException - if the save failed

delete

public void delete()
            throws AccessControlException
Delete a user

Specified by:
delete in interface User
Throws:
AccessControlException - if the delete failed

authenticate

public boolean authenticate(java.lang.String password)
Authenticate a user. This is done by encrypting the given password and comparing this to the encryptedPassword.

Specified by:
authenticate in interface User
Parameters:
password - to authenticate with
Returns:
true if the given password matches the password for this user


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.