UD
- The specific type of UserDase with which this role is associatedpublic class GenericUser<UD extends UserDatabase> extends AbstractUser
Concrete implementation of User
for a
UserDatabase
.
Modifier and Type | Field and Description |
---|---|
protected UD |
database
The
UserDatabase that owns this user. |
protected CopyOnWriteArrayList<Group> |
groups
The set of
Group s that this user is a member of. |
protected CopyOnWriteArrayList<Role> |
roles
The set of
Role s associated with this user. |
fullName, password, username
Modifier and Type | Method and Description |
---|---|
void |
addGroup(Group group)
Add a new
Group to those this user belongs to. |
void |
addRole(Role role)
Add a new
Role to those assigned specifically to this user. |
boolean |
equals(Object obj) |
Iterator<Group> |
getGroups()
Return the set of
Group s to which this user belongs. |
Iterator<Role> |
getRoles()
Return the set of
Role s assigned specifically to this user. |
UserDatabase |
getUserDatabase()
Return the
UserDatabase within which this User is defined. |
int |
hashCode() |
boolean |
isInGroup(Group group)
Is this user in the specified group?
|
boolean |
isInRole(Role role)
Is this user specifically assigned the specified
Role ? |
void |
removeGroup(Group group)
Remove a
Group from those this user belongs to. |
void |
removeGroups()
Remove all
Group s from those this user belongs to. |
void |
removeRole(Role role)
Remove a
Role from those assigned to this user. |
void |
removeRoles()
Remove all
Role 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 a
UserDatabase . |
getFullName, getName, getPassword, getUsername
protected final UD extends UserDatabase database
UserDatabase
that owns this user.protected final CopyOnWriteArrayList<Group> groups
Group
s that this user is a member of.protected final CopyOnWriteArrayList<Role> roles
Role
s associated with this user.public Iterator<Group> getGroups()
Group
s to which this user belongs.getGroups
in interface User
getGroups
in class AbstractUser
Group
s to which this user belongs.public Iterator<Role> getRoles()
Role
s assigned specifically to this user.getRoles
in interface User
getRoles
in class AbstractUser
Role
s assigned specifically to this user.public UserDatabase getUserDatabase()
UserDatabase
within which this User is defined.UserDatabase
within which this User is defined.public void addGroup(Group group)
Group
to those this user belongs to.addGroup
in interface User
addGroup
in class AbstractUser
group
- The new grouppublic void addRole(Role role)
Role
to those assigned specifically to this user.addRole
in interface User
addRole
in class AbstractUser
role
- The new rolepublic boolean isInGroup(Group group)
isInGroup
in interface User
isInGroup
in class AbstractUser
group
- The group to checktrue
if the user is in the specified grouppublic boolean isInRole(Role role)
Role
? This
method does NOT check for roles inherited based on
Group
membership.isInRole
in interface User
isInRole
in class AbstractUser
role
- The role to checktrue
if the user has the specified rolepublic void removeGroup(Group group)
Group
from those this user belongs to.removeGroup
in interface User
removeGroup
in class AbstractUser
group
- The old grouppublic void removeGroups()
Group
s from those this user belongs to.removeGroups
in interface User
removeGroups
in class AbstractUser
public void removeRole(Role role)
Role
from those assigned to this user.removeRole
in interface User
removeRole
in class AbstractUser
role
- The old rolepublic void removeRoles()
Role
s from those assigned to this user.removeRoles
in interface User
removeRoles
in class AbstractUser
public void setFullName(String fullName)
AbstractUser
setFullName
in interface User
setFullName
in class AbstractUser
fullName
- The new full namepublic void setPassword(String password)
AbstractUser
{md5}xxxxx
.setPassword
in interface User
setPassword
in class AbstractUser
password
- The new logon passwordpublic void setUsername(String username)
AbstractUser
UserDatabase
.setUsername
in interface User
setUsername
in class AbstractUser
username
- The new logon usernamepublic boolean equals(Object obj)
Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.