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
Modifier and TypeFieldDescriptionprotected final ManagedBean
TheManagedBean
information describing this MBean.protected final ManagedBean
TheManagedBean
information describing Group MBeans.protected final ManagedBean
TheManagedBean
information describing Group MBeans.protected final ManagedBean
TheManagedBean
information describing User MBeans.protected final MBeanServer
TheMBeanServer
for this application.protected final 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
-
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()
void
removeGroup
(String groupname) Remove an existing group and destroy the corresponding MBean.void
removeRole
(String rolename) Remove an existing role and destroy the corresponding MBean.void
removeUser
(String username) Remove an existing user and destroy the corresponding MBean.void
save()
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
TheMBeanServer
for this application. -
managed
TheManagedBean
information describing this MBean. -
managedGroup
TheManagedBean
information describing Group MBeans. -
managedRole
TheManagedBean
information describing Group MBeans. -
managedUser
TheManagedBean
information 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
Create a new Group and return the corresponding MBean Name.- Parameters:
groupname
- Group name of the new groupdescription
- Description of the new group- Returns:
- the new group object name
-
createRole
Create a new Role and return the corresponding MBean Name.- Parameters:
rolename
- Group name of the new groupdescription
- Description of the new group- Returns:
- the new role object name
-
createUser
Create a new User and return the corresponding MBean Name.- Parameters:
username
- User name of the new userpassword
- Password for the new userfullName
- Full name for the new user- Returns:
- the new user object name
-
findGroup
Return the MBean Name for the specified group name (if any); otherwise returnnull
.- Parameters:
groupname
- Group name to look up- Returns:
- the group object name
-
findRole
Return the MBean Name for the specified role name (if any); otherwise returnnull
.- Parameters:
rolename
- Role name to look up- Returns:
- the role object name
-
findUser
Return the MBean Name for the specified user name (if any); otherwise returnnull
.- Parameters:
username
- User name to look up- Returns:
- the user object name
-
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.
-