## org.apache.catalina.mbeans
Class MemoryUserDatabaseMBean

    java.lang.Object
      org.apache.commons.modeler.BaseModelMBean
          org.apache.catalina.mbeans.MemoryUserDatabaseMBean

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

public class MemoryUserDatabaseMBean
extends org.apache.commons.modeler.BaseModelMBean

A ModelMBean implementation for the `org.apache.catalina.users.MemoryUserDatabase` component.

Version:
  $Revision: 1.5 $ $Date: 2004/08/26 21:36:08 $
Author:
  Craig R. McClanahan

Field Summary
`protected org.apache.commons.modeler.ManagedBean` `managed` The `ManagedBean` information describing this MBean.
`protected org.apache.commons.modeler.ManagedBean` `managedGroup` The `ManagedBean` information describing Group MBeans.
`protected org.apache.commons.modeler.ManagedBean` `managedRole` The `ManagedBean` information describing Group MBeans.
`protected org.apache.commons.modeler.ManagedBean` `managedUser` The `ManagedBean` information describing User MBeans.
`protected javax.management.MBeanServer` `mserver` The `MBeanServer` in which we are registered.
`protected org.apache.commons.modeler.Registry` `registry` The configuration information registry for our managed beans.

Fields inherited from class org.apache.commons.modeler.BaseModelMBean
`attributeBroadcaster, attributes, generalBroadcaster, info, oname, resource, resourceType, source`

Constructor Summary
`MemoryUserDatabaseMBean()` Construct a `ModelMBean` with default `ModelMBeanInfo` information.

Method Summary
`java.lang.String` `createGroup(java.lang.String groupname, java.lang.String description)` Create a new Group and return the corresponding MBean Name.
`java.lang.String` `createRole(java.lang.String rolename, java.lang.String description)` Create a new Role and return the corresponding MBean Name.
`java.lang.String` `createUser(java.lang.String username, java.lang.String password, java.lang.String fullName)` Create a new User and return the corresponding MBean Name.
`java.lang.String` `findGroup(java.lang.String groupname)` Return the MBean Name for the specified group name (if any); otherwise return `null`.
`java.lang.String` `findRole(java.lang.String rolename)` Return the MBean Name for the specified role name (if any); otherwise return `null`.
`java.lang.String` `findUser(java.lang.String username)` Return the MBean Name for the specified user name (if any); otherwise return `null`.
`java.lang.String[]` `getGroups()` Return the MBean Names of all groups defined in this database.
`java.lang.String[]` `getRoles()` Return the MBean Names of all roles defined in this database.
`java.lang.String[]` `getUsers()` Return the MBean Names of all users defined in this database.
`void` `removeGroup(java.lang.String groupname)` Remove an existing group and destroy the corresponding MBean.
`void` `removeRole(java.lang.String rolename)` Remove an existing role and destroy the corresponding MBean.
`void` `removeUser(java.lang.String username)` Remove an existing user and destroy the corresponding MBean.

Methods inherited from class org.apache.commons.modeler.BaseModelMBean

`addAttributeChangeNotificationListener, addNotificationListener, createDefaultModelMBeanInfo, createResource, getAttribute, getAttributes, getClassName, getManagedResource, getMBeanInfo, getModelerType, getNotificationInfo, getObjectName, getRegistry, initModelInfo, invoke, isModelMBeanInfoValid, load, postDeregister, postRegister, preDeregister, preRegister, removeAttributeChangeNotificationListener, removeAttributeChangeNotificationListener, removeNotificationListener, removeNotificationListener, removeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotification, setAttribute, setAttributes, setManagedResource, setModeledType, setModelMBeanInfo, setRegistry, store, toString`

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

Field Detail

### registry

    protected org.apache.commons.modeler.Registry registry

  The configuration information registry for our managed beans.

### mserver

    protected javax.management.MBeanServer mserver

  The `MBeanServer` in which we are registered.

### managed

    protected org.apache.commons.modeler.ManagedBean managed

  The `ManagedBean` information describing this MBean.

### managedGroup

    protected org.apache.commons.modeler.ManagedBean managedGroup

  The `ManagedBean` information describing Group MBeans.

### managedRole

    protected org.apache.commons.modeler.ManagedBean managedRole

  The `ManagedBean` information describing Group MBeans.

### managedUser

    protected org.apache.commons.modeler.ManagedBean managedUser

  The `ManagedBean` information describing User MBeans.

Constructor Detail

### MemoryUserDatabaseMBean

    public MemoryUserDatabaseMBean()
                            throws javax.management.MBeanException,
                                   javax.management.RuntimeOperationsException

  Construct a `ModelMBean` with default `ModelMBeanInfo` information.

Throws:
  `javax.management.MBeanException` - if the initializer of an object throws an exception
  `javax.management.RuntimeOperationsException` - if an IllegalArgumentException occurs

Method Detail

### getGroups

    public java.lang.String[] getGroups()

  Return the MBean Names of all groups defined in this database.

### getRoles

    public java.lang.String[] getRoles()

  Return the MBean Names of all roles defined in this database.

### getUsers

    public java.lang.String[] getUsers()

  Return the MBean Names of all users defined in this database.

### createGroup

    public java.lang.String createGroup(java.lang.String groupname,
                                        java.lang.String description)

  Create a new Group and return the corresponding MBean Name.

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

### createRole

    public java.lang.String createRole(java.lang.String rolename,
                                       java.lang.String description)

  Create a new Role and return the corresponding MBean Name.

  Parameters:
    `rolename` - Group name of the new group
    `description` - Description of the new group

### createUser

    public java.lang.String createUser(java.lang.String username,
                                       java.lang.String password,
                                       java.lang.String fullName)

  Create a new User and return the corresponding MBean Name.

  Parameters:
    `username` - User name of the new user
    `password` - Password for the new user
    `fullName` - Full name for the new user

### findGroup

    public java.lang.String findGroup(java.lang.String groupname)

  Return the MBean Name for the specified group name (if any); otherwise return `null`.

  Parameters:
    `groupname` - Group name to look up

### findRole

    public java.lang.String findRole(java.lang.String rolename)

  Return the MBean Name for the specified role name (if any); otherwise return `null`.

  Parameters:
    `rolename` - Role name to look up

### findUser

    public java.lang.String findUser(java.lang.String username)

  Return the MBean Name for the specified user name (if any); otherwise return `null`.

  Parameters:
    `username` - User name to look up

### removeGroup

    public void removeGroup(java.lang.String groupname)

  Remove an existing group and destroy the corresponding MBean.

  Parameters:
    `groupname` - Group name to remove

### removeRole

    public void removeRole(java.lang.String rolename)

  Remove an existing role and destroy the corresponding MBean.

  Parameters:
    `rolename` - Role name to remove

### removeUser

    public void removeUser(java.lang.String username)

  Remove an existing user and destroy the corresponding MBean.

  Parameters:
    `username` - User name to remove

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