Top Description Fields Constructors Methods
org.apache.catalina.mbeans

public Class SparseUserDatabaseMBean

extends BaseModelMBean
Class Inheritance
Known Direct Subclasses
org.apache.catalina.mbeans.MemoryUserDatabaseMBean
Imports
java.util.ArrayList, .Iterator, .List, .Set, javax.management.MBeanServer, .ObjectName, org.apache.catalina.Group, .Role, .User, .UserDatabase, org.apache.tomcat.util.modeler.BaseModelMBean, .ManagedBean, .Registry, org.apache.tomcat.util.res.StringManager

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 TypeField and Description
protected final ManagedBean
managed

The ManagedBean information describing this MBean.

protected final ManagedBean
managedGroup

The ManagedBean information describing Group MBeans.

protected final ManagedBean
managedRole

The ManagedBean information describing Group MBeans.

protected final ManagedBean
managedUser

The ManagedBean information describing User MBeans.

protected final MBeanServer
mserver

The MBeanServer for this application.

protected final Registry
registry

The configuration information registry for our managed beans.

private static final StringManager
Inherited from org.apache.tomcat.util.modeler.BaseModelMBean:
attributeBroadcastergeneralBroadcastermanagedBeanonameresourceresourceType

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the new group object name
createGroup
(String
Group name of the new group
groupname
,
String
Description of the new group
description
)

Create a new Group and return the corresponding MBean Name.

public String

Returns:

the new role object name
createRole
(String
Group name of the new group
rolename
,
String
Description of the new group
description
)

Create a new Role and return the corresponding MBean Name.

public String

Returns:

the new user object name
createUser
(String
User name of the new user
username
,
String
Password for the new user
password
,
String
Full name for the new user
fullName
)

Create a new User and return the corresponding MBean Name.

public String

Returns:

the group object name
findGroup
(String
Group name to look up
groupname
)

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

public String

Returns:

the role object name
findRole
(String
Role name to look up
rolename
)

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

public String

Returns:

the user object name
findUser
(String
User name to look up
username
)

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

public String[]

Returns:

the MBean Names of all groups defined in this database.
getGroups
()

public String[]

Returns:

the MBean Names of all roles defined in this database.
getRoles
()

public String[]

Returns:

the MBean Names of all users defined in this database.
getUsers
()

public void
removeGroup(String
Group name to remove
groupname
)

Remove an existing group and destroy the corresponding MBean.

public void
removeRole(String
Role name to remove
rolename
)

Remove an existing role and destroy the corresponding MBean.

public void
removeUser(String
User name to remove
username
)

Remove an existing user and destroy the corresponding MBean.

public void
save()

Call actual save and unregister all obsolete beans.

Inherited from org.apache.tomcat.util.modeler.BaseModelMBean:
addAttributeChangeNotificationListeneraddNotificationListenergetAttributegetAttributesgetClassNamegetJmxNamegetManagedResourcegetMBeanInfogetModelerTypegetNotificationInfogetObjectNameinvokepostDeregisterpostRegisterpreDeregisterpreRegisterremoveAttributeChangeNotificationListenerremoveNotificationListenersendAttributeChangeNotificationsendAttributeChangeNotificationsendNotificationsendNotificationsetAttributesetAttributessetManagedBeansetManagedResourcetoString

Field Detail

managedback to summary
protected final ManagedBean managed

The ManagedBean information describing this MBean.

managedGroupback to summary
protected final ManagedBean managedGroup

The ManagedBean information describing Group MBeans.

managedRoleback to summary
protected final ManagedBean managedRole

The ManagedBean information describing Group MBeans.

managedUserback to summary
protected final ManagedBean managedUser

The ManagedBean information describing User MBeans.

mserverback to summary
protected final MBeanServer mserver

The MBeanServer for this application.

registryback to summary
protected final Registry registry

The configuration information registry for our managed beans.

smback to summary
private static final StringManager sm

Hides org.apache.tomcat.util.modeler.BaseModelMBean.sm.

Constructor Detail

SparseUserDatabaseMBeanback to summary
public SparseUserDatabaseMBean()

Method Detail

createGroupback to summary
public String createGroup(String groupname, String description)

Create a new Group and return the corresponding MBean Name.

Parameters
groupname:String

Group name of the new group

description:String

Description of the new group

Returns:String

the new group object name

createRoleback to summary
public String createRole(String rolename, String description)

Create a new Role and return the corresponding MBean Name.

Parameters
rolename:String

Group name of the new group

description:String

Description of the new group

Returns:String

the new role object name

createUserback to summary
public String createUser(String username, String password, String fullName)

Create a new User and return the corresponding MBean Name.

Parameters
username:String

User name of the new user

password:String

Password for the new user

fullName:String

Full name for the new user

Returns:String

the new user object name

findGroupback to summary
public String findGroup(String groupname)

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

Parameters
groupname:String

Group name to look up

Returns:String

the group object name

findRoleback to summary
public String findRole(String rolename)

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

Parameters
rolename:String

Role name to look up

Returns:String

the role object name

findUserback to summary
public String findUser(String username)

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

Parameters
username:String

User name to look up

Returns:String

the user object name

getGroupsback to summary
public String[] getGroups()
Returns:String[]

the MBean Names of all groups defined in this database.

getRolesback to summary
public String[] getRoles()
Returns:String[]

the MBean Names of all roles defined in this database.

getUsersback to summary
public String[] getUsers()
Returns:String[]

the MBean Names of all users defined in this database.

removeGroupback to summary
public void removeGroup(String groupname)

Remove an existing group and destroy the corresponding MBean.

Parameters
groupname:String

Group name to remove

removeRoleback to summary
public void removeRole(String rolename)

Remove an existing role and destroy the corresponding MBean.

Parameters
rolename:String

Role name to remove

removeUserback to summary
public void removeUser(String username)

Remove an existing user and destroy the corresponding MBean.

Parameters
username:String

User name to remove

saveback to summary
public void save()

Call actual save and unregister all obsolete beans.