public class UserAdmin extends java.lang.Object implements UserAdminMBean
UserAdmin represents UserAdminMBean implementation.
UserAdminMBeanAUTORIZATION_TYPE, CREDENTIALS, CREDENTIALS_ITEM, GROUP_TYPE, MEMBERS, MEMBERS_ITEM, NAME, NAME_ITEM, OBJECTNAME, PROPERTIES, PROPERTIES_ITEM, REQUIRED_MEMBERS, REQUIRED_MEMBERS_ITEM, ROLE_TYPE, ROLES, ROLES_ITEM, TYPE, TYPE_ITEM, USER_TYPE| Constructor and Description |
|---|
UserAdmin(org.osgi.service.useradmin.UserAdmin userAdmin)
Constructs new UserAdmin MBean.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCredential(java.lang.String key,
byte[] value,
java.lang.String username)
Add credentials to a user, associated with the supplied key
|
void |
addCredentialString(java.lang.String key,
java.lang.String value,
java.lang.String username)
Add credentials to a user, associated with the supplied key
|
boolean |
addMember(java.lang.String groupname,
java.lang.String rolename)
Add a member to the group.
|
void |
addProperty(java.lang.String key,
byte[] value,
java.lang.String rolename)
Add or update a property on a role.
|
void |
addPropertyString(java.lang.String key,
java.lang.String value,
java.lang.String rolename)
Add or update a property on a role
|
boolean |
addRequiredMember(java.lang.String groupname,
java.lang.String rolename)
Add a required member to the group
|
void |
createGroup(java.lang.String name)
Create a Group
|
void |
createRole(java.lang.String name)
This method was specified in error and must not be used.
|
void |
createUser(java.lang.String name)
Create a User
|
javax.management.openmbean.CompositeData |
getAuthorization(java.lang.String username)
Answer the authorization for the user name.
|
javax.management.openmbean.TabularData |
getCredentials(java.lang.String username)
Answer the credentials associated with a user.
|
javax.management.openmbean.CompositeData |
getGroup(java.lang.String groupname)
Answer the Group associated with the group name.
|
java.lang.String[] |
getGroups(java.lang.String filter)
Answer the list of group names
|
java.lang.String[] |
getImpliedRoles(java.lang.String username)
Answer the list of implied roles for a user
|
java.lang.String[] |
getMembers(java.lang.String groupname)
Answer the the user names which are members of the group
|
javax.management.openmbean.TabularData |
getProperties(java.lang.String rolename)
Answer the properties associated with a role.
|
java.lang.String[] |
getRequiredMembers(java.lang.String groupname)
Answer the list of user names which are required members of this group
|
javax.management.openmbean.CompositeData |
getRole(java.lang.String name)
Answer the role associated with a name.
|
java.lang.String[] |
getRoles(java.lang.String filter)
Answer the list of role names which match the supplied filter
|
javax.management.openmbean.CompositeData |
getUser(java.lang.String username)
Answer the User associated with the user name.
|
java.lang.String[] |
getUsers(java.lang.String filter)
Answer the list of user names in the User Admin database
|
java.lang.String |
getUserWithProperty(java.lang.String key,
java.lang.String value)
Answer the user name with the given property key-value pair from the User
Admin service database.
|
java.lang.String[] |
listGroups()
Answer the list of group names
|
java.lang.String[] |
listRoles()
Answer the list of role names in the User Admin database
|
java.lang.String[] |
listUsers()
Answer the list of user names in the User Admin database
|
void |
removeCredential(java.lang.String key,
java.lang.String username)
Remove the credential associated with the given user
|
boolean |
removeGroup(java.lang.String name)
Remove the Group associated with the name
|
boolean |
removeMember(java.lang.String groupname,
java.lang.String rolename)
Remove a role from the group
|
void |
removeProperty(java.lang.String key,
java.lang.String rolename)
Remove a property from a role
|
boolean |
removeRole(java.lang.String name)
Remove the Role associated with the name
|
boolean |
removeUser(java.lang.String name)
Remove the User associated with the name
|
public UserAdmin(org.osgi.service.useradmin.UserAdmin userAdmin)
userAdmin - UserAdmin service reference.public void addCredential(java.lang.String key,
byte[] value,
java.lang.String username)
throws java.io.IOException
UserAdminMBeanaddCredential in interface UserAdminMBeankey - The key of the credential to addvalue - The value of the credential to addusername - The name of the user that gets the credential.java.io.IOException - if the operation failsUserAdminMBean.addCredential(java.lang.String, byte[], java.lang.String)public void addCredentialString(java.lang.String key,
java.lang.String value,
java.lang.String username)
throws java.io.IOException
UserAdminMBeanaddCredentialString in interface UserAdminMBeankey - The key of the credential to addvalue - The value of the credential to addusername - The name of the user that gets the credential.java.io.IOException - if the operation failsUserAdminMBean.addCredentialString(String, String, String)public boolean addMember(java.lang.String groupname,
java.lang.String rolename)
throws java.io.IOException
UserAdminMBeanaddMember in interface UserAdminMBeangroupname - The group name that receives the rolename as
member.rolename - The rolename (User or Group) that must be added.true if the role was added to the groupjava.io.IOException - if the operation failsUserAdminMBean.addMember(java.lang.String, java.lang.String)public void addPropertyString(java.lang.String key,
java.lang.String value,
java.lang.String rolename)
throws java.io.IOException
UserAdminMBeanaddPropertyString in interface UserAdminMBeankey - The key of the property to addvalue - The value of the property to add (String)rolename - The role namejava.io.IOException - if the operation failsUserAdminMBean.addPropertyString(String, String, String)public void addProperty(java.lang.String key,
byte[] value,
java.lang.String rolename)
throws java.io.IOException
UserAdminMBeanaddProperty in interface UserAdminMBeankey - The added property keyvalue - The added byte[] property valuerolename - The role name that receives the propertyjava.io.IOException - if the operation failsUserAdminMBean.addProperty(java.lang.String, byte[], java.lang.String)public boolean addRequiredMember(java.lang.String groupname,
java.lang.String rolename)
throws java.io.IOException
UserAdminMBeanaddRequiredMember in interface UserAdminMBeangroupname - The group name that is adddedrolename - The role thatjava.io.IOException - if the operation failsUserAdminMBean.addRequiredMember(java.lang.String, java.lang.String)public void createGroup(java.lang.String name)
throws java.io.IOException
UserAdminMBeancreateGroup in interface UserAdminMBeanname - Name of the group to createjava.io.IOException - if the operation failsUserAdminMBean.createGroup(java.lang.String)public void createRole(java.lang.String name)
throws java.io.IOException
UserAdminMBeancreateRole in interface UserAdminMBeanname - Ignored.java.io.IOException - This method will throw an exception if called.UserAdminMBean.createRole(java.lang.String)public void createUser(java.lang.String name)
throws java.io.IOException
UserAdminMBeancreateUser in interface UserAdminMBeanname - Name of the user to createjava.io.IOException - if the operation failsUserAdminMBean.createUser(java.lang.String)public javax.management.openmbean.CompositeData getAuthorization(java.lang.String username)
throws java.io.IOException
UserAdminMBeanUserAdminMBean.AUTORIZATION_TYPE.getAuthorization in interface UserAdminMBeanusername - The user nameUserAdminMBean.AUTORIZATION_TYPE.java.io.IOException - if the operation failsUserAdminMBean.getAuthorization(java.lang.String)public javax.management.openmbean.TabularData getCredentials(java.lang.String username)
throws java.io.IOException
UserAdminMBeanJmxConstants.PROPERTIES_TYPE.getCredentials in interface UserAdminMBeanusername - The user nameJmxConstants.PROPERTIES_TYPEjava.io.IOException - if the operation failsUserAdminMBean.getCredentials(java.lang.String)public javax.management.openmbean.CompositeData getGroup(java.lang.String groupname)
throws java.io.IOException
UserAdminMBeanUserAdminMBean.GROUP_TYPEgetGroup in interface UserAdminMBeangroupname - The group nameUserAdminMBean.GROUP_TYPEjava.io.IOException - if the operation failsUserAdminMBean.getGroup(java.lang.String)public java.lang.String[] getGroups(java.lang.String filter)
throws java.io.IOException
UserAdminMBeangetGroups in interface UserAdminMBeanfilter - The filter to applyjava.io.IOException - if the operation failsUserAdminMBean.getGroups(java.lang.String)public java.lang.String[] getImpliedRoles(java.lang.String username)
throws java.io.IOException
UserAdminMBeangetImpliedRoles in interface UserAdminMBeanusername - The name of the user that has the implied rolesjava.io.IOException - if the operation failsUserAdminMBean.getImpliedRoles(java.lang.String)public java.lang.String[] getMembers(java.lang.String groupname)
throws java.io.IOException
UserAdminMBeangetMembers in interface UserAdminMBeangroupname - The name of the group to get the members fromjava.io.IOException - if the operation failsUserAdminMBean.getMembers(java.lang.String)public javax.management.openmbean.TabularData getProperties(java.lang.String rolename)
throws java.io.IOException
UserAdminMBeanJmxConstants.PROPERTIES_TYPE.getProperties in interface UserAdminMBeanrolename - The name of the role to get properties fromJmxConstants.PROPERTIES_TYPEjava.io.IOException - if the operation failsUserAdminMBean.getProperties(java.lang.String)public java.lang.String[] getRequiredMembers(java.lang.String groupname)
throws java.io.IOException
UserAdminMBeangetRequiredMembers in interface UserAdminMBeangroupname - The name of the group to get the required members fromjava.io.IOException - if the operation failsUserAdminMBean.getRequiredMembers(java.lang.String)public javax.management.openmbean.CompositeData getRole(java.lang.String name)
throws java.io.IOException
UserAdminMBeanUserAdminMBean.ROLE_TYPE.getRole in interface UserAdminMBeanname - The name of the role to get the data fromUserAdminMBean.ROLE_TYPEjava.io.IOException - if the operation failsUserAdminMBean.getRole(java.lang.String)public java.lang.String[] getRoles(java.lang.String filter)
throws java.io.IOException
UserAdminMBeangetRoles in interface UserAdminMBeanfilter - The string representation of the
org.osgi.framework.Filter that is used to filter the roles
by applying to the properties, if null all roles are
returned.java.io.IOException - if the operation failsUserAdminMBean.getRoles(java.lang.String)public javax.management.openmbean.CompositeData getUser(java.lang.String username)
throws java.io.IOException
UserAdminMBeanUserAdminMBean.USER_TYPE.getUser in interface UserAdminMBeanusername - The name of the requested userUserAdminMBean.USER_TYPEjava.io.IOException - if the operation failsUserAdminMBean.getUser(java.lang.String)public java.lang.String getUserWithProperty(java.lang.String key,
java.lang.String value)
throws java.io.IOException
UserAdminMBeangetUserWithProperty in interface UserAdminMBeankey - The key to comparevalue - The value to comparejava.io.IOException - if the operation failsUserAdminMBean.getUserWithProperty(String, String)public java.lang.String[] getUsers(java.lang.String filter)
throws java.io.IOException
UserAdminMBeangetUsers in interface UserAdminMBeanfilter - The filter to applyjava.io.IOException - if the operation failsUserAdminMBean.getUsers(java.lang.String)public java.lang.String[] listGroups()
throws java.io.IOException
UserAdminMBeanlistGroups in interface UserAdminMBeanjava.io.IOException - if the operation failsUserAdminMBean.listGroups()public java.lang.String[] listRoles()
throws java.io.IOException
UserAdminMBeanlistRoles in interface UserAdminMBeanjava.io.IOException - if the operation failsUserAdminMBean.listRoles()public java.lang.String[] listUsers()
throws java.io.IOException
UserAdminMBeanlistUsers in interface UserAdminMBeanjava.io.IOException - if the operation failsUserAdminMBean.listUsers()public void removeCredential(java.lang.String key,
java.lang.String username)
throws java.io.IOException
UserAdminMBeanremoveCredential in interface UserAdminMBeankey - The key of the credential to removeusername - The name of the user for which the credential must be
removedjava.io.IOException - if the operation failsUserAdminMBean.removeCredential(java.lang.String, java.lang.String)public boolean removeGroup(java.lang.String name)
throws java.io.IOException
UserAdminMBeanremoveGroup in interface UserAdminMBeanjava.io.IOException - if the operation failsUserAdminMBean.removeGroup(java.lang.String)public boolean removeMember(java.lang.String groupname,
java.lang.String rolename)
throws java.io.IOException
UserAdminMBeanremoveMember in interface UserAdminMBeangroupname - The group namejava.io.IOException - if the operation failsUserAdminMBean.removeMember(java.lang.String, java.lang.String)public void removeProperty(java.lang.String key,
java.lang.String rolename)
throws java.io.IOException
UserAdminMBeanremoveProperty in interface UserAdminMBeanjava.io.IOException - if the operation failsUserAdminMBean.removeProperty(java.lang.String, java.lang.String)public boolean removeRole(java.lang.String name)
throws java.io.IOException
UserAdminMBeanremoveRole in interface UserAdminMBeanjava.io.IOException - if the operation failsUserAdminMBean.removeRole(java.lang.String)public boolean removeUser(java.lang.String name)
throws java.io.IOException
UserAdminMBeanremoveUser in interface UserAdminMBeanjava.io.IOException - if the operation failsUserAdminMBean.removeUser(java.lang.String)Copyright © 2009-2019 The Apache Software Foundation. All Rights Reserved.