org.apache.felix.useradmin.impl
Class RoleImpl

java.lang.Object
  extended by org.apache.felix.useradmin.impl.RoleImpl
All Implemented Interfaces:
Serializable, Version, Role
Direct Known Subclasses:
UserImpl

public class RoleImpl
extends Object
implements Role, Version, Serializable

This RoleImplclass represents Role. Act as base class for different types of roles User,Group.

Version:
$Rev$ $Date$
See Also:
Role, Serialized Form

Field Summary
protected  String name
          role name.
protected  UserAdminServiceImpl userAdmin
          UserAdmin service instance.
 
Fields inherited from interface org.osgi.service.useradmin.Role
GROUP, ROLE, USER, USER_ANYONE
 
Constructor Summary
RoleImpl()
          Construct new Role.
 
Method Summary
 String getName()
          Returns the name of this role.
 Dictionary getProperties()
          Returns a Dictionary of the (public) properties of this Role object.
 int getType()
          Returns the type of this role.
 long getVersion()
          This method getting version of a role.
protected  boolean impliedBy(AuthorizationImpl authorization)
          Checks if this role is implied by provided Authorization object.
 void increaseVersion()
          This method increasing version of a role.
 void setName(String name)
          Setting role name.
 void setUserAdmin(UserAdminServiceImpl userAdmin)
          Setting UserAdmin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected String name
role name.


userAdmin

protected transient UserAdminServiceImpl userAdmin
UserAdmin service instance.

Constructor Detail

RoleImpl

public RoleImpl()
Construct new Role.

Method Detail

getName

public String getName()
Description copied from interface: Role
Returns the name of this role.

Specified by:
getName in interface Role
Returns:
The role's name.
See Also:
Role.getName()

getProperties

public Dictionary getProperties()
Description copied from interface: Role
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.

Specified by:
getProperties in interface Role
Returns:
Dictionary containing the properties of this Role object.
See Also:
Role.getProperties()

getType

public int getType()
Description copied from interface: Role
Returns the type of this role.

Specified by:
getType in interface Role
Returns:
The role's type.
See Also:
Role.getType()

getVersion

public long getVersion()
Description copied from interface: Version
This method getting version of a role.

Specified by:
getVersion in interface Version
Returns:
version
See Also:
Version.getVersion()

increaseVersion

public void increaseVersion()
Description copied from interface: Version
This method increasing version of a role.

Specified by:
increaseVersion in interface Version
See Also:
Version.increaseVersion()

impliedBy

protected boolean impliedBy(AuthorizationImpl authorization)
Checks if this role is implied by provided Authorization object.

Parameters:
authorization - Authorization instance.
Returns:
true if is implied false if not.
See Also:
org.osgi.service.useradmin.Autorization

setUserAdmin

public void setUserAdmin(UserAdminServiceImpl userAdmin)
Setting UserAdmin.

Parameters:
userAdmin - UserAdmin isntance.

setName

public void setName(String name)
Setting role name.

Parameters:
name - role name.


Copyright © 2011 Apache Software Foundation. All Rights Reserved.