com.netscape.cms.policy
Class APolicyRule

java.lang.Object
  extended by com.netscape.cms.policy.APolicyRule
All Implemented Interfaces:
IPolicyRule, IPolicy
Direct Known Subclasses:
AgentPolicy, AttributePresentConstraints, AuthInfoAccessExt, AuthorityKeyIdentifierExt, BasicConstraintsExt, CertificatePoliciesExt, CertificateRenewalWindowExt, CertificateScopeOfUseExt, CRLDistributionPointsExt, DefaultRevocation, DSAKeyConstraints, ExtendedKeyUsageExt, GenericASN1Ext, IssuerAltNameExt, IssuerConstraints, KeyAlgorithmConstraints, KeyUsageExt, ManualAuthentication, NameConstraintsExt, NSCCommentExt, NSCertTypeExt, OCSPNoCheckExt, PolicyConstraintsExt, PolicyMappingsExt, PresenceExt, PrivateKeyUsagePeriodExt, RemoveBasicConstraintsExt, RenewalConstraints, RenewalValidityConstraints, RevocationConstraints, RSAKeyConstraints, SigningAlgorithmConstraints, SubCANameConstraints, SubjAltNameExt, SubjectAltNameExt, SubjectDirectoryAttributesExt, SubjectKeyIdentifierExt, UniqueSubjectNameConstraints, ValidityConstraints

Deprecated.

public abstract class APolicyRule
extends java.lang.Object
implements IPolicyRule

The abstract policy rule that concrete implementations will extend.

 NOTE:  The Policy Framework has been replaced by the Profile Framework.
 

Version:
$Revision: 1226 $, $Date: 2010-08-19 14:16:41 -0700 (Thu, 19 Aug 2010) $

Field Summary
protected  java.lang.String DESC
          Deprecated.  
protected  IExpression mFilterExp
          Deprecated.  
protected  java.lang.String mInstanceName
          Deprecated.  
protected  ILogger mLogger
          Deprecated.  
protected  java.lang.String NAME
          Deprecated.  
 
Fields inherited from interface com.netscape.certsrv.policy.IPolicyRule
PROP_ENABLE, PROP_IMPLNAME, PROP_PREDICATE
 
Constructor Summary
APolicyRule()
          Deprecated.  
 
Method Summary
protected  boolean agentApproved(IRequest req)
          Deprecated. request has previously been approved by an agent
abstract  PolicyResult apply(IRequest req)
          Deprecated. Applies the policy on the given Request.
static netscape.security.x509.KeyIdentifier createKeyIdentifier(netscape.security.x509.X509Key key)
          Deprecated.  
protected  PolicyResult deferred(IRequest req)
          Deprecated. determines whether a DEFERRED policy result should be returned by checking the contents of the AgentApprovals attribute.
protected  netscape.security.x509.KeyIdentifier formSHA1KeyId(netscape.security.x509.X509CertInfo certInfo)
          Deprecated. Form a byte array of octet string key identifier from the sha-1 hash of the Subject Public Key BIT STRING.
protected  netscape.security.x509.KeyIdentifier formSpkiSHA1KeyId(netscape.security.x509.X509CertInfo certInfo)
          Deprecated. Form a byte array of octet string key identifier from the sha-1 hash of the Subject Public Key INFO.
abstract  java.util.Vector getDefaultParams()
          Deprecated. Return default parameters for a policy implementation.
 java.lang.String getDescription()
          Deprecated. Gets the description for this policy rule.
 java.lang.String getInstanceName()
          Deprecated. Returns the name of the policy rule instance.
abstract  java.util.Vector getInstanceParams()
          Deprecated. Return configured parameters for a policy rule instance.
 java.lang.String getName()
          Deprecated. Returns the name of the policy rule.
 IExpression getPredicate()
          Deprecated. Returns the predicate expression for the rule.
abstract  void init(ISubsystem owner, IConfigStore config)
          Deprecated. Initializes the policy rule.
protected  void log(int level, java.lang.String msg)
          Deprecated. log a message for this policy rule.
 void setError(IRequest req, java.lang.String format, java.lang.Object[] params)
          Deprecated.  
 void setError(IRequest req, java.lang.String format, java.lang.String arg)
          Deprecated.  
 void setError(IRequest req, java.lang.String format, java.lang.String arg1, java.lang.String arg2)
          Deprecated.  
 void setInstanceName(java.lang.String instanceName)
          Deprecated. Sets the instance name for a policy rule.
 void setPolicyException(IRequest req, EBaseException ex)
          Deprecated.  
 void setPolicyException(IRequest req, java.lang.String format, java.lang.Object[] params)
          Deprecated.  
 void setPredicate(IExpression exp)
          Deprecated. Sets a predicate expression for rule matching.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

protected java.lang.String NAME
Deprecated. 

DESC

protected java.lang.String DESC
Deprecated. 

mFilterExp

protected IExpression mFilterExp
Deprecated. 

mInstanceName

