Top Description Fields Constructors Methods
org.apache.catalina.users

public Class GenericGroup<UD extends UserDatabase>

extends AbstractGroup
Class Inheritance
Known Direct Subclasses
org.apache.catalina.users.MemoryGroup
Type Parameters
<UD>
The specific type of UserDase with which this group is associated
Imports
java.util.ArrayList, .Iterator, .List, java.util.concurrent.CopyOnWriteArrayList, org.apache.catalina.Role, .User, .UserDatabase

Concrete implementation of org.apache.catalina.Group for a UserDatabase.

Author
Craig R. McClanahan

Field Summary

Modifier and TypeField and Description
protected final UD
database

The UserDatabase that owns this group.

protected final CopyOnWriteArrayList<Role>
roles

The set of Roles associated with this group.

Inherited from org.apache.catalina.users.AbstractGroup:
descriptiongroupname

Constructor Summary

AccessConstructor and Description
pack-priv
GenericGroup(UD
The UserDatabase that owns this group
database
,
String
Group name of this group
groupname
,
String
Description of this group
description
,
List<Role>
The roles of this group
roles
)

Package-private constructor used by the factory method in UserDatabase.

Method Summary

Modifier and TypeMethod and Description
public void
addRole(Role
The new role
role
)

Implements abstract org.apache.catalina.users.AbstractGroup.addRole.

Implements org.apache.catalina.Group.addRole.

Add a new Role to those assigned specifically to this group.

public boolean
equals(Object
Principal to compare with.
obj
)

Overrides java.lang.Object.equals.

Implements java.security.Principal.equals.

Compares this Principal to the specified object.

public Iterator<Role>
getRoles()

Implements abstract org.apache.catalina.users.AbstractGroup.getRoles.

Implements org.apache.catalina.Group.getRoles.

Return the set of Roles assigned specifically to this group.

public UserDatabase
getUserDatabase()

Implements abstract org.apache.catalina.users.AbstractGroup.getUserDatabase.

Implements org.apache.catalina.Group.getUserDatabase.

Return the UserDatabase within which this Group is defined.

public Iterator<User>
getUsers()

Implements abstract org.apache.catalina.users.AbstractGroup.getUsers.

Implements org.apache.catalina.Group.getUsers.

Return the set of org.apache.catalina.Users that are members of this group.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements java.security.Principal.hashCode.

Returns a hashcode for this Principal.

public boolean
isInRole(Role
The role to check
role
)

Implements abstract org.apache.catalina.users.AbstractGroup.isInRole.

Implements org.apache.catalina.Group.isInRole.

Is this group specifically assigned the specified Role?

public void
removeRole(Role
The old role
role
)

Implements abstract org.apache.catalina.users.AbstractGroup.removeRole.

Implements org.apache.catalina.Group.removeRole.

Remove a Role from those assigned to this group.

public void
removeRoles()

Implements abstract org.apache.catalina.users.AbstractGroup.removeRoles.

Implements org.apache.catalina.Group.removeRoles.

Remove all Roles from those assigned to this group.

Inherited from org.apache.catalina.users.AbstractGroup:
getDescriptiongetGroupnamegetNamesetDescriptionsetGroupname

Field Detail

databaseback to summary
protected final UD database

The UserDatabase that owns this group.

rolesback to summary
protected final CopyOnWriteArrayList<Role> roles

The set of Roles associated with this group.

Constructor Detail

GenericGroupback to summary
pack-priv GenericGroup(UD database, String groupname, String description, List<Role> roles)

Package-private constructor used by the factory method in UserDatabase.

Parameters
database:UD

The UserDatabase that owns this group

groupname:String

Group name of this group

description:String

Description of this group

roles:List<Role>

The roles of this group

Method Detail

addRoleback to summary
public void addRole(Role role)

Implements abstract org.apache.catalina.users.AbstractGroup.addRole.

Implements org.apache.catalina.Group.addRole.

Add a new Role to those assigned specifically to this group.

Parameters
role:Role

The new role

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Implements java.security.Principal.equals.

Doc from java.security.Principal.equals.

Compares this Principal to the specified object. Returns true if the object passed in matches the Principal represented by the implementation of this interface.

Parameters
obj:Object

Principal to compare with.

Returns:boolean

true if the Principal passed in is the same as that encapsulated by this Principal, and false otherwise.

Annotations
@Override
getRolesback to summary
public Iterator<Role> getRoles()

Implements abstract org.apache.catalina.users.AbstractGroup.getRoles.

Implements org.apache.catalina.Group.getRoles.

Return the set of Roles assigned specifically to this group.

Returns:Iterator<Role>

Doc from org.apache.catalina.Group.getRoles.

the set of Roles assigned specifically to this group.

Annotations
@Override
getUserDatabaseback to summary
public UserDatabase getUserDatabase()

Implements abstract org.apache.catalina.users.AbstractGroup.getUserDatabase.

Implements org.apache.catalina.Group.getUserDatabase.

Return the UserDatabase within which this Group is defined.

Returns:UserDatabase

Doc from org.apache.catalina.Group.getUserDatabase.

the UserDatabase within which this Group is defined.

Annotations
@Override
getUsersback to summary
public Iterator<User> getUsers()

Implements abstract org.apache.catalina.users.AbstractGroup.getUsers.

Implements org.apache.catalina.Group.getUsers.

Return the set of org.apache.catalina.Users that are members of this group.

Returns:Iterator<User>

Doc from org.apache.catalina.Group.getUsers.

the set of Users that are members of this group.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements java.security.Principal.hashCode.

Doc from java.security.Principal.hashCode.

Returns a hashcode for this Principal.

Returns:int

a hashcode for this Principal

Annotations
@Override
isInRoleback to summary
public boolean isInRole(Role role)

Implements abstract org.apache.catalina.users.AbstractGroup.isInRole.

Implements org.apache.catalina.Group.isInRole.

Is this group specifically assigned the specified Role?

Parameters
role:Role

The role to check

Returns:boolean

Doc from org.apache.catalina.Group.isInRole.

true if the group is assigned to the specified role otherwise false

Annotations
@Override
removeRoleback to summary
public void removeRole(Role role)

Implements abstract org.apache.catalina.users.AbstractGroup.removeRole.

Implements org.apache.catalina.Group.removeRole.

Remove a Role from those assigned to this group.

Parameters
role:Role

The old role

Annotations
@Override
removeRolesback to summary
public void removeRoles()

Implements abstract org.apache.catalina.users.AbstractGroup.removeRoles.

Implements org.apache.catalina.Group.removeRoles.

Remove all Roles from those assigned to this group.

Annotations
@Override