Package org.apache.catalina.users
Class AbstractUser
java.lang.Object
org.apache.catalina.users.AbstractUser
- Direct Known Subclasses:
MemoryUser
Convenience base class for User
implementations.
- Since:
- 4.1
- Author:
- Craig R. McClanahan
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Add a newGroup
to those this user belongs to.abstract void
Add a newRole
to those assigned specifically to this user.Return the full name of this user.Return the set ofGroup
s to which this user belongs.getName()
Make the principal name the same as the group name.Return the logon password of this user, optionally prefixed with the identifier of an encoding scheme surrounded by curly braces, such as{md5}xxxxx
.getRoles()
Return the set ofRole
s assigned specifically to this user.Return the logon username of this user, which must be unique within the scope of aUserDatabase
.abstract boolean
Is this user in the specifiedGroup
?abstract boolean
Is this user specifically assigned the specifiedRole
?abstract void
removeGroup
(Group group) Remove aGroup
from those this user belongs to.abstract void
Remove allGroup
s from those this user belongs to.abstract void
removeRole
(Role role) Remove aRole
from those assigned to this user.abstract 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.catalina.User
getUserDatabase
-
Field Details
-
fullName
The full name of this user. -
password
The logon password of this user. -
username
The logon username of this user.
-
-
Constructor Details
-
AbstractUser
public AbstractUser()
-
-
Method Details
-
getFullName
Return the full name of this user.- Specified by:
getFullName
in interfaceUser
- Returns:
- the full name of this user.
-
setFullName
Set the full name of this user.- Specified by:
setFullName
in interfaceUser
- Parameters:
fullName
- The new full name
-
getGroups
Return the set ofGroup
s to which this user belongs. -
getPassword
Return 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:
getPassword
in interfaceUser
- Returns:
- the logon password of this user, optionally prefixed with the
identifier of an encoding scheme surrounded by curly braces, such as
{md5}xxxxx
.
-
setPassword
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
- Parameters:
password
- The new logon password
-
getRoles
Return the set ofRole
s assigned specifically to this user. -
getUsername
Return the logon username of this user, which must be unique within the scope of aUserDatabase
.- Specified by:
getUsername
in interfaceUser
- Returns:
- the logon username of this user, which must be unique
within the scope of a
UserDatabase
.
-
setUsername
Set the logon username of this user, which must be unique within the scope of aUserDatabase
.- Specified by:
setUsername
in interfaceUser
- Parameters:
username
- The new logon username
-
addGroup
Add a newGroup
to those this user belongs to. -
addRole
Add a newRole
to those assigned specifically to this user. -
isInGroup
Is this user in the specifiedGroup
? -
isInRole
-
removeGroup
Remove aGroup
from those this user belongs to.- Specified by:
removeGroup
in interfaceUser
- Parameters:
group
- The old group
-
removeGroups
public abstract void removeGroups()Remove allGroup
s from those this user belongs to.- Specified by:
removeGroups
in interfaceUser
-
removeRole
Remove aRole
from those assigned to this user.- Specified by:
removeRole
in interfaceUser
- Parameters:
role
- The old role
-
removeRoles
public abstract void removeRoles()Remove allRole
s from those assigned to this user.- Specified by:
removeRoles
in interfaceUser
-
getName
Make the principal name the same as the group name.
-