Package org.apache.catalina.users
Class MemoryUser
- java.lang.Object
-
- org.apache.catalina.users.AbstractUser
-
- org.apache.catalina.users.MemoryUser
-
- All Implemented Interfaces:
java.security.Principal,User
@Deprecated public class MemoryUser extends AbstractUser
Deprecated.UseAbstractUserinstead.Concrete implementation of
Userfor theMemoryUserDatabaseimplementation ofUserDatabase.- Since:
- 4.1
- Author:
- Craig R. McClanahan
-
-
Field Summary
Fields Modifier and Type Field Description protected MemoryUserDatabasedatabaseDeprecated.TheMemoryUserDatabasethat owns this user.protected java.util.concurrent.CopyOnWriteArrayList<Group>groupsDeprecated.The set ofGroups that this user is a member of.protected java.util.concurrent.CopyOnWriteArrayList<Role>rolesDeprecated.The set ofRoles associated with this user.-
Fields inherited from class org.apache.catalina.users.AbstractUser
fullName, password, username
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddGroup(Group group)Deprecated.Add a newGroupto those this user belongs to.voidaddRole(Role role)Deprecated.Add a newRoleto those assigned specifically to this user.java.util.Iterator<Group>getGroups()Deprecated.Return the set ofGroups to which this user belongs.java.util.Iterator<Role>getRoles()Deprecated.Return the set ofRoles assigned specifically to this user.UserDatabasegetUserDatabase()Deprecated.Return theUserDatabasewithin which this User is defined.booleanisInGroup(Group group)Deprecated.Is this user in the specified group?booleanisInRole(Role role)Deprecated.Is this user specifically assigned the specifiedRole?voidremoveGroup(Group group)Deprecated.Remove aGroupfrom those this user belongs to.voidremoveGroups()Deprecated.Remove allGroups from those this user belongs to.voidremoveRole(Role role)Deprecated.Remove aRolefrom those assigned to this user.voidremoveRoles()Deprecated.Remove allRoles from those assigned to this user.java.lang.StringtoString()Deprecated.Return a String representation of this user.java.lang.StringtoXml()Deprecated.Return a String representation of this user in XML format.-
Methods inherited from class org.apache.catalina.users.AbstractUser
getFullName, getName, getPassword, getUsername, setFullName, setPassword, setUsername
-
-
-
-
Field Detail
-
database
protected final MemoryUserDatabase database
Deprecated.TheMemoryUserDatabasethat owns this user.
-
groups
protected final java.util.concurrent.CopyOnWriteArrayList<Group> groups
Deprecated.The set ofGroups that this user is a member of.
-
-
Method Detail
-
getGroups
public java.util.Iterator<Group> getGroups()
Deprecated.Return the set ofGroups to which this user belongs.- Specified by:
getGroupsin interfaceUser- Specified by:
getGroupsin classAbstractUser- Returns:
- the set of
Groups to which this user belongs.
-
getRoles
public java.util.Iterator<Role> getRoles()
Deprecated.Return the set ofRoles assigned specifically to this user.- Specified by:
getRolesin interfaceUser- Specified by:
getRolesin classAbstractUser- Returns:
- the set of
Roles assigned specifically to this user.
-
getUserDatabase
public UserDatabase getUserDatabase()
Deprecated.Return theUserDatabasewithin which this User is defined.- Returns:
- the
UserDatabasewithin which this User is defined.
-
addGroup
public void addGroup(Group group)
Deprecated.Add a newGroupto those this user belongs to.- Specified by:
addGroupin interfaceUser- Specified by:
addGroupin classAbstractUser- Parameters:
group- The new group
-
addRole
public void addRole(Role role)
Deprecated.Add a newRoleto those assigned specifically to this user.- Specified by:
addRolein interfaceUser- Specified by:
addRolein classAbstractUser- Parameters:
role- The new role
-
isInGroup
public boolean isInGroup(Group group)
Deprecated.Is this user in the specified group?- Specified by:
isInGroupin interfaceUser- Specified by:
isInGroupin classAbstractUser- Parameters:
group- The group to check- Returns:
trueif the user is in the specified group
-
isInRole
public boolean isInRole(Role role)
Deprecated.Is this user specifically assigned the specifiedRole? This method does NOT check for roles inherited based onGroupmembership.- Specified by:
isInRolein interfaceUser- Specified by:
isInRolein classAbstractUser- Parameters:
role- The role to check- Returns:
trueif the user has the specified role
-
removeGroup
public void removeGroup(Group group)
Deprecated.Remove aGroupfrom those this user belongs to.- Specified by:
removeGroupin interfaceUser- Specified by:
removeGroupin classAbstractUser- Parameters:
group- The old group
-
removeGroups
public void removeGroups()
Deprecated.Remove allGroups from those this user belongs to.- Specified by:
removeGroupsin interfaceUser- Specified by:
removeGroupsin classAbstractUser
-
removeRole
public void removeRole(Role role)
Deprecated.Remove aRolefrom those assigned to this user.- Specified by:
removeRolein interfaceUser- Specified by:
removeRolein classAbstractUser- Parameters:
role- The old role
-
removeRoles
public void removeRoles()
Deprecated.Remove allRoles from those assigned to this user.- Specified by:
removeRolesin interfaceUser- Specified by:
removeRolesin classAbstractUser
-
toXml
public java.lang.String toXml()
Deprecated.Return a String representation of this user in XML format.
IMPLEMENTATION NOTE - For backwards compatibility, the reader that processes this entry will accept either
usernameornamefor the username property.- Returns:
- the XML representation
-
toString
public java.lang.String toString()
Deprecated.Return a String representation of this user.
- Specified by:
toStringin interfacejava.security.Principal- Overrides:
toStringin classjava.lang.Object
-
-