Package org.apache.catalina.mbeans
Class SparseUserDatabaseMBean
java.lang.Object
org.apache.tomcat.util.modeler.BaseModelMBean
org.apache.catalina.mbeans.SparseUserDatabaseMBean
- All Implemented Interfaces:
- DynamicMBean,- MBeanRegistration,- ModelMBeanNotificationBroadcaster,- NotificationBroadcaster
- Direct Known Subclasses:
- MemoryUserDatabaseMBean
 A ModelMBean implementation for the org.apache.catalina.users.SparseUserDatabase
 component. The main difference is that the MBeans are created on demand (for example, the findUser method would
 register the corresponding user and make it available for management. All the MBeans created for users, groups and
 roles are then discarded when save is invoked.
 
- Author:
- Craig R. McClanahan
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final ManagedBeanTheManagedBeaninformation describing this MBean.protected final ManagedBeanTheManagedBeaninformation describing Group MBeans.protected final ManagedBeanTheManagedBeaninformation describing Group MBeans.protected final ManagedBeanTheManagedBeaninformation describing User MBeans.protected final MBeanServerTheMBeanServerfor this application.protected final RegistryThe configuration information registry for our managed beans.Fields inherited from class org.apache.tomcat.util.modeler.BaseModelMBeanattributeBroadcaster, generalBroadcaster, managedBean, oname, resource, resourceType
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncreateGroup(String groupname, String description) Create a new Group and return the corresponding MBean Name.createRole(String rolename, String description) Create a new Role and return the corresponding MBean Name.createUser(String username, String password, String fullName) Create a new User and return the corresponding MBean Name.Return the MBean Name for the specified group name (if any); otherwise returnnull.Return the MBean Name for the specified role name (if any); otherwise returnnull.Return the MBean Name for the specified user name (if any); otherwise returnnull.String[]String[]getRoles()String[]getUsers()voidremoveGroup(String groupname) Remove an existing group and destroy the corresponding MBean.voidremoveRole(String rolename) Remove an existing role and destroy the corresponding MBean.voidremoveUser(String username) Remove an existing user and destroy the corresponding MBean.voidsave()Call actual save and unregister all obsolete beans.Methods inherited from class org.apache.tomcat.util.modeler.BaseModelMBeanaddAttributeChangeNotificationListener, 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
- 
Field Details- 
registryThe configuration information registry for our managed beans.
- 
mserverTheMBeanServerfor this application.
- 
managedTheManagedBeaninformation describing this MBean.
- 
managedGroupTheManagedBeaninformation describing Group MBeans.
- 
managedRoleTheManagedBeaninformation describing Group MBeans.
- 
managedUserTheManagedBeaninformation describing User MBeans.
 
- 
- 
Constructor Details- 
SparseUserDatabaseMBeanpublic SparseUserDatabaseMBean()
 
- 
- 
Method Details- 
getGroups- Returns:
- the MBean Names of all groups defined in this database.
 
- 
getRoles- Returns:
- the MBean Names of all roles defined in this database.
 
- 
getUsers- Returns:
- the MBean Names of all users defined in this database.
 
- 
createGroupCreate a new Group and return the corresponding MBean Name.- Parameters:
- groupname- Group name of the new group
- description- Description of the new group
- Returns:
- the new group object name
 
- 
createRoleCreate a new Role and return the corresponding MBean Name.- Parameters:
- rolename- Group name of the new group
- description- Description of the new group
- Returns:
- the new role object name
 
- 
createUserCreate 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
- Returns:
- the new user object name
 
- 
findGroupReturn the MBean Name for the specified group name (if any); otherwise returnnull.- Parameters:
- groupname- Group name to look up
- Returns:
- the group object name
 
- 
findRoleReturn the MBean Name for the specified role name (if any); otherwise returnnull.- Parameters:
- rolename- Role name to look up
- Returns:
- the role object name
 
- 
findUserReturn the MBean Name for the specified user name (if any); otherwise returnnull.- Parameters:
- username- User name to look up
- Returns:
- the user object name
 
- 
removeGroupRemove an existing group and destroy the corresponding MBean.- Parameters:
- groupname- Group name to remove
 
- 
removeRoleRemove an existing role and destroy the corresponding MBean.- Parameters:
- rolename- Role name to remove
 
- 
removeUserRemove an existing user and destroy the corresponding MBean.- Parameters:
- username- User name to remove
 
- 
savepublic void save()Call actual save and unregister all obsolete beans.
 
-