summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/cmscore/policy
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-04-05 14:49:11 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-04-09 10:03:25 -0500
commit7c7b9d023cd466c1771068badc020dab36beb553 (patch)
tree178877eb83e25336be7577953945fbdb0b9e1a15 /base/common/src/com/netscape/cmscore/policy
parentda1e6e2f49f66fd46c8039ff1aa4386309fba8f4 (diff)
downloadpki-7c7b9d023cd466c1771068badc020dab36beb553.tar.gz
pki-7c7b9d023cd466c1771068badc020dab36beb553.tar.xz
pki-7c7b9d023cd466c1771068badc020dab36beb553.zip
Removed whitespaces from Java code.
Whitespaces in Java code have been removed with the following command: find . -not -path .git -name *.java -exec sed -i 's/[[:blank:]]\+$//' {} \; Ticket #134
Diffstat (limited to 'base/common/src/com/netscape/cmscore/policy')
-rw-r--r--base/common/src/com/netscape/cmscore/policy/AndExpression.java4
-rw-r--r--base/common/src/com/netscape/cmscore/policy/GeneralNameUtil.java6
-rw-r--r--base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java82
-rw-r--r--base/common/src/com/netscape/cmscore/policy/OrExpression.java4
-rw-r--r--base/common/src/com/netscape/cmscore/policy/PolicyPredicateParser.java16
-rw-r--r--base/common/src/com/netscape/cmscore/policy/PolicySet.java22
-rw-r--r--base/common/src/com/netscape/cmscore/policy/SimpleExpression.java6
7 files changed, 70 insertions, 70 deletions
diff --git a/base/common/src/com/netscape/cmscore/policy/AndExpression.java b/base/common/src/com/netscape/cmscore/policy/AndExpression.java
index 459660f1e..9a2274b11 100644
--- a/base/common/src/com/netscape/cmscore/policy/AndExpression.java
+++ b/base/common/src/com/netscape/cmscore/policy/AndExpression.java
@@ -24,9 +24,9 @@ import com.netscape.certsrv.request.IRequest;
/**
* This class represents an expression of the form
* <var1 op val1 AND var2 op va2>.
- *
+ *
* Expressions are used as predicates for policy selection.
- *
+ *
* @deprecated
* @author kanda
* @version $Revision$, $Date$
diff --git a/base/common/src/com/netscape/cmscore/policy/GeneralNameUtil.java b/base/common/src/com/netscape/cmscore/policy/GeneralNameUtil.java
index 7c7162d0c..a3f64915d 100644
--- a/base/common/src/com/netscape/cmscore/policy/GeneralNameUtil.java
+++ b/base/common/src/com/netscape/cmscore/policy/GeneralNameUtil.java
@@ -89,7 +89,7 @@ public class GeneralNameUtil implements IGeneralNameUtil {
* Form a General Name from a General Name choice and value.
* The General Name choice must be one of the General Name Choice Strings
* defined in this class.
- *
+ *
* @param generalNameChoice General Name choice. Must be one of the General
* Name choices defined in this class.
* @param value String value of the general name to form.
@@ -192,7 +192,7 @@ public class GeneralNameUtil implements IGeneralNameUtil {
/**
* Checks if given string is a valid General Name choice and returns
* the actual string that can be passed into form_GeneralName().
- *
+ *
* @param generalNameChoice a General Name choice string.
* @return one of General Name choices defined in this class that can be
* passed into form_GeneralName().
@@ -209,7 +209,7 @@ public class GeneralNameUtil implements IGeneralNameUtil {
theGeneralNameChoice = GENNAME_CHOICE_DNSNAME;
/* X400Address not supported.
- else if (generalNameChoice.equalsIgnoreCase(GENNAME_CHOICE_X400ADDRESS))
+ else if (generalNameChoice.equalsIgnoreCase(GENNAME_CHOICE_X400ADDRESS))
theGeneralNameChoice = GENNAME_CHOICE_X400ADDRESS;
*/
else if (generalNameChoice.equalsIgnoreCase(GENNAME_CHOICE_DIRECTORYNAME))
diff --git a/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java b/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java
index 05f8e111a..823c416dc 100644
--- a/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java
+++ b/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java
@@ -55,11 +55,11 @@ import com.netscape.cmscore.util.Debug;
* Renewal, Revocation and KeyRecovery and KeyArchival.
* 2. To apply the configured policies on the given request.
* 3. To enable policy listing/configuration via MCC console.
- *
+ *
* Since the policy processor also implements the IPolicy interface
* the processor itself presents itself as one big policy to the
* request processor.
- *
+ *
* @deprecated
* @author kanda
* @version $Revision$, $Date$
@@ -126,7 +126,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
/**
* Returns the configuration store.
* <P>
- *
+ *
* @return configuration store
*/
public IConfigStore getConfigStore() {
@@ -136,7 +136,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
/**
* Initializes the PolicyProcessor
* <P>
- *
+ *
* @param owner owner of this subsystem
* @param config configuration of this subsystem
* @exception EBaseException failed to initialize this Subsystem.
@@ -323,7 +323,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
} catch (Throwable e) {
mAuthority.log(ILogger.LL_FAILURE,
CMS.getLogMessage("CMSCORE_POLICY_INIT_FAILED", instanceName, e.toString()));
- // disable rule initialized if there is
+ // disable rule initialized if there is
// configuration error
enabled = false;
c.putString(PROP_ENABLE, "false");
@@ -372,7 +372,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
/**
* Apply policies on the given request.
- *
+ *
* @param IRequest The given request
* @return The policy result object.
*/
@@ -384,9 +384,9 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
if (op == null) {
CMS.debug("GenericPolicyProcessor: apply op null");
// throw new AssertionException("Missing operation type in request. Can't happen!");
- // Return ACCEPTED for now. Looks like even get CA chain
- // is being passed in here with request type set elsewhere
- // on the request.
+ // Return ACCEPTED for now. Looks like even get CA chain
+ // is being passed in here with request type set elsewhere
+ // on the request.
return PolicyResult.ACCEPTED;
}
if (isProfileRequest(req)) {
@@ -920,7 +920,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
// Predicate for the persistent rule can't be changed.
ht.put(IPolicyRule.PROP_ENABLE, String.valueOf(active));
- // put old config store parameters first.
+ // put old config store parameters first.
for (Enumeration<String> oldkeys = oldStore.keys(); oldkeys.hasMoreElements();) {
String k = (String) oldkeys.nextElement();
String v = (String) oldStore.getString(k);
@@ -957,7 +957,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
// Try to initialize this rule.
newRule.init(this, newStore);
- // If we are successfully initialized, replace the rule
+ // If we are successfully initialized, replace the rule
// instance
policyInstance.setRule(newRule);
policyInstance.setActive(active);
@@ -1161,26 +1161,26 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
/**
* Initializes the default system policies. Currently there is only
* one policy - ManualAuthentication. More may be added later on.
- *
+ *
* The default policies may be disabled - for example to over-ride
* agent approval for testing the system by setting the following
* property in the config file:
- *
+ *
* <subsystemId>.Policy.systemPolicies.enable=false
- *
+ *
* By default the value for this property is true.
- *
+ *
* Users can over-ride the default system policies by listing their
* 'custom' system policies under the following property:
- *
+ *
* <subsystemId>.Policy.systemPolicies=<system policy1 class path>,
* <system policy2 class path>
- *
+ *
* There can only be one instance of the system policy in the system
* and will apply to all requests, and hence predicates are not used
* for a system policy. Due to the same reason, these properties are
* not configurable using the Console.
- *
+ *
* A System policy may read config properties from a subtree under
* <subsystemId>.Policy.systemPolicies.<ClassName>. An example is
* ra.Policy.systemPolicies.ManualAuthentication.param1=value
@@ -1221,7 +1221,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
mSystemDefaults = DEF_POLICIES;
}
- // Now Initialize the rules. These defaults have only one
+ // Now Initialize the rules. These defaults have only one
// instance and the rule name is the name of the class itself.
// Any configuration parameters required could be read from
// <subsystemId>.Policy.default.RuleName.
@@ -1268,84 +1268,84 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
/**
* Read list of undeletable policies if any configured in the
* system.
- *
+ *
* These are required to protect the system from being misconfigured
* to the point that the requests wouldn't serialize or certain
* fields in the certificate(s) being checked will go unchecked
* ..etc.
- *
+ *
* For now the following policies are undeletable:
- *
+ *
* DirAuthRule: This is a default DirectoryAuthentication policy
* for user certificates that interprets directory
* credentials. The presence of this policy is needed
* if the OOTB DirectoryAuthentication-based automatic
* certificate issuance is supported.
- *
+ *
* DefaultUserNameRule: This policy verifies/sets subjectDn for user
* certificates.
- *
+ *
* DefaultServerNameRule: This policy verifies/sets subjectDn for
* server certificates.
- *
+ *
* DefaultValidityRule: Verifies/sets validty for all certificates.
- *
+ *
* DefaultRenewalValidityRule: Verifies/sets validity for certs being
* renewed.
- *
+ *
* The 'undeletables' cannot be deleted from the config file, nor
* can the be disabled. If any predicates are associated with them
* the predicates can't be changed either. But, other config parameters
* such as maxValidity, renewalInterval ..etc can be changed to suit
* local policy requirements.
- *
+ *
* During start up the policy processor will verify if the undeletables
* are present, and that they are enabled and that their predicates are
* not changed.
- *
+ *
* The rules mentioned above are currently hard coded. If these need to
* read from the config file, the 'undeletables' can be configured as
* as follows:
- *
+ *
* <subsystemId>.Policy.undeletablePolicies=<comma separated rule names>
* Example:
* ra.Policy.undeletablePolicies=DirAuthRule, DefaultUserNameRule, DefaultServerNameRule, DefaultValidityRule,
* DefaultRenewalValidityRule
- *
+ *
* The predicates if any associated with them may be configured as
* follows:
* <subsystemId>.Policy.undeletablePolicies.DirAuthRule.predicate= certType == client.
- *
+ *
* where subsystemId is ra or ca.
- *
+ *
* If the undeletables are configured in the file,the configured entries
* take precedence over the hardcoded ones in this file. If you are
* configuring them in the file, please remember to configure the
* predicates if applicable.
- *
+ *
* During policy configuration from MCC, the policy processor will not
* let you delete an 'undeletable', nor will it let you disable it.
* You will not be able to change the predicate either. Other parameters
* can be configured as needed.
- *
+ *
* If a particular rule needs to be removed from the 'undeletables',
* either remove it from the hard coded list above, or configure the
* rules required rules only via the config file. The former needs
* recompilation of the source. The later is flexible to be able to
* make any rule an 'undeletable' or nor an 'undeletable'.
- *
+ *
* Example: We want to use only manual forms for enrollment.
* We do n't need to burn in DirAuthRule. We need to configure all
* other rules except the DirAuthRule as follows:
- *
+ *
* ra.Policy.undeletablePolicies = DefaultUserNameRule, DefaultServerNameRule, DefaultValidityRule,
* DefaultRenewalValidityRule
- *
+ *
* The following predicates are necessary:
- *
+ *
* ra.Policy.undeletablePolicies.DefaultUserNameRule.predicate = certType == client
* ra.Policy.undeletablePolicies.DefaultServerNameRule.predicate = certType == server
- *
+ *
* The other two rules do not have any predicates.
*/
private void initUndeletablePolicies(IConfigStore mConfig)
@@ -1375,7 +1375,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
return;
}
- // For each rule read from the config file, see if any
+ // For each rule read from the config file, see if any
// predicate is set.
mUndeletablePolicies = new Hashtable<String, IExpression>();
for (Enumeration<String> e = rules.elements(); e.hasMoreElements();) {
diff --git a/base/common/src/com/netscape/cmscore/policy/OrExpression.java b/base/common/src/com/netscape/cmscore/policy/OrExpression.java
index 3b220c100..512bba256 100644
--- a/base/common/src/com/netscape/cmscore/policy/OrExpression.java
+++ b/base/common/src/com/netscape/cmscore/policy/OrExpression.java
@@ -24,9 +24,9 @@ import com.netscape.certsrv.request.IRequest;
/**
* This class represents an Or expression of the form
* (var1 op val1 OR var2 op val2).
- *
+ *
* Expressions are used as predicates for policy selection.
- *
+ *
* @deprecated
* @author kanda
* @version $Revision$, $Date$
diff --git a/base/common/src/com/netscape/cmscore/policy/PolicyPredicateParser.java b/base/common/src/com/netscape/cmscore/policy/PolicyPredicateParser.java
index 568a38e6d..b40a50699 100644
--- a/base/common/src/com/netscape/cmscore/policy/PolicyPredicateParser.java
+++ b/base/common/src/com/netscape/cmscore/policy/PolicyPredicateParser.java
@@ -26,16 +26,16 @@ import com.netscape.cmscore.util.Debug;
/**
* Default implementation of predicate parser.
- *
+ *
* Limitations:
- *
+ *
* 1. Currently parentheses are not suported.
* 2. Only ==, != <, >, <= and >= operators are supported.
* 3. The only boolean operators supported are AND and OR. AND takes precedence
* over OR. Example: a AND b OR e OR c AND d
* is treated as (a AND b) OR e OR (c AND d)
* 4. If this is n't adequate, roll your own.
- *
+ *
* @deprecated
* @author kanda
* @version $Revision$, $Date$
@@ -52,7 +52,7 @@ public class PolicyPredicateParser {
/**
* Parse the predicate expression and return a vector of expressions.
- *
+ *
* @param predicateExp The predicate expression as read from the config file.
* @return expVector The vector of expressions.
*/
@@ -198,7 +198,7 @@ public class PolicyPredicateParser {
* req.set("request", "issuance");
* req.set("id", new Integer(10));
* req.set("dualcerts", new Boolean(true));
- *
+ *
* Vector v = new Vector();
* v.addElement("one");
* v.addElement("two");
@@ -228,8 +228,8 @@ public class PolicyPredicateParser {
* }
* catch (Exception e) {e.printStackTrace(); }
* }
- *
- *
+ *
+ *
* try
* {
* BufferedReader rdr = new BufferedReader(
@@ -249,7 +249,7 @@ public class PolicyPredicateParser {
* boolean result = exp.evaluate(req);
* System.out.println("Result: " + result);
* }
- *
+ *
* }catch (Exception e){e.printStackTrace();}
* }
* }
diff --git a/base/common/src/com/netscape/cmscore/policy/PolicySet.java b/base/common/src/com/netscape/cmscore/policy/PolicySet.java
index 9e7ecdc64..d824d2629 100644
--- a/base/common/src/com/netscape/cmscore/policy/PolicySet.java
+++ b/base/common/src/com/netscape/cmscore/policy/PolicySet.java
@@ -32,7 +32,7 @@ import com.netscape.cmscore.util.Debug;
/**
* Implements a policy set per IPolicySet interface. This class
* uses a vector of ordered policies to enforce priority.
- *
+ *
* @deprecated
* @author kanda
* @version $Revision$, $Date$
@@ -50,7 +50,7 @@ public class PolicySet implements IPolicySet {
/**
* Returns the name of the rule set.
* <P>
- *
+ *
* @return The name of the rule set.
*/
public String getName() {
@@ -60,7 +60,7 @@ public class PolicySet implements IPolicySet {
/**
* Returns the no of rules in a set.
* <P>
- *
+ *
* @return the no of rules.
*/
public int count() {
@@ -70,7 +70,7 @@ public class PolicySet implements IPolicySet {
/**
* Add a policy rule.
* <P>
- *
+ *
* @param ruleName The name of the rule to be added.
* @param rule The rule to be added.
*/
@@ -88,7 +88,7 @@ public class PolicySet implements IPolicySet {
/**
* Remplaces a policy rule identified by the given name.
- *
+ *
* @param name The name of the rule to be replaced.
* @param rule The rule to be replaced.
*/
@@ -106,7 +106,7 @@ public class PolicySet implements IPolicySet {
/**
* Removes a policy rule identified by the given name.
- *
+ *
* @param name The name of the rule to be removed.
*/
public void removeRule(String ruleName) {
@@ -122,7 +122,7 @@ public class PolicySet implements IPolicySet {
/**
* Returns the rule identified by a given name.
* <P>
- *
+ *
* @param name The name of the rule to be return.
* @return The rule identified by the given name or null if none exists.
*/
@@ -137,7 +137,7 @@ public class PolicySet implements IPolicySet {
/**
* Returns an enumeration of rules.
* <P>
- *
+ *
* @return An enumeration of rules.
*/
public Enumeration<IPolicyRule> getRules() {
@@ -147,7 +147,7 @@ public class PolicySet implements IPolicySet {
/**
* Apply policies on a given request from a rule set.
* The rules may modify the request.
- *
+ *
* @param req The request to apply policies on.
* @return the PolicyResult.
*/
@@ -161,7 +161,7 @@ public class PolicySet implements IPolicySet {
// if atleast one of the policies returns a REJECTED, we need to
// return that status. If none of the policies REJECTED
// the request, but atleast one of them DEFERRED the request, we
- // need to return DEFERRED.
+ // need to return DEFERRED.
boolean rejected = false;
boolean deferred = false;
int size = mRules.size();
@@ -235,7 +235,7 @@ public class PolicySet implements IPolicySet {
ILogger.LL_FAILURE,
CMS.getLogMessage("CMSCORE_POLICY_ERROR_RESULT", req.getRequestId().toString(), name,
ex.toString()));
- // treat as rejected to prevent request from going into
+ // treat as rejected to prevent request from going into
// a weird state. request queue doesn't handle this case.
rejected = true;
((IPolicyRule) rule).setError(
diff --git a/base/common/src/com/netscape/cmscore/policy/SimpleExpression.java b/base/common/src/com/netscape/cmscore/policy/SimpleExpression.java
index 892fd6451..cf6e44bb0 100644
--- a/base/common/src/com/netscape/cmscore/policy/SimpleExpression.java
+++ b/base/common/src/com/netscape/cmscore/policy/SimpleExpression.java
@@ -30,9 +30,9 @@ import com.netscape.cmscore.util.Debug;
/**
* This class represents an expression of the form var = val,
* var != val, var < val, var > val, var <= val, var >= val.
- *
+ *
* Expressions are used as predicates for policy selection.
- *
+ *
* @deprecated
* @author kanda
* @version $Revision$, $Date$
@@ -46,7 +46,7 @@ public class SimpleExpression implements IExpression {
private boolean hasWildCard;
public static final char WILDCARD_CHAR = '*';
- // This is just for indicating a null expression.
+ // This is just for indicating a null expression.
public static SimpleExpression NULL_EXPRESSION = new SimpleExpression("null", OP_EQUAL, "null");
public static IExpression parse(String input)