Class PolicySet

java.lang.Object
org.dogtagpki.legacy.core.policy.PolicySet
All Implemented Interfaces:
IPolicySet

public class PolicySet extends Object implements IPolicySet
Implements a policy set per IPolicySet interface. This class uses a vector of ordered policies to enforce priority.
Version:
$Revision$, $Date$
Author:
kanda
  • Field Details

    • logger

      public static org.slf4j.Logger logger
  • Constructor Details

    • PolicySet

      public PolicySet(String name)
  • Method Details

    • getName

      public String getName()
      Returns the name of the rule set.

      Specified by:
      getName in interface IPolicySet
      Returns:
      The name of the rule set.
    • count

      public int count()
      Returns the no of rules in a set.

      Specified by:
      count in interface IPolicySet
      Returns:
      the no of rules.
    • addRule

      public void addRule(String ruleName, IPolicyRule rule)
      Add a policy rule.

      Specified by:
      addRule in interface IPolicySet
      Parameters:
      ruleName - The name of the rule to be added.
      rule - The rule to be added.
    • replaceRule

      public void replaceRule(String ruleName, IPolicyRule rule)
      Remplaces a policy rule identified by the given name.
      Parameters:
      ruleName - The name of the rule to be replaced.
      rule - The rule to be replaced.
    • removeRule

      public void removeRule(String ruleName)
      Removes a policy rule identified by the given name.
      Specified by:
      removeRule in interface IPolicySet
      Parameters:
      ruleName - The name of the rule to be removed.
    • getRule

      public IPolicyRule getRule(String ruleName)
      Returns the rule identified by a given name.

      Specified by:
      getRule in interface IPolicySet
      Parameters:
      ruleName - The name of the rule to be return.
      Returns:
      The rule identified by the given name or null if none exists.
    • getRules

      public Enumeration<IPolicyRule> getRules()
      Returns an enumeration of rules.

      Specified by:
      getRules in interface IPolicySet
      Returns:
      An enumeration of rules.
    • apply

      public PolicyResult apply(Request req)
      Apply policies on a given request from a rule set. The rules may modify the request.
      Specified by:
      apply in interface IPolicySet
      Parameters:
      req - The request to apply policies on.
      Returns:
      the PolicyResult.
    • printPolicies

      public void printPolicies()