Top Description Fields Methods
org.osgi.service.useradmin

public Interface Role

Known Direct Subinterfaces
org.osgi.service.useradmin.User
Imports
java.util.Dictionary

The base interface for Role 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. Specific UserAdminPermission objects are required to change a Role object's properties.

Role object properties are Dictionary 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 predefined Role objects are of type ROLE. This version of the org.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 a Role 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 using UserAdminPermission in the same way that properties for other Role objects are.

Author
$Id: 8b4ac6a7594c6652fc80fa00f3a74a3219d12f09 $

Field Summary

Modifier and TypeField and Description
public static final int
GROUP

The type of a Group role.

public static final int
ROLE

The type of a predefined role.

public static final int
USER

The type of a User role.

public static final String
USER_ANYONE

The name of the predefined role, user.anyone, that all users and groups belong to.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The role's name.
getName
()

Returns the name of this role.

public Dictionary<String, Object>

Returns:

Dictionary containing the properties of this Role object.
getProperties
()

Returns a Dictionary of the (public) properties of this Role object.

public int

Returns:

The role's type.
getType
()

Returns the type of this role.

Field Detail

GROUPback to summary
public static final int GROUP

The type of a Group role.

The value of GROUP is 2.

ROLEback to summary
public static final int ROLE

The type of a predefined role.

The value of ROLE is 0.

USERback to summary
public static final int USER

The type of a User role.

The value of USER is 1.

USER_ANYONEback to summary
public static final String USER_ANYONE

The name of the predefined role, user.anyone, that all users and groups belong to.

Since
1.1

Method Detail

getNameback to summary
public String getName()

Returns the name of this role.

Returns:String

The role's name.

getPropertiesback to summary
public Dictionary<String, Object> getProperties()

Returns a Dictionary of the (public) properties of this Role object. Any changes to the returned Dictionary will change the properties of this Role object. This will cause a UserAdminEvent object of type UserAdminEvent#ROLE_CHANGED to be broadcast to any UserAdminListener objects.

Only objects of type String may be used as property keys, and only objects of type String or byte[] may be used as property values. Any other types will cause an exception of type IllegalArgumentException to be raised.

In order to add, change, or remove a property in the returned Dictionary, a UserAdminPermission named after the property name (or a prefix of it) with action changeProperty is required.

Returns:Dictionary<String, Object>

Dictionary containing the properties of this Role object.

getTypeback to summary
public int getType()

Returns the type of this role.

Returns:int

The role's type.