Top Description Methods
org.apache.catalina

public Interface User

extends Principal
Known Direct Implementers
org.apache.catalina.users.AbstractUser
Imports
java.security.Principal, java.util.Iterator

Abstract representation of a user in a UserDatabase. Each user is optionally associated with a set of Groups through which they inherit additional security roles, and is optionally assigned a set of specific Roles.
Author
Craig R. McClanahan
Since
4.1

Method Summary

Modifier and TypeMethod and Description
public void
addGroup(Group
The new group
group
)

Add a new Group to those this user belongs to.

public void
addRole(Role
The new role
role
)

Add a Role to those assigned specifically to this user.

public String

Returns:

the full name of this user.
getFullName
()

public Iterator<Group>

Returns:

the set of Groups to which this user belongs.
getGroups
()

public String

Returns:

the logon password of this user, optionally prefixed with the identifier of an encoding scheme surrounded by curly braces, such as {md5}xxxxx.
getPassword
()

public Iterator<Role>

Returns:

the set of Roles assigned specifically to this user.
getRoles
()

public UserDatabase

Returns:

the UserDatabase within which this User is defined.
getUserDatabase
()

public String

Returns:

the logon username of this user, which must be unique within the scope of a UserDatabase.
getUsername
()

public boolean

Returns:

true if the user is in the specified group
isInGroup
(Group
The group to check
group
)

Is this user in the specified Group?

public boolean

Returns:

true if the user has the specified role
isInRole
(Role
The role to check
role
)

Is this user specifically assigned the specified Role?

public void
removeGroup(Group
The old group
group
)

Remove a Group from those this user belongs to.

public void
removeGroups()

Remove all Groups from those this user belongs to.

public void
removeRole(Role
The old role
role
)

Remove a Role from those assigned to this user.

public void
removeRoles()

Remove all Roles from those assigned to this user.

public void
setFullName(String
The new full name
fullName
)

Set the full name of this user.

public void
setPassword(String
The new logon password
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.

public void
setUsername(String
The new logon username
username
)

Set the logon username of this user, which must be unique within the scope of a UserDatabase.

Inherited from java.security.Principal:
equalsgetNamehashCodeimpliestoString

Method Detail

addGroupback to summary
public void addGroup(Group group)

Add a new Group to those this user belongs to.

Parameters
group:Group

The new group

addRoleback to summary
public void addRole(Role role)

Add a Role to those assigned specifically to this user.

Parameters
role:Role

The new role

getFullNameback to summary
public String getFullName()
Returns:String

the full name of this user.

getGroupsback to summary
public Iterator<Group> getGroups()
Returns:Iterator<Group>

the set of Groups to which this user belongs.

getPasswordback to summary
public String getPassword()
Returns:String

the logon password of this user, optionally prefixed with the identifier of an encoding scheme surrounded by curly braces, such as {md5}xxxxx.

getRolesback to summary
public Iterator<Role> getRoles()
Returns:Iterator<Role>

the set of Roles assigned specifically to this user.

getUserDatabaseback to summary
public UserDatabase getUserDatabase()
Returns:UserDatabase

the UserDatabase within which this User is defined.

getUsernameback to summary
public String getUsername()
Returns:String

the logon username of this user, which must be unique within the scope of a UserDatabase.

isInGroupback to summary
public boolean isInGroup(Group group)

Is this user in the specified Group?

Parameters
group:Group

The group to check

Returns:boolean

true if the user is in the specified group

isInRoleback to summary
public boolean isInRole(Role role)

Is this user specifically assigned the specified Role? This method does NOT check for roles inherited based on Group membership.

Parameters
role:Role

The role to check

Returns:boolean

true if the user has the specified role

removeGroupback to summary
public void removeGroup(Group group)

Remove a Group from those this user belongs to.

Parameters
group:Group

The old group

removeGroupsback to summary
public void removeGroups()

Remove all Groups from those this user belongs to.

removeRoleback to summary
public void removeRole(Role role)

Remove a Role from those assigned to this user.

Parameters
role:Role

The old role

removeRolesback to summary
public void removeRoles()

Remove all Roles from those assigned to this user.

setFullNameback to summary
public void setFullName(String fullName)

Set the full name of this user.

Parameters
fullName:String

The new full name

setPasswordback to summary
public 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.

Parameters
password:String

The new logon password

setUsernameback to summary
public void setUsername(String username)

Set the logon username of this user, which must be unique within the scope of a UserDatabase.

Parameters
username:String

The new logon username