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
Concrete implementation of User
for a UserDatabase
.
- Author:
- Craig R. McClanahan
-
Field Summary
Modifier and TypeFieldDescriptionprotected final UD
TheUserDatabase
that owns this user.protected final CopyOnWriteArrayList
<Group> The set ofGroup
s that this user is a member of.protected final CopyOnWriteArrayList
<Role> The set ofRole
s associated with this user.Fields inherited from class org.apache.catalina.users.AbstractUser
fullName, password, username
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a newGroup
to those this user belongs to.void
Add aRole
to those assigned specifically to this user.boolean
getRoles()
int
hashCode()
boolean
Is this user in the specifiedGroup
?boolean
Is this user specifically assigned the specifiedRole
?void
removeGroup
(Group group) Remove aGroup
from those this user belongs to.void
Remove allGroup
s from those this user belongs to.void
removeRole
(Role role) Remove aRole
from those assigned to this user.void
Remove allRole
s from those assigned to this user.void
setFullName
(String fullName) Set the full name of this user.void
setPassword
(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
.void
setUsername
(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.AbstractUser
getFullName, getName, getPassword, getUsername
-
Field Details
-
database
TheUserDatabase
that owns this user. -
groups
The set ofGroup
s that this user is a member of. -
roles
The set ofRole
s associated with this user.
-
-
Method Details
-
getGroups
-
getRoles
-
getUserDatabase
- Returns:
- the
UserDatabase
within which this User is defined.
-
addGroup
-
addRole
-
isInGroup
-
isInRole
-
removeGroup
-
removeGroups
-
removeRole
-
removeRoles
-
setFullName
Description copied from interface:User
Set the full name of this user.- Specified by:
setFullName
in interfaceUser
- Overrides:
setFullName
in classAbstractUser
- Parameters:
fullName
- The new full name
-
setPassword
Description copied from interface:User
Set 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:
setPassword
in interfaceUser
- Overrides:
setPassword
in classAbstractUser
- Parameters:
password
- The new logon password
-
setUsername
Description copied from interface:User
Set the logon username of this user, which must be unique within the scope of aUserDatabase
.- Specified by:
setUsername
in interfaceUser
- Overrides:
setUsername
in classAbstractUser
- Parameters:
username
- The new logon username
-
equals
-
hashCode
-