Package org.apache.catalina.users
Class AbstractGroup
- java.lang.Object
-
- org.apache.catalina.users.AbstractGroup
-
- All Implemented Interfaces:
java.security.Principal
,Group
- Direct Known Subclasses:
GenericGroup
public abstract class AbstractGroup extends java.lang.Object implements Group
Convenience base class for
Group
implementations.- Since:
- 4.1
- Author:
- Craig R. McClanahan
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
description
The description of this group.protected java.lang.String
groupname
The group name of this group.
-
Constructor Summary
Constructors Constructor Description AbstractGroup()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
addRole(Role role)
Add a newRole
to those assigned specifically to this group.java.lang.String
getDescription()
Return the description of this group.java.lang.String
getGroupname()
Return the group name of this group, which must be unique within the scope of aUserDatabase
.java.lang.String
getName()
Make the principal name the same as the group name.abstract java.util.Iterator<Role>
getRoles()
Return the set ofRole
s assigned specifically to this group.abstract UserDatabase
getUserDatabase()
Return theUserDatabase
within which this Group is defined.abstract java.util.Iterator<User>
getUsers()
Return an Iterator over the set ofUser
s that are members of this group.abstract boolean
isInRole(Role role)
Is this group specifically assigned the specifiedRole
?abstract void
removeRole(Role role)
Remove aRole
from those assigned to this group.abstract void
removeRoles()
Remove allRole
s from those assigned to this group.void
setDescription(java.lang.String description)
Set the description of this group.void
setGroupname(java.lang.String groupname)
Set the group name of this group, which must be unique within the scope of aUserDatabase
.
-
-
-
Method Detail
-
getDescription
public java.lang.String getDescription()
Return the description of this group.- Specified by:
getDescription
in interfaceGroup
- Returns:
- the description of this group.
-
setDescription
public void setDescription(java.lang.String description)
Set the description of this group.- Specified by:
setDescription
in interfaceGroup
- Parameters:
description
- The new description
-
getGroupname
public java.lang.String getGroupname()
Return the group name of this group, which must be unique within the scope of aUserDatabase
.- Specified by:
getGroupname
in interfaceGroup
- Returns:
- the group name of this group, which must be unique
within the scope of a
UserDatabase
.
-
setGroupname
public void setGroupname(java.lang.String groupname)
Set the group name of this group, which must be unique within the scope of aUserDatabase
.- Specified by:
setGroupname
in interfaceGroup
- Parameters:
groupname
- The new group name
-
getRoles
public abstract java.util.Iterator<Role> getRoles()
Return the set ofRole
s assigned specifically to this group.
-
getUserDatabase
public abstract UserDatabase getUserDatabase()
Return theUserDatabase
within which this Group is defined.- Specified by:
getUserDatabase
in interfaceGroup
- Returns:
- the
UserDatabase
within which this Group is defined.
-
getUsers
public abstract java.util.Iterator<User> getUsers()
Return an Iterator over the set ofUser
s that are members of this group.
-
addRole
public abstract void addRole(Role role)
Add a newRole
to those assigned specifically to this group.
-
isInRole
public abstract boolean isInRole(Role role)
Is this group specifically assigned the specifiedRole
?
-
removeRole
public abstract void removeRole(Role role)
Remove aRole
from those assigned to this group.- Specified by:
removeRole
in interfaceGroup
- Parameters:
role
- The old role
-
removeRoles
public abstract void removeRoles()
Remove allRole
s from those assigned to this group.- Specified by:
removeRoles
in interfaceGroup
-
getName
public java.lang.String getName()
Make the principal name the same as the group name.- Specified by:
getName
in interfacejava.security.Principal
-
-