public class UserAdmin extends 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(String key,
byte[] value,
String username)
Add credentials to a user, associated with the supplied key
|
void |
addCredentialString(String key,
String value,
String username)
Add credentials to a user, associated with the supplied key
|
boolean |
addMember(String groupname,
String rolename)
Add a member to the group.
|
void |
addProperty(String key,
byte[] value,
String rolename)
Add or update a property on a role.
|
void |
addPropertyString(String key,
String value,
String rolename)
Add or update a property on a role
|
boolean |
addRequiredMember(String groupname,
String rolename)
Add a required member to the group
|
void |
createGroup(String name)
Create a Group
|
void |
createRole(String name)
This method was specified in error and must not be used.
|
void |
createUser(String name)
Create a User
|
CompositeData |
getAuthorization(String username)
Answer the authorization for the user name.
|
TabularData |
getCredentials(String username)
Answer the credentials associated with a user.
|
CompositeData |
getGroup(String groupname)
Answer the Group associated with the group name.
|
String[] |
getGroups(String filter)
Answer the list of group names
|
String[] |
getImpliedRoles(String username)
Answer the list of implied roles for a user
|
String[] |
getMembers(String groupname)
Answer the the user names which are members of the group
|
TabularData |
getProperties(String rolename)
Answer the properties associated with a role.
|
String[] |
getRequiredMembers(String groupname)
Answer the list of user names which are required members of this group
|
CompositeData |
getRole(String name)
Answer the role associated with a name.
|
String[] |
getRoles(String filter)
Answer the list of role names which match the supplied filter
|
CompositeData |
getUser(String username)
Answer the User associated with the user name.
|
String[] |
getUsers(String filter)
Answer the list of user names in the User Admin database
|
String |
getUserWithProperty(String key,
String value)
Answer the user name with the given property key-value pair from the User
Admin service database.
|
String[] |
listGroups()
Answer the list of group names
|
String[] |
listRoles()
Answer the list of role names in the User Admin database
|
String[] |
listUsers()
Answer the list of user names in the User Admin database
|
void |
removeCredential(String key,
String username)
Remove the credential associated with the given user
|
boolean |
removeGroup(String name)
Remove the Group associated with the name
|
boolean |
removeMember(String groupname,
String rolename)
Remove a role from the group
|
void |
removeProperty(String key,
String rolename)
Remove a property from a role
|
boolean |
removeRole(String name)
Remove the Role associated with the name
|
boolean |
removeUser(String name)
Remove the User associated with the name
|
public UserAdmin(org.osgi.service.useradmin.UserAdmin userAdmin)
userAdmin - UserAdmin service reference.public void addCredential(String key, byte[] value, String username) throws 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.IOException - if the operation failsUserAdminMBean.addCredential(java.lang.String, byte[], java.lang.String)public void addCredentialString(String key, String value, String username) throws 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.IOException - if the operation failsUserAdminMBean.addCredentialString(String, String, String)public boolean addMember(String groupname, String rolename) throws 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 groupIOException - if the operation failsUserAdminMBean.addMember(java.lang.String, java.lang.String)public void addPropertyString(String key, String value, String rolename) throws IOException
UserAdminMBeanaddPropertyString in interface UserAdminMBeankey - The key of the property to addvalue - The value of the property to add (String)rolename - The role nameIOException - if the operation failsUserAdminMBean.addPropertyString(String, String, String)public void addProperty(String key, byte[] value, String rolename) throws IOException
UserAdminMBeanaddProperty in interface UserAdminMBeankey - The added property keyvalue - The added byte[] property valuerolename - The role name that receives the propertyIOException - if the operation failsUserAdminMBean.addProperty(java.lang.String, byte[], java.lang.String)public boolean addRequiredMember(String groupname, String rolename) throws IOException
UserAdminMBeanaddRequiredMember in interface UserAdminMBeangroupname - The group name that is adddedrolename - The role thatIOException - if the operation failsUserAdminMBean.addRequiredMember(java.lang.String, java.lang.String)public void createGroup(String name) throws IOException
UserAdminMBeancreateGroup in interface UserAdminMBeanname - Name of the group to createIOException - if the operation failsUserAdminMBean.createGroup(java.lang.String)public void createRole(String name) throws IOException
UserAdminMBeancreateRole in interface UserAdminMBeanname - Ignored.IOException - This method will throw an exception if called.UserAdminMBean.createRole(java.lang.String)public void createUser(String name) throws IOException
UserAdminMBeancreateUser in interface UserAdminMBeanname - Name of the user to createIOException - if the operation failsUserAdminMBean.createUser(java.lang.String)public CompositeData getAuthorization(String username) throws IOException
UserAdminMBeanUserAdminMBean.AUTORIZATION_TYPE.getAuthorization in interface UserAdminMBeanusername - The user nameUserAdminMBean.AUTORIZATION_TYPE.IOException - if the operation failsUserAdminMBean.getAuthorization(java.lang.String)public TabularData getCredentials(String username) throws IOException
UserAdminMBeanJmxConstants.PROPERTIES_TYPE.getCredentials in interface UserAdminMBeanusername - The user nameJmxConstants.PROPERTIES_TYPEIOException - if the operation failsUserAdminMBean.getCredentials(java.lang.String)public CompositeData getGroup(String groupname) throws IOException
UserAdminMBeanUserAdminMBean.GROUP_TYPEgetGroup in interface UserAdminMBeangroupname - The group nameUserAdminMBean.GROUP_TYPEIOException - if the operation failsUserAdminMBean.getGroup(java.lang.String)public String[] getGroups(String filter) throws IOException
UserAdminMBeangetGroups in interface UserAdminMBeanfilter - The filter to applyIOException - if the operation failsUserAdminMBean.getGroups(java.lang.String)public String[] getImpliedRoles(String username) throws IOException
UserAdminMBeangetImpliedRoles in interface UserAdminMBeanusername - The name of the user that has the implied rolesIOException - if the operation failsUserAdminMBean.getImpliedRoles(java.lang.String)public String[] getMembers(String groupname) throws IOException
UserAdminMBeangetMembers in interface UserAdminMBeangroupname - The name of the group to get the members fromIOException - if the operation failsUserAdminMBean.getMembers(java.lang.String)public TabularData getProperties(String rolename) throws IOException
UserAdminMBeanJmxConstants.PROPERTIES_TYPE.getProperties in interface UserAdminMBeanrolename - The name of the role to get properties fromJmxConstants.PROPERTIES_TYPEIOException - if the operation failsUserAdminMBean.getProperties(java.lang.String)public String[] getRequiredMembers(String groupname) throws IOException
UserAdminMBeangetRequiredMembers in interface UserAdminMBeangroupname - The name of the group to get the required members fromIOException - if the operation failsUserAdminMBean.getRequiredMembers(java.lang.String)public CompositeData getRole(String name) throws IOException
UserAdminMBeanUserAdminMBean.ROLE_TYPE.getRole in interface UserAdminMBeanname - The name of the role to get the data fromUserAdminMBean.ROLE_TYPEIOException - if the operation failsUserAdminMBean.getRole(java.lang.String)public String[] getRoles(String filter) throws 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.IOException - if the operation failsUserAdminMBean.getRoles(java.lang.String)public CompositeData getUser(String username) throws IOException
UserAdminMBeanUserAdminMBean.USER_TYPE.getUser in interface UserAdminMBeanusername - The name of the requested userUserAdminMBean.USER_TYPEIOException - if the operation failsUserAdminMBean.getUser(java.lang.String)public String getUserWithProperty(String key, String value) throws IOException
UserAdminMBeangetUserWithProperty in interface UserAdminMBeankey - The key to comparevalue - The value to compareIOException - if the operation failsUserAdminMBean.getUserWithProperty(String, String)public String[] getUsers(String filter) throws IOException
UserAdminMBeangetUsers in interface UserAdminMBeanfilter - The filter to applyIOException - if the operation failsUserAdminMBean.getUsers(java.lang.String)public String[] listGroups() throws IOException
UserAdminMBeanlistGroups in interface UserAdminMBeanIOException - if the operation failsUserAdminMBean.listGroups()public String[] listRoles() throws IOException
UserAdminMBeanlistRoles in interface UserAdminMBeanIOException - if the operation failsUserAdminMBean.listRoles()public String[] listUsers() throws IOException
UserAdminMBeanlistUsers in interface UserAdminMBeanIOException - if the operation failsUserAdminMBean.listUsers()public void removeCredential(String key, String username) throws IOException
UserAdminMBeanremoveCredential in interface UserAdminMBeankey - The key of the credential to removeusername - The name of the user for which the credential must be
removedIOException - if the operation failsUserAdminMBean.removeCredential(java.lang.String, java.lang.String)public boolean removeGroup(String name) throws IOException
UserAdminMBeanremoveGroup in interface UserAdminMBeanIOException - if the operation failsUserAdminMBean.removeGroup(java.lang.String)public boolean removeMember(String groupname, String rolename) throws IOException
UserAdminMBeanremoveMember in interface UserAdminMBeangroupname - The group nameIOException - if the operation failsUserAdminMBean.removeMember(java.lang.String, java.lang.String)public void removeProperty(String key, String rolename) throws IOException
UserAdminMBeanremoveProperty in interface UserAdminMBeanIOException - if the operation failsUserAdminMBean.removeProperty(java.lang.String, java.lang.String)public boolean removeRole(String name) throws IOException
UserAdminMBeanremoveRole in interface UserAdminMBeanIOException - if the operation failsUserAdminMBean.removeRole(java.lang.String)public boolean removeUser(String name) throws IOException
UserAdminMBeanremoveUser in interface UserAdminMBeanIOException - if the operation failsUserAdminMBean.removeUser(java.lang.String)Copyright © 2009-2015 The Apache Software Foundation. All Rights Reserved.