Home » apache-tomcat-6.0.26-src » org.apache » tomcat » security » file » [javadoc | source]
org.apache.tomcat.security.file
final class: FileRealmUser [javadoc | source]
java.lang.Object
   org.apache.tomcat.security.file.FileRealmUser

All Implemented Interfaces:
    Principal

In-memory representation of an individual user, to which specific roles may be assigned directly, or indirectly by virtue of membership in one or more groups. This class exhibits the following JavaBeans properties:
Constructor:
 FileRealmUser(FileRealmDatabase database,
    String name,
    String password) 
    [Package Private] Create a new user with the specified username. It is assumed that the creating entity has ensured that this username is unique within this security realm.
    Parameters:
    database - FileRealmDatabase containing the new user
    name - Username assigned to the new user
    password - Cleartext password
 FileRealmUser(FileRealmDatabase database,
    String name,
    byte[] password) 
    [Package Private] Create a new user with the specified username. It is assumed that the creating entity has ensured that this username is unique within this security realm.
    Parameters:
    database - FileRealmDatabase containing the new user
    name - Username assigned to the new user
    password - Encrypted password
Method from org.apache.tomcat.security.file.FileRealmUser Summary:
addGroup,   addRole,   authenticate,   destroy,   getGroups,   getName,   getPassword,   getRoles,   hasGroup,   hasRole,   remove,   remove,   setPassword,   setPassword
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tomcat.security.file.FileRealmUser Detail:
 public  void addGroup(FileRealmGroup group) 
    Add this user as a member of the specified group.
 public  void addRole(String role) 
    Add the explicit assignment of the specified role to this user.
 public boolean authenticate(String password) 
    Can this user be authenticated with the specified password?
 public  void destroy() 
    Remove this user from the database to which it belongs.
 public Enumeration getGroups() 
    Return an enumeration of the groups to which this user belongs. If this user is a member of no groups, an empty enumeration is returned. Each element in the enumeration is an instance of FileRealmGroup.
 public String getName() 
    Return the username of this user.
 public byte[] getPassword() 
    Return the encrypted version of the password.
 public Enumeration getRoles() 
    Return an enumeration of the roles explicitly assigned to this user. If there are no assigned roles, an empty enumeration is returned.
 public boolean hasGroup(FileRealmGroup group) 
    Is this user a member of the specified group?
 public boolean hasRole(String role) 
    Has this user been explicitly assigned the specified role?
 public  void remove(FileRealmGroup group) 
    Remove this user from membership in the specified group.
 public  void remove(String role) 
    Remove the specified explicitly assigned role from this user.
 public  void setPassword(byte[] password) 
    Set the password associated with this user.
 public  void setPassword(String password) 
    Set the password associated with this user. This cleartext value will be immediately encrypted for storage.