## org.apache.catalina.users
Class AbstractRole

    java.lang.Object
      org.apache.catalina.users.AbstractRole

All Implemented Interfaces:
  java.security.Principal, Role

Direct Known Subclasses:
  MemoryRole

public abstract class AbstractRole
extends java.lang.Object
implements Role

Convenience base class for `Role` implementations.

Since:
  4.1
Version:
  $Revision: 466595 $ $Date: 2006-10-21 23:24:41 +0100 (Sat, 21 Oct 2006) $
Author:
  Craig R. McClanahan

Field Summary
`protected java.lang.String` `description` The description of this Role.
`protected java.lang.String` `rolename` The role name of this Role.

Constructor Summary
`AbstractRole()`

Method Summary
`java.lang.String` `getDescription()` Return the description of this role.
`java.lang.String` `getName()` Make the principal name the same as the role name.
`java.lang.String` `getRolename()` Return the role name of this role, which must be unique within the scope of a `UserDatabase`.
`abstract UserDatabase` `getUserDatabase()` Return the `UserDatabase` within which this Role is defined.
`void` `setDescription(java.lang.String description)` Set the description of this role.
`void` `setRolename(java.lang.String rolename)` Set the role name of this role, which must be unique within the scope of a `UserDatabase`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface java.security.Principal
`equals, hashCode, toString`

Field Detail

### description

    protected java.lang.String description

  The description of this Role.

### rolename

    protected java.lang.String rolename

  The role name of this Role.

Constructor Detail

### AbstractRole

    public AbstractRole()

Method Detail

### getDescription

    public java.lang.String getDescription()

  Return the description of this role.

  Specified by:
    `getDescription` in interface `Role`

### setDescription

    public void setDescription(java.lang.String description)

  Set the description of this role.

  Specified by:
    `setDescription` in interface `Role`
  Parameters:
    `description` - The new description

### getRolename

    public java.lang.String getRolename()

  Return the role name of this role, which must be unique within the scope of a `UserDatabase`.

  Specified by:
    `getRolename` in interface `Role`

### setRolename

    public void setRolename(java.lang.String rolename)

  Set the role name of this role, which must be unique within the scope of a `UserDatabase`.

  Specified by:
    `setRolename` in interface `Role`
  Parameters:
    `rolename` - The new role name

### getUserDatabase

    public abstract UserDatabase getUserDatabase()

  Return the `UserDatabase` within which this Role is defined.

  Specified by:
    `getUserDatabase` in interface `Role`

### getName

    public java.lang.String getName()

  Make the principal name the same as the role name.

  Specified by:
    `getName` in interface `java.security.Principal`

Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.