FileDocCategorySizeDatePackage
User.javaAPI DocGlassfish v2 API5563Fri May 04 22:31:52 BST 2007org.apache.catalina

User

public interface User implements Principal

Abstract representation of a user in a {@link UserDatabase}. Each user is optionally associated with a set of {@link Group}s through which he or she inherits additional security roles, and is optionally assigned a set of specific {@link Role}s.

author
Craig R. McClanahan
version
$Revision: 1.3 $ $Date: 2007/05/05 05:31:52 $
since
4.1

Fields Summary
Constructors Summary
Methods Summary
public voidaddGroup(Group group)
Add a new {@link Group} to those this user belongs to.

param
group The new group

public voidaddRole(Role role)
Add a {@link Role} to those assigned specifically to this user.

param
role The new role

public java.lang.StringgetFullName()
Return the full name of this user.

public java.util.IteratorgetGroups()
Return the set of {@link Group}s to which this user belongs.

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

public java.util.IteratorgetRoles()
Return the set of {@link Role}s assigned specifically to this user.

public UserDatabasegetUserDatabase()
Return the {@link UserDatabase} within which this User is defined.

public java.lang.StringgetUsername()
Return the logon username of this user, which must be unique within the scope of a {@link UserDatabase}.

public booleanisInGroup(Group group)
Is this user in the specified {@link Group}?

param
group The group to check

public booleanisInRole(Role role)
Is this user specifically assigned the specified {@link Role}? This method does NOT check for roles inherited based on {@link Group} membership.

param
role The role to check

public voidremoveGroup(Group group)
Remove a {@link Group} from those this user belongs to.

param
group The old group

public voidremoveGroups()
Remove all {@link Group}s from those this user belongs to.

public voidremoveRole(Role role)
Remove a {@link Role} from those assigned to this user.

param
role The old role

public voidremoveRoles()
Remove all {@link Role}s from those assigned to this user.

public voidsetFullName(java.lang.String fullName)
Set the full name of this user.

param
fullName The new full name

public 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.

param
password The new logon password

public voidsetUsername(java.lang.String username)
Set the logon username of this user, which must be unique within the scope of a {@link UserDatabase}.

param
username The new logon username