nbi.xmlsec.xacml.profile.rbac
Class RolePolicySet

java.lang.Object
  extended bynbi.xmlsec.xacml.profile.rbac.RBACPolicyElement
      extended bynbi.xmlsec.xacml.profile.rbac.RBACPolicy
          extended bynbi.xmlsec.xacml.profile.rbac.RBACPolicySet
              extended bynbi.xmlsec.xacml.profile.rbac.RolePolicySet

public class RolePolicySet
extends RBACPolicySet

This class implements a role policy set according to the XACML RBAC Profile. It stores the permission policy set and may be represented as a PolicySetor parsed from a PolicySet representation.

Since:
Version:
$Revision: 1.9 $
Author:
Lutz Suhrbier

Field Summary
static String ATTRIBUTE_ID
           
 
Fields inherited from class nbi.xmlsec.xacml.profile.rbac.RBACPolicySet
REPRESENT_POLICIES_AS_NONE, REPRESENT_POLICIES_AS_POLICY, REPRESENT_POLICIES_AS_POLICYREF
 
Fields inherited from class nbi.xmlsec.xacml.profile.rbac.RBACPolicy
elements, logger, permitRule
 
Fields inherited from class nbi.xmlsec.xacml.profile.rbac.RBACPolicyElement
 
Constructor Summary
RolePolicySet(PolicySet policySet)
          Creates a role policy set from its PolicySet representation.
RolePolicySet(String domain, String label)
          Creates a role policy set from its identifier.
RolePolicySet(URI id)
          Creates a role policy set from its identifier.
 
Method Summary
 boolean add(PermissionPolicy element)
          Adds the permission policy to the permission policy set of this role policy set.
 boolean add(PermissionPolicyIdentifier id, Permission element)
          Adds the permission to the given permission policy of this role policy set.
 Set getPermissionPolicies()
           
 PermissionPolicySet getPermissionPolicySet()
          Gets the PermissionPolicySet of this RolePolicySet.
 String getRole()
          Gets the label of this role from the identifier.
 void parse(PolicyTreeElement element)
          Parses a role policy set from its PolicySet representation.
 void parse(Target target)
          Parses the target of an RolePolicySet.
 boolean remove(PermissionPolicy element)
          Removes the permission policy to the permission policy set of this role policy set.
 boolean remove(PermissionPolicyIdentifier id, Permission element)
          Removes the permission from the given permission policy of this role policy set.
 Permission searchPermission(String domain, String policy, String label)
          Retrieves a permission from an permission policy of the permission policy set from that role.
 PermissionPolicy searchPermissionPolicy(String domain, String label)
          Retrieves an permission policy of the permission policy set from that role.
 PermissionPolicySet searchPermissionPolicySet(String domain)
          Retrieves the permission policy set of this role policy set.
 String toString()
           
 
Methods inherited from class nbi.xmlsec.xacml.profile.rbac.RBACPolicySet
encode, getPolicyRepresentationType, parse, setPolicyRepresentationType, toPolicyRerence, toPolicyTreeElement
 
Methods inherited from class nbi.xmlsec.xacml.profile.rbac.RBACPolicy
add, encode, equals, getElements, isPermitRule, parse, remove, search, search, setPermitRule, toPolicyRerence, toPolicyTreeElement
 
Methods inherited from class nbi.xmlsec.xacml.profile.rbac.RBACPolicyElement
getIdentifier, getTarget, hashCode, setIdentifier, setIdentifier, setTarget
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRIBUTE_ID

public static final String ATTRIBUTE_ID
See Also:
Constant Field Values
Constructor Detail

RolePolicySet

public RolePolicySet(String domain,
                     String label)
Creates a role policy set from its identifier. The default policy representation type is set to REPRESENT_POLICIES_AS_POLICYREF.

Parameters:
domain - Identifier's domain.
label - Identifier's label.

RolePolicySet

public RolePolicySet(URI id)
              throws ParsingException
