Package org.dogtagpki.legacy.core.policy
Class PolicySet
- java.lang.Object
-
- org.dogtagpki.legacy.core.policy.PolicySet
-
- All Implemented Interfaces:
org.dogtagpki.legacy.policy.IPolicySet
public class PolicySet extends java.lang.Object implements org.dogtagpki.legacy.policy.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 Summary
Fields Modifier and Type Field Description static org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description PolicySet(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRule(java.lang.String ruleName, org.dogtagpki.legacy.policy.IPolicyRule rule)
Add a policy rule.com.netscape.certsrv.request.PolicyResult
apply(com.netscape.certsrv.request.IRequest req)
Apply policies on a given request from a rule set.int
count()
Returns the no of rules in a set.java.lang.String
getName()
Returns the name of the rule set.org.dogtagpki.legacy.policy.IPolicyRule
getRule(java.lang.String ruleName)
Returns the rule identified by a given name.java.util.Enumeration<org.dogtagpki.legacy.policy.IPolicyRule>
getRules()
Returns an enumeration of rules.void
printPolicies()
void
removeRule(java.lang.String ruleName)
Removes a policy rule identified by the given name.void
replaceRule(java.lang.String ruleName, org.dogtagpki.legacy.policy.IPolicyRule rule)
Remplaces a policy rule identified by the given name.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the rule set.- Specified by:
getName
in interfaceorg.dogtagpki.legacy.policy.IPolicySet
- Returns:
- The name of the rule set.
-
count
public int count()
Returns the no of rules in a set.- Specified by:
count
in interfaceorg.dogtagpki.legacy.policy.IPolicySet
- Returns:
- the no of rules.
-
addRule
public void addRule(java.lang.String ruleName, org.dogtagpki.legacy.policy.IPolicyRule rule)
Add a policy rule.- Specified by:
addRule
in interfaceorg.dogtagpki.legacy.policy.IPolicySet
- Parameters:
ruleName
- The name of the rule to be added.rule
- The rule to be added.
-
replaceRule
public void replaceRule(java.lang.String ruleName, org.dogtagpki.legacy.policy.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(java.lang.String ruleName)
Removes a policy rule identified by the given name.- Specified by:
removeRule
in interfaceorg.dogtagpki.legacy.policy.IPolicySet
- Parameters:
ruleName
- The name of the rule to be removed.
-
getRule
public org.dogtagpki.legacy.policy.IPolicyRule getRule(java.lang.String ruleName)
Returns the rule identified by a given name.- Specified by:
getRule
in interfaceorg.dogtagpki.legacy.policy.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 java.util.Enumeration<org.dogtagpki.legacy.policy.IPolicyRule> getRules()
Returns an enumeration of rules.- Specified by:
getRules
in interfaceorg.dogtagpki.legacy.policy.IPolicySet
- Returns:
- An enumeration of rules.
-
apply
public com.netscape.certsrv.request.PolicyResult apply(com.netscape.certsrv.request.IRequest req)
Apply policies on a given request from a rule set. The rules may modify the request.- Specified by:
apply
in interfaceorg.dogtagpki.legacy.policy.IPolicySet
- Parameters:
req
- The request to apply policies on.- Returns:
- the PolicyResult.
-
printPolicies
public void printPolicies()
-
-