Interface Role
-
public interface Role
The base interface forRole
objects managed by the User Admin service.This interface exposes the characteristics shared by all
Role
classes: a name, a type, and a set of properties.Properties represent public information about the
Role
object that can be read by anyone. SpecificUserAdminPermission
objects are required to change aRole
object's properties.Role
object properties areDictionary
objects. Changes to these objects are propagated to the User Admin service and made persistent.Every User Admin service contains a set of predefined
Role
objects that are always present and cannot be removed. All predefinedRole
objects are of typeROLE
. This version of theorg.osgi.service.useradmin
package 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 aRole
object 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 usingUserAdminPermission
in the same way that properties for otherRole
objects are.
-
-
Field Summary
Fields Modifier and Type Field Description static int
GROUP
The type of aGroup
role.static int
ROLE
The type of a predefined role.static int
USER
The type of aUser
role.static java.lang.String
USER_ANYONE
The 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.String
getName()
Returns the name of this role.java.util.Dictionary<java.lang.String,java.lang.Object>
getProperties()
Returns aDictionary
of the (public) properties of thisRole
object.int
getType()
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
ROLE
is 0.- See Also:
- Constant Field Values
-
USER
static final int USER
The type of aUser
role.The value of
USER
is 1.- See Also:
- Constant Field Values
-
GROUP
static final int GROUP
The type of aGroup
role.The value of
GROUP
is 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 aDictionary
of the (public) properties of thisRole
object. Any changes to the returnedDictionary
will change the properties of thisRole
object. This will cause aUserAdminEvent
object of typeUserAdminEvent.ROLE_CHANGED
to be broadcast to anyUserAdminListener
objects.Only objects of type
String
may be used as property keys, and only objects of typeString
orbyte[]
may be used as property values. Any other types will cause an exception of typeIllegalArgumentException
to be raised.In order to add, change, or remove a property in the returned
Dictionary
, aUserAdminPermission
named after the property name (or a prefix of it) with actionchangeProperty
is required.- Returns:
Dictionary
containing the properties of thisRole
object.
-
-