Package org.apache.catalina.users
Class GenericUser<UD extends UserDatabase>
- java.lang.Object
- 
- org.apache.catalina.users.AbstractUser
- 
- org.apache.catalina.users.GenericUser<UD>
 
 
- 
- Type Parameters:
- UD- The specific type of UserDase with which this role is associated
 - All Implemented Interfaces:
- java.security.Principal,- User
 - Direct Known Subclasses:
- MemoryUser
 
 public class GenericUser<UD extends UserDatabase> extends AbstractUser Concrete implementation of Userfor aUserDatabase.- Author:
- Craig R. McClanahan
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected UDdatabaseTheUserDatabasethat owns this user.protected java.util.concurrent.CopyOnWriteArrayList<Group>groupsThe set ofGroups that this user is a member of.protected java.util.concurrent.CopyOnWriteArrayList<Role>rolesThe set ofRoles associated with this user.- 
Fields inherited from class org.apache.catalina.users.AbstractUserfullName, password, username
 
- 
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddGroup(Group group)Add a newGroupto those this user belongs to.voidaddRole(Role role)Add a newRoleto those assigned specifically to this user.booleanequals(java.lang.Object obj)java.util.Iterator<Group>getGroups()Return the set ofGroups to which this user belongs.java.util.Iterator<Role>getRoles()Return the set ofRoles assigned specifically to this user.UserDatabasegetUserDatabase()Return theUserDatabasewithin which this User is defined.inthashCode()booleanisInGroup(Group group)Is this user in the specified group?booleanisInRole(Role role)Is this user specifically assigned the specifiedRole?voidremoveGroup(Group group)Remove aGroupfrom those this user belongs to.voidremoveGroups()Remove allGroups from those this user belongs to.voidremoveRole(Role role)Remove aRolefrom those assigned to this user.voidremoveRoles()Remove allRoles from those assigned to this user.voidsetFullName(java.lang.String fullName)Set the full name of this user.voidsetPassword(java.lang.String password)Set the logon password of this user, optionally prefixed with the identifier of an encoding scheme surrounded by curly braces, such as{md5}xxxxx.voidsetUsername(java.lang.String username)Set the logon username of this user, which must be unique within the scope of aUserDatabase.- 
Methods inherited from class org.apache.catalina.users.AbstractUsergetFullName, getName, getPassword, getUsername
 
- 
 
- 
- 
- 
Field Detail- 
databaseprotected final UD extends UserDatabase database TheUserDatabasethat owns this user.
 - 
groupsprotected final java.util.concurrent.CopyOnWriteArrayList<Group> groups The set ofGroups that this user is a member of.
 
- 
 - 
Method Detail- 
getGroupspublic java.util.Iterator<Group> getGroups() Return the set ofGroups to which this user belongs.- Specified by:
- getGroupsin interface- User
- Specified by:
- getGroupsin class- AbstractUser
- Returns:
- the set of Groups to which this user belongs.
 
 - 
getRolespublic java.util.Iterator<Role> getRoles() Return the set ofRoles assigned specifically to this user.- Specified by:
- getRolesin interface- User
- Specified by:
- getRolesin class- AbstractUser
- Returns:
- the set of Roles assigned specifically to this user.
 
 - 
getUserDatabasepublic UserDatabase getUserDatabase() Return theUserDatabasewithin which this User is defined.- Returns:
- the UserDatabasewithin which this User is defined.
 
 - 
addGrouppublic void addGroup(Group group) Add a newGroupto those this user belongs to.- Specified by:
- addGroupin interface- User
- Specified by:
- addGroupin class- AbstractUser
- Parameters:
- group- The new group
 
 - 
addRolepublic void addRole(Role role) Add a newRoleto those assigned specifically to this user.- Specified by:
- addRolein interface- User
- Specified by:
- addRolein class- AbstractUser
- Parameters:
- role- The new role
 
 - 
isInGrouppublic boolean isInGroup(Group group) Is this user in the specified group?- Specified by:
- isInGroupin interface- User
- Specified by:
- isInGroupin class- AbstractUser
- Parameters:
- group- The group to check
- Returns:
- trueif the user is in the specified group
 
 - 
isInRolepublic boolean isInRole(Role role) Is this user specifically assigned the specifiedRole? This method does NOT check for roles inherited based onGroupmembership.- Specified by:
- isInRolein interface- User
- Specified by:
- isInRolein class- AbstractUser
- Parameters:
- role- The role to check
- Returns:
- trueif the user has the specified role
 
 - 
removeGrouppublic void removeGroup(Group group) Remove aGroupfrom those this user belongs to.- Specified by:
- removeGroupin interface- User
- Specified by:
- removeGroupin class- AbstractUser
- Parameters:
- group- The old group
 
 - 
removeGroupspublic void removeGroups() Remove allGroups from those this user belongs to.- Specified by:
- removeGroupsin interface- User
- Specified by:
- removeGroupsin class- AbstractUser
 
 - 
removeRolepublic void removeRole(Role role) Remove aRolefrom those assigned to this user.- Specified by:
- removeRolein interface- User
- Specified by:
- removeRolein class- AbstractUser
- Parameters:
- role- The old role
 
 - 
removeRolespublic void removeRoles() Remove allRoles from those assigned to this user.- Specified by:
- removeRolesin interface- User
- Specified by:
- removeRolesin class- AbstractUser
 
 - 
setFullNamepublic void setFullName(java.lang.String fullName) Description copied from class:AbstractUserSet the full name of this user.- Specified by:
- setFullNamein interface- User
- Overrides:
- setFullNamein class- AbstractUser
- Parameters:
- fullName- The new full name
 
 - 
setPasswordpublic void setPassword(java.lang.String password) Description copied from class:AbstractUserSet the logon password of this user, optionally prefixed with the identifier of an encoding scheme surrounded by curly braces, such as{md5}xxxxx.- Specified by:
- setPasswordin interface- User
- Overrides:
- setPasswordin class- AbstractUser
- Parameters:
- password- The new logon password
 
 - 
setUsernamepublic void setUsername(java.lang.String username) Description copied from class:AbstractUserSet the logon username of this user, which must be unique within the scope of aUserDatabase.- Specified by:
- setUsernamein interface- User
- Overrides:
- setUsernamein class- AbstractUser
- Parameters:
- username- The new logon username
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Specified by:
- equalsin interface- java.security.Principal
- Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() - Specified by:
- hashCodein interface- java.security.Principal
- Overrides:
- hashCodein class- java.lang.Object
 
 
- 
 
-