nbi.xmlsec.xacml.builder
Class PolicyBuilder

java.lang.Object
  extended bynbi.xmlsec.xacml.builder.AbstractPolicyTreeElementBuilder
      extended bynbi.xmlsec.xacml.builder.AbstractPolicyBuilder
          extended bynbi.xmlsec.xacml.builder.PolicyBuilder
All Implemented Interfaces:
PolicyTreeElementBuilder, XACMLObjectBuilder

public class PolicyBuilder
extends AbstractPolicyBuilder

Class to create policy instances.

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

Field Summary
 
Fields inherited from class nbi.xmlsec.xacml.builder.AbstractPolicyBuilder
combiningAlg, defaultVersion, logger, obligations, treeElements
 
Fields inherited from class nbi.xmlsec.xacml.builder.AbstractPolicyTreeElementBuilder
description, identifier, target
 
Constructor Summary
PolicyBuilder(URI identifier, RuleCombiningAlgorithm combAlg)
          Creates a policy builder.
 
Method Summary
 boolean add(Rule rule)
          Adds a rule to this policy.
 boolean add(RuleBuilder rule)
          Adds a rule to this policy.
 PolicyTreeElement getInstance()
          Creates a a new policy instance.
 boolean remove(Rule rule)
          Removes a rule from this policy.
 void setRules(List rules)
          Sets the treeElements of this policy.
 
Methods inherited from class nbi.xmlsec.xacml.builder.AbstractPolicyBuilder
add, add, add, add, remove, remove, setCombiningAlg, setCombiningAlg, setCombiningAlg, setDefaultVersion, setObligations, setTreeElements
 
Methods inherited from class nbi.xmlsec.xacml.builder.AbstractPolicyTreeElementBuilder
setDescription, setIdentifier, setIdentifier, setTarget, setTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolicyBuilder

public PolicyBuilder(URI identifier,
                     RuleCombiningAlgorithm combAlg)
Creates a policy builder.

Parameters:
identifier - rule identifier.
combAlg - Rule combining Algorithm (DenyOverridesRuleAlg, FirstApplicableRuleAlg or PermitOverridesRuleAlg).
Method Detail

getInstance

public PolicyTreeElement getInstance()
Creates a a new policy instance.

Specified by:
getInstance in interface PolicyTreeElementBuilder
Specified by:
getInstance in class AbstractPolicyTreeElementBuilder
See Also:
PolicyTreeElementBuilder.getInstance()

add

public boolean add(Rule rule)
Adds a rule to this policy.

Parameters:
rule - The rule to add.
Returns:
true if the rule has been added succesfully.

add

public boolean add(RuleBuilder rule)
Adds a rule to this policy.

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

remove

public boolean remove(Rule rule)
Removes a rule from this policy.

Parameters:
rule - The rule to remove.
Returns:
true if the rule has been removed succesfully.

setRules

public void setRules(List rules)
Sets the treeElements of this policy.

Parameters:
rules - The rules to set.


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