nbi.xmlsec.xacml.profile.rbac
Class RBACPolicyElement

java.lang.Object
  extended bynbi.xmlsec.xacml.profile.rbac.RBACPolicyElement
Direct Known Subclasses:
Assignment, Permission, RBACPolicy

public abstract class RBACPolicyElement
extends Object

Abstract base class for the RBACPolicyElements Assignment, RoleAssignmentPolicyand RoleAssignmentPolicySet.

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

Field Summary
private  Identifier identifier
          Identifier of this element.
private  RBACTarget target
          Target of this element.
 
Constructor Summary
protected RBACPolicyElement()
           
  RBACPolicyElement(Identifier id)
          Create an RBACPolicyElement.
  RBACPolicyElement(PolicyTreeElement element)
          Create an RBACPolicyElement from its PolicyTreeElement representation.
  RBACPolicyElement(URI id)
          Create an RBACPolicyElement.
 
Method Summary
abstract  boolean add(RBACPolicyElement element)
          Adds another policy element to this element.
 boolean equals(Object obj)
          Compares the specified object with this assignment.
 Identifier getIdentifier()
          Gets the identifier of this element.
 RBACTarget getTarget()
          Gets the target of this element.
 int hashCode()
          The hash code corresponds to the hash code of the assigment's identifier.
abstract  void parse(PolicyTreeElement element)
           
 void parse(Target target)
          Allows subclass specific parsing of the policy element's Targetto an RBACTarget.
abstract  boolean remove(RBACPolicyElement element)
          Removes another policy element from this element.
 void setIdentifier(Identifier id)
          Sets the identifier of this element.
 void setIdentifier(URI id)
          Sets the identifier of this element.
 void setTarget(RBACTarget target)
          Sets target of this element.
abstract  PolicyTreeElement toPolicyTreeElement()
          Returns the PolicyTreeElement representation of this policy element.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

identifier

private Identifier identifier
Identifier of this element.


target

private RBACTarget target
Target of this element.

Constructor Detail

RBACPolicyElement

protected RBACPolicyElement()

RBACPolicyElement

public RBACPolicyElement(URI id)
                  throws ParsingException
Create an RBACPolicyElement.

Parameters:
id - Identifier of this element (domain:assignment:label).
Throws:
ParsingException - Indicates a malformed identifier representation.

RBACPolicyElement

public RBACPolicyElement(Identifier id)
Create an RBACPolicyElement.

Parameters:
id - Identifier of this element (domain:assignment:label).

RBACPolicyElement

public RBACPolicyElement(PolicyTreeElement element)
                  throws ParsingException
Create an RBACPolicyElement from its PolicyTreeElement representation.

Parameters:
element - The element's PolicyTreeElement representation.
Throws:
ParsingException
Method Detail

parse

public abstract void parse(PolicyTreeElement element)
                    throws ParsingException
Throws:
ParsingException

parse

public void parse(Target target)
           throws ParsingException
Allows subclass specific parsing of the policy element's Targetto an RBACTarget. For that, it must be overwritten by subclasses. The default implementation simply parses the target using the RBACTarget.parse(Target) method. if the target is not null.

Parameters:
target - The target to parse.
Throws:
ParsingException - Signals errors during the parsing process.

toPolicyTreeElement

public abstract PolicyTreeElement toPolicyTreeElement()
Returns the PolicyTreeElement representation of this policy element. Should be one of
  • Rule
  • ,
  • Policy
  • or
  • PolicySet
  • Returns:
    The policy element's PolicyTreeElement representation.

    add

    public abstract boolean add(RBACPolicyElement element)
    Adds another policy element to this element. Shall permit to update/add elements to the target.

    Parameters:
    element - The element to add.
    Returns:
    true if the element has been added succesfully, false otherwise.

    remove

    public abstract boolean remove(RBACPolicyElement element)
    Removes another policy element from this element. Shall permit to update/remove elements from the target.

    Parameters:
    element - The element to remove.
    Returns:
    true if the element has been added succesfully, false otherwise.

    setIdentifier

    public void setIdentifier(URI id)
                       throws ParsingException
    Sets the identifier of this element.

    Parameters:
    id - The element's identifier.
    Throws:
    ParsingException - Indicates a malformed identifier representation.

    setIdentifier

    public void setIdentifier(Identifier id)
    Sets the identifier of this element.

    Parameters:
    id - The element's identifier.

    getIdentifier

    public Identifier getIdentifier()
    Gets the identifier of this element.

    Returns:
    The element's identifier.

    getTarget

    public RBACTarget getTarget()
    Gets the target of this element.

    Returns:
    Returns the target.

    setTarget

    public void setTarget(RBACTarget target)
    Sets target of this element.

    Parameters:
    target - The target to set.

    hashCode

    public int hashCode()
    The hash code corresponds to the hash code of the assigment's identifier.

    See Also:
    Object.hashCode()

    equals

    public boolean equals(Object obj)
    Compares the specified object with this assignment. Returns true if the specified object is also a RBACTarget, both identifiers and both targets are equal.

    Parameters:
    obj - Object to be compared for equality with this element.
    Returns:
    true if the specified Object is equal to this element.

    toString

    public String toString()


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