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 Summary
FieldsModifier 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.BaseModelMBean
attributeBroadcaster, generalBroadcaster, managedBean, oname, resource, resourceType -
Constructor Summary
Constructors -
Method Summary
Modifier 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.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
-
Field Details
-
registry
The configuration information registry for our managed beans. -
mserver
TheMBeanServerfor this application. -
managed
TheManagedBeaninformation describing this MBean. -
managedGroup
TheManagedBeaninformation describing Group MBeans. -
managedRole
TheManagedBeaninformation describing Group MBeans. -
managedUser
TheManagedBeaninformation describing User MBeans.
-
-
Constructor Details
-
SparseUserDatabaseMBean
public 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.
-
createGroup
-
createRole
-
createUser
-
findGroup
-
findRole
-
findUser
-
removeGroup
Remove an existing group and destroy the corresponding MBean.- Parameters:
groupname- Group name to remove
-
removeRole
Remove an existing role and destroy the corresponding MBean.- Parameters:
rolename- Role name to remove
-
removeUser
Remove an existing user and destroy the corresponding MBean.- Parameters:
username- User name to remove
-
save
public void save()Call actual save and unregister all obsolete beans.
-