Package org.osgi.jmx.service.useradmin
Interface UserAdminMBean
-
public interface UserAdminMBeanThis MBean provides the management interface to the OSGi User Manager Service
-
-
Field Summary
Fields Modifier and Type Field Description static CompositeTypeAUTORIZATION_TYPEThe Composite Type for an Authorization object.static StringCREDENTIALSThe CREDENTIALS key, used inCREDENTIALS_ITEM.static ItemCREDENTIALS_ITEMThe item containing the credentials of a user.static CompositeTypeGROUP_TYPEThe Composite Type for a Group.static StringMEMBERSThe MEMBERS key, used inMEMBERS_ITEM.static ItemMEMBERS_ITEMThe item containing the members of a group.static StringNAMEThe key NAME, used inNAME_ITEM.static ItemNAME_ITEMThe item for the user name for an authorization object.static StringOBJECTNAMEUser Admin MBean object name.static StringPROPERTIESThe PROPERTIES key, used inPROPERTIES_ITEM.static ItemPROPERTIES_ITEMThe item containing the properties of a Role.static StringREQUIRED_MEMBERSThe REQUIRED_MEMBERS key, used inREQUIRED_MEMBERS_ITEM.static ItemREQUIRED_MEMBERS_ITEMThe item containing the required members of a group.static CompositeTypeROLE_TYPEThe Composite Type for a Role.static StringROLESThe key ROLES, used inROLES_ITEM.static ItemROLES_ITEMThe item containing the roles for this authorization object.static StringTYPEThe Role TYPE key, used inTYPE_ITEM.static ItemTYPE_ITEMThe item containing the type of the roles encapsulated by this authorization object.static CompositeTypeUSER_TYPEA Composite Type for a User.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddCredential(String key, byte[] value, String username)Add credentials to a user, associated with the supplied keyvoidaddCredentialString(String key, String value, String username)Add credentials to a user, associated with the supplied keybooleanaddMember(String groupname, String rolename)Add a member to the group.voidaddProperty(String key, byte[] value, String rolename)Add or update a property on a role.voidaddPropertyString(String key, String value, String rolename)Add or update a property on a rolebooleanaddRequiredMember(String groupname, String rolename)Add a required member to the groupvoidcreateGroup(String name)Create a GroupvoidcreateRole(String name)Deprecated.This method was specified in error.voidcreateUser(String name)Create a UserCompositeDatagetAuthorization(String user)Answer the authorization for the user name.TabularDatagetCredentials(String username)Answer the credentials associated with a user.CompositeDatagetGroup(String groupname)Answer the Group associated with the group name.String[]getGroups(String filter)Answer the list of group namesString[]getImpliedRoles(String username)Answer the list of implied roles for a userString[]getMembers(String groupname)Answer the the user names which are members of the groupTabularDatagetProperties(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 groupCompositeDatagetRole(String name)Answer the role associated with a name.String[]getRoles(String filter)Answer the list of role names which match the supplied filterCompositeDatagetUser(String username)Answer the User associated with the user name.String[]getUsers(String filter)Answer the list of user names in the User Admin databaseStringgetUserWithProperty(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 namesString[]listRoles()Answer the list of role names in the User Admin databaseString[]listUsers()Answer the list of user names in the User Admin databasevoidremoveCredential(String key, String username)Remove the credential associated with the given userbooleanremoveGroup(String name)Remove the Group associated with the namebooleanremoveMember(String groupname, String rolename)Remove a role from the groupvoidremoveProperty(String key, String rolename)Remove a property from a rolebooleanremoveRole(String name)Remove the Role associated with the namebooleanremoveUser(String name)Remove the User associated with the name
-
-
-
Field Detail
-
OBJECTNAME
static final String OBJECTNAME
User Admin MBean object name.- See Also:
- Constant Field Values
-
NAME
static final String NAME
The key NAME, used inNAME_ITEM.- See Also:
- Constant Field Values
-
NAME_ITEM
static final Item NAME_ITEM
The item for the user name for an authorization object. The key isNAMEand the type isSimpleType.STRING.
-
ROLES
static final String ROLES
The key ROLES, used inROLES_ITEM.- See Also:
- Constant Field Values
-
ROLES_ITEM
static final Item ROLES_ITEM
The item containing the roles for this authorization object. The key isROLES. and the type isJmxConstants.STRING_ARRAY_TYPE.
-
AUTORIZATION_TYPE
static final CompositeType AUTORIZATION_TYPE
The Composite Type for an Authorization object. It consists of theNAME_ITEMandROLES_ITEMitems.
-
TYPE
static final String TYPE
The Role TYPE key, used inTYPE_ITEM.- See Also:
- Constant Field Values
-
TYPE_ITEM
static final Item TYPE_ITEM
The item containing the type of the roles encapsulated by this authorization object. The key isTYPEand the type isSimpleType.INTEGER.
-
PROPERTIES
static final String PROPERTIES
The PROPERTIES key, used inPROPERTIES_ITEM.- See Also:
- Constant Field Values
-
PROPERTIES_ITEM
static final Item PROPERTIES_ITEM
The item containing the properties of a Role. The key isPROPERTIESand the type isJmxConstants.PROPERTIES_TYPE.
-
ROLE_TYPE
static final CompositeType ROLE_TYPE
The Composite Type for a Role. It contains the following items:
-
CREDENTIALS
static final String CREDENTIALS
The CREDENTIALS key, used inCREDENTIALS_ITEM.- See Also:
- Constant Field Values
-
CREDENTIALS_ITEM
static final Item CREDENTIALS_ITEM
The item containing the credentials of a user. The key isCREDENTIALSand the type isJmxConstants.PROPERTIES_TYPE.
-
USER_TYPE
static final CompositeType USER_TYPE
A Composite Type for a User. A User contains its Role description and adds the credentials. It extendsROLE_TYPEand addsCREDENTIALS_ITEM. This type extends theROLE_TYPE. It adds:
-
MEMBERS
static final String MEMBERS
The MEMBERS key, used inMEMBERS_ITEM.- See Also:
- Constant Field Values
-
MEMBERS_ITEM
static final Item MEMBERS_ITEM
The item containing the members of a group. The key isMEMBERSand the type isJmxConstants.STRING_ARRAY_TYPE. It is used inGROUP_TYPE.
-
REQUIRED_MEMBERS
static final String REQUIRED_MEMBERS
The REQUIRED_MEMBERS key, used inREQUIRED_MEMBERS_ITEM.- See Also:
- Constant Field Values
-
REQUIRED_MEMBERS_ITEM
static final Item REQUIRED_MEMBERS_ITEM
The item containing the required members of a group. The key isREQUIRED_MEMBERSand the type isJmxConstants.STRING_ARRAY_TYPE. It is used inGROUP_TYPE.
-
GROUP_TYPE
static final CompositeType GROUP_TYPE
The Composite Type for a Group. It extendsUSER_TYPEand addsMEMBERS_ITEM, andREQUIRED_MEMBERS_ITEM. This type extends theUSER_TYPE. It adds: If there are no members or required members an empty array is returned in the respective items.
-
-
Method Detail
-
addCredential
void addCredential(String key, byte[] value, String username) throws IOException
Add credentials to a user, associated with the supplied key- Parameters:
key- The key of the credential to addvalue- The value of the credential to addusername- The name of the user that gets the credential.- Throws:
IOException- if the operation failsIllegalArgumentException- if the username is not a User
-
addCredentialString
void addCredentialString(String key, String value, String username) throws IOException
Add credentials to a user, associated with the supplied key- Parameters:
key- The key of the credential to addvalue- The value of the credential to addusername- The name of the user that gets the credential.- Throws:
IOException- if the operation failsIllegalArgumentException- if the username is not a User
-
addMember
boolean addMember(String groupname, String rolename) throws IOException
Add a member to the group.- Parameters:
groupname- The group name that receives therolenameas member.rolename- Therolename(User or Group) that must be added.- Returns:
trueif the role was added to the group- Throws:
IOException- if the operation failsIllegalArgumentException- if an invalid group name or role name is specified
-
addPropertyString
void addPropertyString(String key, String value, String rolename) throws IOException
Add or update a property on a role- Parameters:
key- The key of the property to addvalue- The value of the property to add (String)rolename- The role name- Throws:
IOException- if the operation failsIllegalArgumentException- if an invalid role name is specified
-
addProperty
void addProperty(String key, byte[] value, String rolename) throws IOException
Add or update a property on a role.- Parameters:
key- The added property keyvalue- The added byte[] property valuerolename- The role name that receives the property- Throws:
IOException- if the operation failsIllegalArgumentException- if an invalid role name is specified
-
addRequiredMember
boolean addRequiredMember(String groupname, String rolename) throws IOException
Add a required member to the group- Parameters:
groupname- The group name that is adddedrolename- The role that- Returns:
- true if the role was added to the group
- Throws:
IOException- if the operation failsIllegalArgumentException- if an invalid group name or role name is specified
-
createUser
void createUser(String name) throws IOException
Create a User- Parameters:
name- Name of the user to create- Throws:
IOException- if the operation fails
-
createGroup
void createGroup(String name) throws IOException
Create a Group- Parameters:
name- Name of the group to create- Throws:
IOException- if the operation fails
-
createRole
void createRole(String name) throws IOException
Deprecated.This method was specified in error. It does not function and must not be used. Use eithercreateUser(String)orcreateGroup(String).This method was specified in error and must not be used.- Parameters:
name- Ignored.- Throws:
IOException- This method will throw an exception if called.
-
getAuthorization
CompositeData getAuthorization(String user) throws IOException
Answer the authorization for the user name. The Composite Data is typed byAUTORIZATION_TYPE.- Parameters:
user- The user name- Returns:
- the Authorization typed by
AUTORIZATION_TYPE. - Throws:
IOException- if the operation failsIllegalArgumentException- if the user name is not a User
-
getCredentials
TabularData getCredentials(String username) throws IOException
Answer the credentials associated with a user. The returned Tabular Data is typed byJmxConstants.PROPERTIES_TYPE.- Parameters:
username- The user name- Returns:
- the credentials associated with the user, see
JmxConstants.PROPERTIES_TYPE - Throws:
IOException- if the operation failsIllegalArgumentException- if the user name is not a User
-
getGroup
CompositeData getGroup(String groupname) throws IOException
Answer the Group associated with the group name. The returned Composite Data is typed byGROUP_TYPE- Parameters:
groupname- The group name- Returns:
- the Group, see
GROUP_TYPE - Throws:
IOException- if the operation failsIllegalArgumentException- if the group name is not a Group
-
listGroups
String[] listGroups() throws IOException
Answer the list of group names- Returns:
- The list of group names
- Throws:
IOException- if the operation fails
-
getGroups
String[] getGroups(String filter) throws IOException
Answer the list of group names- Parameters:
filter- The filter to apply- Returns:
- The list of group names
- Throws:
IOException- if the operation fails
-
getImpliedRoles
String[] getImpliedRoles(String username) throws IOException
Answer the list of implied roles for a user- Parameters:
username- The name of the user that has the implied roles- Returns:
- The list of role names
- Throws:
IOException- if the operation failsIllegalArgumentException- if the username is not a User
-
getMembers
String[] getMembers(String groupname) throws IOException
Answer the the user names which are members of the group- Parameters:
groupname- The name of the group to get the members from- Returns:
- The list of user names
- Throws:
IOException- if the operation failsIllegalArgumentException- if the groupname is not a Group
-
getProperties
TabularData getProperties(String rolename) throws IOException
Answer the properties associated with a role. The returned Tabular Data is typed byJmxConstants.PROPERTIES_TYPE.- Parameters:
rolename- The name of the role to get properties from- Returns:
- the properties associated with the role, see
JmxConstants.PROPERTIES_TYPE - Throws:
IOException- if the operation failsIllegalArgumentException- if the rolename is not a role
-
getRequiredMembers
String[] getRequiredMembers(String groupname) throws IOException
Answer the list of user names which are required members of this group- Parameters:
groupname- The name of the group to get the required members from- Returns:
- The list of user names
- Throws:
IOException- if the operation failsIllegalArgumentException- if the group name is not a Group
-
getRole
CompositeData getRole(String name) throws IOException
Answer the role associated with a name. The returned Composite Data is typed byROLE_TYPE.- Parameters:
name- The name of the role to get the data from- Returns:
- the Role, see
ROLE_TYPE - Throws:
IOException- if the operation failsIllegalArgumentException- if the name is not a role
-
listRoles
String[] listRoles() throws IOException
Answer the list of role names in the User Admin database- Returns:
- The list of role names
- Throws:
IOException- if the operation fails
-
getRoles
String[] getRoles(String filter) throws IOException
Answer the list of role names which match the supplied filter- Parameters:
filter- The string representation of theorg.osgi.framework.Filterthat is used to filter the roles by applying to the properties, ifnullall roles are returned.- Returns:
- The list the role names
- Throws:
IOException- if the operation fails
-
getUser
CompositeData getUser(String username) throws IOException
Answer the User associated with the user name. The returned Composite Data is typed byUSER_TYPE.- Parameters:
username- The name of the requested user- Returns:
- The User, see
USER_TYPE - Throws:
IOException- if the operation failsIllegalArgumentException- if the username is not a User
-
getUserWithProperty
String getUserWithProperty(String key, String value) throws IOException
Answer the user name with the given property key-value pair from the User Admin service database.- Parameters:
key- The key to comparevalue- The value to compare- Returns:
- The User
- Throws:
IOException- if the operation fails
-
listUsers
String[] listUsers() throws IOException
Answer the list of user names in the User Admin database- Returns:
- The list of user names
- Throws:
IOException- if the operation fails
-
getUsers
String[] getUsers(String filter) throws IOException
Answer the list of user names in the User Admin database- Parameters:
filter- The filter to apply- Returns:
- The list of user names
- Throws:
IOException- if the operation fails
-
removeCredential
void removeCredential(String key, String username) throws IOException
Remove the credential associated with the given user- Parameters:
key- The key of the credential to removeusername- The name of the user for which the credential must be removed- Throws:
IOException- if the operation failsIllegalArgumentException- if the username is not a User
-
removeMember
boolean removeMember(String groupname, String rolename) throws IOException
Remove a role from the group- Parameters:
groupname- The group namerolename-- Returns:
- true if the role was removed from the group
- Throws:
IOException- if the operation failsIllegalArgumentException- if the groupname is not a Group
-
removeProperty
void removeProperty(String key, String rolename) throws IOException
Remove a property from a role- Parameters:
key-rolename-- Throws:
IOException- if the operation failsIllegalArgumentException- if the rolename is not a role
-
removeRole
boolean removeRole(String name) throws IOException
Remove the Role associated with the name- Parameters:
name-- Returns:
- true if the remove succeeded
- Throws:
IOException- if the operation failsIllegalArgumentException- if the name is not a role
-
removeGroup
boolean removeGroup(String name) throws IOException
Remove the Group associated with the name- Parameters:
name-- Returns:
- true if the remove succeeded
- Throws:
IOException- if the operation failsIllegalArgumentException- if the name is not a Group
-
removeUser
boolean removeUser(String name) throws IOException
Remove the User associated with the name- Parameters:
name-- Returns:
- true if the remove succeeded
- Throws:
IOException- if the operation failsIllegalArgumentException- if the name is not a User
-
-