org.apache.lenya.ac.file
Class FileUser

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
              extended by org.apache.lenya.ac.file.FileUser
All Implemented Interfaces:
java.io.Serializable, Accreditable, Groupable, Identifiable, Item, User
Direct Known Subclasses:
CIFSUser, LDAPUser

public class FileUser
extends AbstractUser
implements java.io.Serializable

File-based user implementation.

Version:
$Id: FileUser.java 473841 2006-11-12 00:46:38Z gregor $
See Also:
Serialized Form

Field Summary
static java.lang.String EMAIL
           
static java.lang.String GROUP
           
static java.lang.String GROUPS
           
static java.lang.String ID
           
static java.lang.String PASSWORD
           
static java.lang.String PASSWORD_ATTRIBUTE
           
 
Constructor Summary
FileUser()
          Creates a new FileUser object.
FileUser(java.io.File configurationDirectory, java.lang.String id, java.lang.String fullName, java.lang.String email, java.lang.String password)
          Create a FileUser
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration config)
          Configure this FileUser.
protected  org.apache.avalon.framework.configuration.Configuration createConfiguration()
          Create a configuration from the current user details.
 void delete()
          Delete a user
protected  java.io.File getConfigurationDirectory()
          Returns the configuration directory.
protected  java.io.File getFile()
          Returns the configuration file.
 void save()
          Save the user
 void setConfigurationDirectory(java.io.File configurationDirectory)
          Sets the configuration directory of this item.
 
Methods inherited from class org.apache.lenya.ac.impl.AbstractUser
authenticate, getEmail, getEncryptedPassword, getFullName, setEmail, setEncryptedPassword, setFullName, setPassword
 
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
getDescription, getId, getName, setDescription, setName
 
Methods inherited from interface org.apache.lenya.ac.Groupable
addedToGroup, getGroups, removedFromGroup, removeFromAllGroups
 

Field Detail

ID

public static final java.lang.String ID
See Also:
Constant Field Values

EMAIL

public static final java.lang.String EMAIL
See Also:
Constant Field Values

PASSWORD

public static final java.lang.String PASSWORD
See Also:
Constant Field Values

GROUPS

public static final java.lang.String GROUPS
See Also:
Constant Field Values

GROUP

public static final java.lang.String GROUP
See Also:
Constant Field Values

PASSWORD_ATTRIBUTE

public static final java.lang.String PASSWORD_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

FileUser

public FileUser()
Creates a new FileUser object.


FileUser

public FileUser(java.io.File configurationDirectory,
                java.lang.String id,
                java.lang.String fullName,
                java.lang.String email,
                java.lang.String password)
Create a FileUser

Parameters:
configurationDirectory - where the user will be attached to
id - the user id
fullName - the full name of the user
email - the users email address
password - the users password
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration config)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Configure this FileUser.

Specified by:
configure in interface Item
Parameters:
config - where the user details are specified
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if the necessary details aren't specified in the config

createConfiguration

protected org.apache.avalon.framework.configuration.Configuration createConfiguration()
Create a configuration from the current user details. Can be used for saving.

Returns:
a Configuration

save

public void save()
          throws AccessControlException
Description copied from class: AbstractUser
Save the user

Specified by:
save in interface User
Specified by:
save in class AbstractUser
Throws:
AccessControlException - if the save failed
See Also:
User.save()

delete

public void delete()
            throws AccessControlException
Description copied from class: AbstractUser
Delete a user

Specified by:
delete in interface User
Overrides:
delete in class AbstractUser
Throws:
AccessControlException - if the delete failed
See Also:
User.delete()

getFile

protected java.io.File getFile()
Returns the configuration file.

Returns:
A file object.

getConfigurationDirectory

protected java.io.File getConfigurationDirectory()
Returns the configuration directory.

Returns:
A file object.

setConfigurationDirectory

public void setConfigurationDirectory(java.io.File configurationDirectory)
Description copied from interface: Item
Sets the configuration directory of this item.

Specified by:
setConfigurationDirectory in interface Item
Parameters:
configurationDirectory - The configuration directory.
See Also:
Item.setConfigurationDirectory(java.io.File)


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