Interface Role
-
public interface RoleThe base interface forRoleobjects managed by the User Admin service.This interface exposes the characteristics shared by all
Roleclasses: a name, a type, and a set of properties.Properties represent public information about the
Roleobject that can be read by anyone. SpecificUserAdminPermissionobjects are required to change aRoleobject's properties.Roleobject properties areDictionaryobjects. Changes to these objects are propagated to the User Admin service and made persistent.Every User Admin service contains a set of predefined
Roleobjects that are always present and cannot be removed. All predefinedRoleobjects are of typeROLE. This version of theorg.osgi.service.useradminpackage defines a single predefined role named "user.anyone", which is inherited by any other role. Other predefined roles may be added in the future. Since "user.anyone" is aRoleobject that has properties associated with it that can be read and modified. Access to these properties and their use is application specific and is controlled usingUserAdminPermissionin the same way that properties for otherRoleobjects are.
-
-
Field Summary
Fields Modifier and Type Field Description static intGROUPThe type of aGrouprole.static intROLEThe type of a predefined role.static intUSERThe type of aUserrole.static java.lang.StringUSER_ANYONEThe name of the predefined role, user.anyone, that all users and groups belong to.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetName()Returns the name of this role.java.util.Dictionary<java.lang.String,java.lang.Object>getProperties()Returns aDictionaryof the (public) properties of thisRoleobject.intgetType()Returns the type of this role.
-
-
-
Field Detail
-
USER_ANYONE
static final java.lang.String USER_ANYONE
The name of the predefined role, user.anyone, that all users and groups belong to.- Since:
- 1.1
- See Also:
- Constant Field Values
-
ROLE
static final int ROLE
The type of a predefined role.The value of
ROLEis 0.- See Also:
- Constant Field Values
-
USER
static final int USER
The type of aUserrole.The value of
USERis 1.- See Also:
- Constant Field Values
-
GROUP
static final int GROUP
The type of aGrouprole.The value of
GROUPis 2.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
java.lang.String getName()
Returns the name of this role.- Returns:
- The role's name.
-
getType
int getType()
Returns the type of this role.- Returns:
- The role's type.
-
getProperties
java.util.Dictionary<java.lang.String,java.lang.Object> getProperties()
Returns aDictionaryof the (public) properties of thisRoleobject. Any changes to the returnedDictionarywill change the properties of thisRoleobject. This will cause aUserAdminEventobject of typeUserAdminEvent.ROLE_CHANGEDto be broadcast to anyUserAdminListenerobjects.Only objects of type
Stringmay be used as property keys, and only objects of typeStringorbyte[]may be used as property values. Any other types will cause an exception of typeIllegalArgumentExceptionto be raised.In order to add, change, or remove a property in the returned
Dictionary, aUserAdminPermissionnamed after the property name (or a prefix of it) with actionchangePropertyis required.- Returns:
Dictionarycontaining the properties of thisRoleobject.
-
-