Package org.apache.catalina
Interface User
- 
- All Superinterfaces:
- java.security.Principal
 - All Known Implementing Classes:
- AbstractUser,- GenericUser,- MemoryUser
 
 public interface User extends java.security.PrincipalAbstract representation of a user in aUserDatabase. Each user is optionally associated with a set ofGroups through which they inherit additional security roles, and is optionally assigned a set of specificRoles.- Since:
- 4.1
- Author:
- Craig R. McClanahan
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddGroup(Group group)Add a newGroupto those this user belongs to.voidaddRole(Role role)Add aRoleto those assigned specifically to this user.java.lang.StringgetFullName()java.util.Iterator<Group>getGroups()java.lang.StringgetPassword()java.util.Iterator<Role>getRoles()UserDatabasegetUserDatabase()java.lang.StringgetUsername()booleanisInGroup(Group group)Is this user in the specifiedGroup?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.
 
- 
- 
- 
Method Detail- 
getFullNamejava.lang.String getFullName() - Returns:
- the full name of this user.
 
 - 
setFullNamevoid setFullName(java.lang.String fullName) Set the full name of this user.- Parameters:
- fullName- The new full name
 
 - 
getGroupsjava.util.Iterator<Group> getGroups() - Returns:
- the set of Groups to which this user belongs.
 
 - 
getPasswordjava.lang.String getPassword() - Returns:
- the logon password of this user, optionally prefixed with the
 identifier of an encoding scheme surrounded by curly braces, such as
 {md5}xxxxx.
 
 - 
setPasswordvoid setPassword(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.- Parameters:
- password- The new logon password
 
 - 
getRolesjava.util.Iterator<Role> getRoles() - Returns:
- the set of Roles assigned specifically to this user.
 
 - 
getUserDatabaseUserDatabase getUserDatabase() - Returns:
- the UserDatabasewithin which this User is defined.
 
 - 
getUsernamejava.lang.String getUsername() - Returns:
- the logon username of this user, which must be unique
 within the scope of a UserDatabase.
 
 - 
setUsernamevoid setUsername(java.lang.String username) Set the logon username of this user, which must be unique within the scope of aUserDatabase.- Parameters:
- username- The new logon username
 
 - 
addGroupvoid addGroup(Group group) Add a newGroupto those this user belongs to.- Parameters:
- group- The new group
 
 - 
addRolevoid addRole(Role role) Add aRoleto those assigned specifically to this user.- Parameters:
- role- The new role
 
 - 
isInGroupboolean isInGroup(Group group) Is this user in the specifiedGroup?- Parameters:
- group- The group to check
- Returns:
- trueif the user is in the specified group
 
 - 
isInRoleboolean isInRole(Role role) Is this user specifically assigned the specifiedRole? This method does NOT check for roles inherited based onGroupmembership.- Parameters:
- role- The role to check
- Returns:
- trueif the user has the specified role
 
 - 
removeGroupvoid removeGroup(Group group) Remove aGroupfrom those this user belongs to.- Parameters:
- group- The old group
 
 - 
removeGroupsvoid removeGroups() Remove allGroups from those this user belongs to.
 - 
removeRolevoid removeRole(Role role) Remove aRolefrom those assigned to this user.- Parameters:
- role- The old role
 
 - 
removeRolesvoid removeRoles() Remove allRoles from those assigned to this user.
 
- 
 
-