nbi.xmlsec.xacml.profile.rbac
Class PermissionPolicy

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

public class PermissionPolicy
extends RBACPolicy

This class implements a permission policy according to the XACML RBAC Profile. It manages permissions, which may be represented as a Policyor parsed from a Policyrepresentation.

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

Field Summary
(package private) static Logger logger
           
 
Fields inherited from class nbi.xmlsec.xacml.profile.rbac.RBACPolicy
elements, permitRule
 
Fields inherited from class nbi.xmlsec.xacml.profile.rbac.RBACPolicyElement
 
Constructor Summary
PermissionPolicy(Policy policy)
          Create an permission policy instance from its Policy representation.
PermissionPolicy(PolicyReference policy)
          Create an permission policy instance from its PolicyPolicyReferencerepresentation.
PermissionPolicy(String domain, String label)
          Creates permission policy with its identifier.
PermissionPolicy(URI id)
          Creates permission policy with its identifier.
 
Method Summary
 boolean add(RBACPolicyElement element)
          If the element is an Permission, the element is added to the set of elements.
 Set getPermissions()
          Gets the permissions of this role.
 void parse(PolicyTreeElement element)
          Parses a role assignment policy from its Policy representation.
 void parse(Target target)
          Parses the target of an PermissionPolicySet.
 boolean remove(RBACPolicyElement element)
          If the element is an Permission, the element is removed from the set of elements.
 Permission searchPermission(String permLabel)
          Searches a Permission within this PermissionPolicy.
 PolicyReference toPolicyReference()
          Returns the PolicyRefenceto this the role assignment policy.
 PolicyTreeElement toPolicyTreeElement()
          Returns the Policyrepresentation of the role assignment policy.
 String toString()
           
 
Methods inherited from class nbi.xmlsec.xacml.profile.rbac.RBACPolicy
encode, encode, equals, getElements, isPermitRule, parse, search, search, setPermitRule, toPolicyRerence, 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

logger

static Logger logger
Constructor Detail

PermissionPolicy

public PermissionPolicy(String domain,
                        String label)
Creates permission policy with its identifier.

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

PermissionPolicy

public PermissionPolicy(URI id)
                 throws ParsingException
Creates permission policy with its identifier.

Parameters:
id - Identifier's URI representation.

PermissionPolicy

public PermissionPolicy(Policy policy)
                 throws ParsingException
Create an permission policy instance from its Policy representation.

Parameters:
policy - Policyrepresentation.

PermissionPolicy

public PermissionPolicy(PolicyReference policy)
                 throws ParsingException
Create an permission policy instance from its PolicyPolicyReferencerepresentation.

Parameters:
policy - Policyrepresentation.
Method Detail

parse

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

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

parse

public void parse(PolicyTreeElement element)
           throws ParsingException
Parses a role assignment policy from its Policy representation.

Overrides:
parse in class RBACPolicy
Parameters:
element - The policy to parse.
Throws:
ParsingException - Indicates a malformed Policyrepresentation.

toPolicyTreeElement

public PolicyTreeElement toPolicyTreeElement()
Returns the Policyrepresentation of the role assignment policy.

Overrides:
toPolicyTreeElement in class RBACPolicy
Returns:
The Policyrepresentation.
See Also:
RBACPolicyElement.toPolicyTreeElement()

toPolicyReference

public PolicyReference toPolicyReference()
Returns the PolicyRefenceto this the role assignment policy.

Returns:
The PolicyReference.

add

public boolean add(RBACPolicyElement element)
If the element is an Permission, the element is added to the set of elements.

Overrides:
add in class RBACPolicy
Parameters:
element - The element to be added.
Returns:
true, if the permission was succesfully added, false otherwise.
See Also:
RBACPolicy.add(RBACPolicyElement)

remove

public boolean remove(RBACPolicyElement element)
If the element is an Permission, the element is removed from the set of elements.

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

searchPermission

public Permission searchPermission(String permLabel)
Searches a Permission within this PermissionPolicy. The domain of the PermissionPolicy is used for searching.

Parameters:
permLabel - Label of the Permission to search for
Returns:
The Permission with the given label, or null.

getPermissions

public Set getPermissions()
Gets the permissions of this role.

Returns:
Set of permissions..

toString

public String toString()
Overrides:
toString in class RBACPolicyElement


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