Creates a role policy set from its identifier. The default policy representation type is set to REPRESENT_POLICIES_AS_POLICYREF.

Parameters:
id - Identifier's URI representation.

RolePolicySet

public RolePolicySet(PolicySet policySet)
              throws ParsingException
Creates a role policy set from its PolicySet representation. The first policy parsed determines the policy representation type of the policy set.

Parameters:
policySet - PolicySetrepresentation.
Method Detail

parse

public void parse(Target target)
           throws ParsingException
Parses the target of an RolePolicySet.

Overrides:
parse in class RBACPolicyElement
Parameters:
target - The target to parse.
Throws:
ParsingException - Signals errors during the parsing process.
See Also:
RBACPolicyElement.parse(Target)

parse

public void parse(PolicyTreeElement element)
           throws ParsingException
Parses a role policy set from its PolicySet representation. The first policy parsed determines the policy representation type of the policy set.

Overrides:
parse in class RBACPolicySet
Parameters:
element - The policy set to parse.
Throws:
ParsingException - Indicates errors during the parsing process.

searchPermissionPolicySet

public PermissionPolicySet searchPermissionPolicySet(String domain)
Retrieves the permission policy set of this role policy set.

Parameters:
domain - The domain to search for.
Returns:
The permission policy set from this role policy set or null.
See Also:
RBACPolicy.search(Identifier).

searchPermissionPolicy

public PermissionPolicy searchPermissionPolicy(String domain,
                                               String label)
Retrieves an permission policy of the permission policy set from that role.

Parameters:
domain - The domain to search for.
label - The name of the permission policy to search for.
Returns:
The permission policy from the permission policy set or null.
See Also:
RBACPolicy.search(Identifier).

searchPermission

public Permission searchPermission(String domain,
                                   String policy,
                                   String label)
Retrieves a permission from an permission policy of the permission policy set from that role.

Parameters:
domain - The domain to search for.
policy - The name of the permission policy to search for.
label - The name of the permission to search for.
Returns:
The permission from the permission policy or null.
See Also:
RBACPolicy.search(Identifier).

getRole

public String getRole()
Gets the label of this role from the identifier.

Returns:
label of this role

add

public boolean add(PermissionPolicy element)
Adds the permission policy to the permission policy set of this role policy set.

Parameters:
element - The permission policy to add.
Returns:
true, if the element was succesfully added or successfully updates an existing element, false otherwise.
See Also:
RBACPolicy.add(RBACPolicyElement)

remove

public boolean remove(PermissionPolicy element)
Removes the permission policy to the permission policy set of this role policy set.

Parameters:
element - The permission policy to remove.
Returns:
true, if the element was succesfully removed, false otherwise.
See Also:
RBACPolicy.add(RBACPolicyElement)

add

public boolean add(PermissionPolicyIdentifier id,
                   Permission element)
Adds the permission to the given permission policy of this role policy set.

Parameters:
id - The identifier of the permission policy to add to.
element - The permission to add.
Returns:
true, if the element was succesfully added or successfully updates an existing element, false otherwise.
Throws:
ParsingException
See Also:
RBACPolicy.remove(RBACPolicyElement).

remove

public boolean remove(PermissionPolicyIdentifier id,
                      Permission element)
Removes the permission from the given permission policy of this role policy set.

Parameters:
id - The identifier of the permission policy to remove from.
element - The permission to remove.
Returns:
true, if the element was succesfully added or successfully updates an existing element, false otherwise.
See Also:
RBACPolicy.remove(RBACPolicyElement).

getPermissionPolicySet

public PermissionPolicySet getPermissionPolicySet()
Gets the PermissionPolicySet of this RolePolicySet. The first element of the elements set is returned.

Returns:
PermissionPolicySet or null, if no elements available.

getPermissionPolicies

public Set getPermissionPolicies()

toString

public String toString()
Overrides:
toString in class RBACPolicyElement


Copyright © 2006 Lutz Suhrbier, Freie Universitšt Berlin. All Rights Reserved.