protected java.lang.String mInstanceName
Deprecated. 

mLogger

protected ILogger mLogger
Deprecated. 
Constructor Detail

APolicyRule

public APolicyRule()
Deprecated. 
Method Detail

init

public abstract void init(ISubsystem owner,
                          IConfigStore config)
                   throws EBaseException
Deprecated. 
Initializes the policy rule.

Specified by:
init in interface IPolicyRule
Parameters:
config - The config store reference
Throws:
EBaseException

getDescription

public java.lang.String getDescription()
Deprecated. 
Gets the description for this policy rule.

Specified by:
getDescription in interface IPolicyRule
Returns:
The Description for this rule.

setPredicate

public void setPredicate(IExpression exp)
Deprecated. 
Sets a predicate expression for rule matching.

Specified by:
setPredicate in interface IPolicyRule
Parameters:
exp - The predicate expression for the rule.

getPredicate

public IExpression getPredicate()
Deprecated. 
Returns the predicate expression for the rule.

Specified by:
getPredicate in interface IPolicyRule
Returns:
The predicate expression for the rule.

getName

public java.lang.String getName()
Deprecated. 
Returns the name of the policy rule.

Specified by:
getName in interface IPolicyRule
Returns:
The name of the policy class.

setInstanceName

public void setInstanceName(java.lang.String instanceName)
Deprecated. 
Sets the instance name for a policy rule.

Specified by:
setInstanceName in interface IPolicyRule
Parameters:
instanceName - The name of the rule instance.

getInstanceName

public java.lang.String getInstanceName()
Deprecated. 
Returns the name of the policy rule instance.

Specified by:
getInstanceName in interface IPolicyRule
Returns:
The name of the policy rule instance if set, else the name of the rule class.

apply

public abstract PolicyResult apply(IRequest req)
Deprecated. 
Applies the policy on the given Request.

Specified by:
apply in interface IPolicyRule
Specified by:
apply in interface IPolicy
Parameters:
req - The request on which to apply policy.
Returns:
The policy result object.

getInstanceParams

public abstract java.util.Vector getInstanceParams()
Deprecated. 
Return configured parameters for a policy rule instance.

Specified by:
getInstanceParams in interface IPolicyRule
Returns:
nvPairs A Vector of name/value pairs.

getDefaultParams

public abstract java.util.Vector getDefaultParams()
Deprecated. 
Return default parameters for a policy implementation.

Specified by:
getDefaultParams in interface IPolicyRule
Returns:
nvPairs A Vector of name/value pairs.

setError

public void setError(IRequest req,
                     java.lang.String format,
                     java.lang.Object[] params)
Deprecated. 
Specified by:
setError in interface IPolicyRule

setError

public void setError(IRequest req,
                     java.lang.String format,
                     java.lang.String arg1,
                     java.lang.String arg2)
Deprecated. 

setError

public void setError(IRequest req,
                     java.lang.String format,
                     java.lang.String arg)
Deprecated. 

setPolicyException

public void setPolicyException(IRequest req,
                               EBaseException ex)
Deprecated. 
Specified by:
setPolicyException in interface IPolicyRule

deferred

protected PolicyResult deferred(IRequest req)
Deprecated. 
determines whether a DEFERRED policy result should be returned by checking the contents of the AgentApprovals attribute. This call should be used by policy modules instead of returning PolicyResult.DEFERRED directly.


agentApproved

protected boolean agentApproved(IRequest req)
Deprecated. 
request has previously been approved by an agent


setPolicyException

public void setPolicyException(IRequest req,
                               java.lang.String format,
                               java.lang.Object[] params)
Deprecated. 

log

protected void log(int level,
                   java.lang.String msg)
Deprecated. 
log a message for this policy rule.


createKeyIdentifier

public static netscape.security.x509.KeyIdentifier createKeyIdentifier(netscape.security.x509.X509Key key)
                                                                throws java.security.NoSuchAlgorithmException,
                                                                       java.security.InvalidKeyException
Deprecated. 
Throws:
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException

formSpkiSHA1KeyId

protected netscape.security.x509.KeyIdentifier formSpkiSHA1KeyId(netscape.security.x509.X509CertInfo certInfo)
                                                          throws EBaseException
Deprecated. 
Form a byte array of octet string key identifier from the sha-1 hash of the Subject Public Key INFO. (including algorithm ID, etc.)

Parameters:
certInfo - cert info of the certificate.
Returns:
A Key identifier with the sha-1 hash of subject public key.
Throws:
EBaseException

formSHA1KeyId

protected netscape.security.x509.KeyIdentifier formSHA1KeyId(netscape.security.x509.X509CertInfo certInfo)
                                                      throws EBaseException
Deprecated. 
Form a byte array of octet string key identifier from the sha-1 hash of the Subject Public Key BIT STRING.

Parameters:
certInfo - cert info of the certificate.
Returns:
A Key identifier with the sha-1 hash of subject public key.
Throws:
EBaseException