Package org.apache.catalina.mbeans

## Class UserMBean

- java.lang.Object
- - org.apache.tomcat.util.modeler.BaseModelMBean
  - - org.apache.catalina.mbeans.UserMBean

All Implemented Interfaces:
  `javax.management.DynamicMBean`, `javax.management.MBeanRegistration`, `javax.management.modelmbean.ModelMBeanNotificationBroadcaster`, `javax.management.NotificationBroadcaster`

    public class UserMBean
    extends BaseModelMBean

A ModelMBean implementation for the `org.apache.catalina.User` component.

Author:
  Craig R. McClanahan

### Field Summary

Fields
`protected ManagedBean` `managed` The `ManagedBean` information describing this MBean.
`protected Registry` `registry` The configuration information registry for our managed beans.

### Fields inherited from class org.apache.tomcat.util.modeler.BaseModelMBean

`attributeBroadcaster, generalBroadcaster, managedBean, oname, resource, resourceType`

### Constructor Summary

Constructors
`UserMBean()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addGroup​(java.lang.String groupname)` Add a new `Group` to those this user belongs to.
`void` `addRole​(java.lang.String rolename)` Add a new `Role` to those this user belongs to.
`java.lang.String[]` `getGroups()`
`java.lang.String[]` `getRoles()`
`void` `removeGroup​(java.lang.String groupname)` Remove a `Group` from those this user belongs to.
`void` `removeRole​(java.lang.String rolename)` Remove a `Role` from those this user belongs to.

### Methods inherited from class org.apache.tomcat.util.modeler.BaseModelMBean

`addAttributeChangeNotificationListener, addNotificationListener, getAttribute, getAttributes, getClassName, getJmxName, getManagedResource, getMBeanInfo, getModelerType, getNotificationInfo, getObjectName, invoke, postDeregister, postRegister, preDeregister, preRegister, removeAttributeChangeNotificationListener, removeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotification, setAttribute, setAttributes, setManagedBean, setManagedResource, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### registry

    protected final Registry registry

The configuration information registry for our managed beans.

#### managed

    protected final ManagedBean managed

The `ManagedBean` information describing this MBean.

### Constructor Detail

#### UserMBean

    public UserMBean()

### Method Detail

#### getGroups

    public java.lang.String[] getGroups()

Returns:
  the MBean Names of all groups this user is a member of.

#### getRoles

    public java.lang.String[] getRoles()

Returns:
  the MBean Names of all roles assigned to this user.

#### addGroup

    public void addGroup​(java.lang.String groupname)

Add a new `Group` to those this user belongs to.

Parameters:
  `groupname` - Group name of the new group

#### addRole

    public void addRole​(java.lang.String rolename)

Add a new `Role` to those this user belongs to.

Parameters:
  `rolename` - Role name of the new role

#### removeGroup

    public void removeGroup​(java.lang.String groupname)

Remove a `Group` from those this user belongs to.

Parameters:
  `groupname` - Group name of the old group

#### removeRole

    public void removeRole​(java.lang.String rolename)

Remove a `Role` from those this user belongs to.

Parameters:
  `rolename` - Role name of the old role