org.openpermis.policy.bean
Interface RoleHierarchyBean

All Superinterfaces:
Identifiable, IdentifiableBean, Part, PartBean, RoleHierarchy, Serializable
All Known Implementing Classes:
BasicRoleHierarchy

public interface RoleHierarchyBean
extends RoleHierarchy, PartBean, IdentifiableBean

A hierarchy of roles.

Since:
0.1.0

Method Summary
 void addRole(String role)
          Adds a new role in this role hierarchy.
 void addRole(String role, Set<String> parentRoles)
          Adds a new role in this role hierarchy.
 void addRole(String role, String parentRole)
          Adds a new role in this role hierarchy.
 boolean connectRoles(String parentRole, String childRole)
          Convenience method: add an edge between two roles.
 boolean disconnectRoles(String parentRole, String childRole)
          Convenience method: remove an edge between two roles.
 Set<String> getChildRoles(String role)
          Returns a unmodifiable list of all children.
 Set<String> getLeafRoles()
          Returns a list of all roles with no children.
 Set<String> getParentRoles(String role)
          Returns a unmodifiable list of all parents.
 Set<String> getRoles()
          Returns a list of all roles in this hierarchy.
 Set<String> getRootRoles()
          Returns a list of all roles with no parents.
 boolean isChildRole(String role, String childRole)
          Returns true if childRole is a child-role of role.
 boolean isLeafRole(String role)
          Returns true if role is leaf, i.e. has no children.
 boolean isParentRole(String role, String parentRole)
          Returns true if parentRole is a parent-role of role.
 boolean isRootRole(String role)
          Returns true if role is root, i.e. has no parents.
 boolean isSubRole(String role, String subRole)
          Returns true if subRole is a sub-role of role.
 boolean isSuperRole(String role, String superRole)
          Returns true if superRole is a super-role of role.
 void removeRole(String role)
          Removes a role from role hierarchy.
 boolean renameRole(String role, String newName)
          Renames an existing role.
 boolean roleExists(String role)
           
 void setChildRoles(String role, Set<String> childrenRoles)
          Set new children roles of a role.
 void setParentRoles(String role, Set<String> parentRoles)
          Set new parent roles of a role.
 
Methods inherited from interface org.openpermis.policy.RoleHierarchy
getSubRoles, getSuperRoles
 
Methods inherited from interface org.openpermis.policy.Part
equals, hashCode, isValid, toString
 
Methods inherited from interface org.openpermis.policy.Identifiable
getIdentity
 
Methods inherited from interface org.openpermis.policy.bean.PartBean
addPropertyChangeListener, equalSerialNumber, findBySerialNumber, getPartBeanType, getSerialNumber, removePropertyChangeListener, toShortString
 
Methods inherited from interface org.openpermis.policy.Part
equals, hashCode, isValid, toString
 
Methods inherited from interface org.openpermis.policy.bean.IdentifiableBean
setIdentity
 
Methods inherited from interface org.openpermis.policy.Identifiable
getIdentity
 

Method Detail

roleExists

boolean roleExists(String role)
Parameters:
role - the role to search.
Returns:
if role exists
Since:
0.3.0

getRoles

Set<String> getRoles()
Returns a list of all roles in this hierarchy.

Returns:
list of roles in this hierarchy.
Since:
0.1.0

getRootRoles

Set<String> getRootRoles()
Returns a list of all roles with no parents.

Returns:
list of all roles with no parents.
Since:
0.3.0

getLeafRoles

Set<String> getLeafRoles()
Returns a list of all roles with no children. precondition: role exists.

Returns:
list of all roles with no children.
Since:
0.3.0

getChildRoles

Set<String> getChildRoles(String role)
Returns a unmodifiable list of all children. precondition: role exists.

Returns:
list of children roles.
Since:
0.3.0

getParentRoles

Set<String> getParentRoles(String role)
Returns a unmodifiable list of all parents. precondition: role exists.

Returns:
list of parent roles.
Since:
0.3.0

isRootRole

boolean isRootRole(String role)
Returns true if role is root, i.e. has no parents. precondition: role exists.

Parameters:
role - the role to check.
Returns:
true if found.
Since:
0.3.0

isLeafRole

boolean isLeafRole(String role)
Returns true if role is leaf, i.e. has no children. precondition: role exists.

Parameters:
role - the role to check.
Returns:
true if found.
Since:
0.3.0

isSubRole

boolean isSubRole(String role,
                  String subRole)
Returns true if subRole is a sub-role of role. precondition: both roles exist.

Parameters:
role - the role to start search from.
subRole - the role to find.
Returns:
true if found.
Since:
0.3.0

isSuperRole

boolean isSuperRole(String role,
                    String superRole)
Returns true if superRole is a super-role of role. precondition: both roles exist.

Parameters:
role - the role to start search from..
superRole - the role to find.
Returns:
true if found.
Since:
0.3.0

isChildRole

boolean isChildRole(String role,
                    String childRole)
Returns true if childRole is a child-role of role. precondition: both roles exist.

Parameters:
role - the role to start search from..
childRole - the role to find.
Returns:
true if found.
Since:
0.3.0

isParentRole

boolean isParentRole(String role,
                     String parentRole)
Returns true if parentRole is a parent-role of role. precondition: both roles exist.

Parameters:
role - the role to start search from..
parentRole - the role to find.
Returns:
true if found.
Since:
0.3.0

setChildRoles

void setChildRoles(String role,
                   Set<String> childrenRoles)
Set new children roles of a role. precondition: all roles exist.

Parameters:
role - role to set children for.
childrenRoles - children roles to set
Since:
0.3.0

setParentRoles

void setParentRoles(String role,
                    Set<String> parentRoles)
Set new parent roles of a role. precondition: all roles exist.

Parameters:
role - role to set parents for.
parentRoles - parent roles to set
Since:
0.3.0

connectRoles

boolean connectRoles(String parentRole,
                     String childRole)
Convenience method: add an edge between two roles. Nothing is done if either role is null oder edge already exists.

Parameters:
parentRole - parent role.
childRole - child role
Returns:
true if edge was added
Since:
0.3.0

disconnectRoles

boolean disconnectRoles(String parentRole,
                        String childRole)
Convenience method: remove an edge between two roles. Nothing is done if either role is null oder edge not exists.

Parameters:
parentRole - parent role.
childRole - child role
Returns:
true if edge was removed
Since:
0.3.0

addRole

void addRole(String role)
Adds a new role in this role hierarchy. precondition: role not yet exists.

Parameters:
role - the new role to be added.
Since:
0.3.0

addRole

void addRole(String role,
             String parentRole)
Adds a new role in this role hierarchy. precondition: role not yet exists, parentRole exists.

Parameters:
role - the new role to be added.
parentRole - the parent where the role is appended.
Since:
0.3.0

addRole

void addRole(String role,
             Set<String> parentRoles)
Adds a new role in this role hierarchy. precondition: role not yet exists, parentRoles exist.

Parameters:
role - the new role to be added.
parentRoles - the parents where the role is appended.
Since:
0.3.0

removeRole

void removeRole(String role)
Removes a role from role hierarchy. precondition: role exists.

Parameters:
role - the role to be removed.
Since:
0.3.0

renameRole

boolean renameRole(String role,
                   String newName)
Renames an existing role.

The renamed role will keep its super and sub roles.

Parameters:
role - the role to be renamed.
newName - the new name for the role
Returns:
true if role was renamed.
Since:
0.3.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:14:49
Copyright (c) 2002-2007 Ergon Informatik AG