com.netscape.cms.profile.constraint
Class EnrollConstraint

java.lang.Object
  extended by com.netscape.cms.profile.constraint.EnrollConstraint
All Implemented Interfaces:
IPolicyConstraint, IConfigTemplate
Direct Known Subclasses:
BasicConstraintsExtConstraint, CAEnrollConstraint, ExtendedKeyUsageExtConstraint, ExtensionConstraint, KeyConstraint, KeyUsageExtConstraint, NSCertTypeExtConstraint, RenewGracePeriodConstraint, SigningAlgConstraint, SubjectNameConstraint, UniqueKeyConstraint, UniqueSubjectNameConstraint, ValidityConstraint

public abstract class EnrollConstraint
extends java.lang.Object
implements IPolicyConstraint

This class implements the generic enrollment constraint.

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $

Field Summary
static java.lang.String CONFIG_NAME
           
protected  IConfigStore mConfig
           
protected  java.util.Vector mConfigNames
           
 
Constructor Summary
EnrollConstraint()
           
 
Method Summary
 void addConfigName(java.lang.String name)
           
protected  boolean getBoolean(java.lang.String value)
           
 java.lang.String getConfig(java.lang.String name)
          Retrieves configuration parameter by name.
protected  boolean getConfigBoolean(java.lang.String value)
           
 IDescriptor getConfigDescriptor(java.util.Locale locale, java.lang.String name)
          Returns the descriptors of configuration parameter.
protected  int getConfigInt(java.lang.String value)
           
 java.util.Enumeration getConfigNames()
          Returns a list of configuration parameter names.
 IConfigStore getConfigStore()
          Returns the corresponding configuration store of this constraint policy.
protected  netscape.security.x509.Extension getExtension(java.lang.String name, netscape.security.x509.X509CertInfo info)
           
protected  int getInt(java.lang.String value)
           
 java.util.Locale getLocale(IRequest request)
           
 java.lang.String getName(java.util.Locale locale)
          Returns localized name of this constraint.
 java.lang.String getText(java.util.Locale locale)
          Returns localized description of this constraint.
 IDescriptor getValueDescriptor(java.util.Locale locale, java.lang.String name)
           
 void init(IProfile profile, IConfigStore config)
          Initializes this constraint policy.
 boolean isApplicable(IPolicyDefault def)
          Checks if this constraint is applicable to the given default policy.
protected  boolean isOptional(java.lang.String value)
           
 void setConfig(java.lang.String name, java.lang.String value)
          Sets configuration parameter.
 void validate(IRequest request)
          Validates the request.
abstract  void validate(IRequest request, netscape.security.x509.X509CertInfo info)
          Validates the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_NAME

public static final java.lang.String CONFIG_NAME
See Also:
Constant Field Values

mConfig

protected IConfigStore mConfig

mConfigNames

protected java.util.Vector mConfigNames
Constructor Detail

EnrollConstraint

public EnrollConstraint()
Method Detail

getConfigNames

public java.util.Enumeration getConfigNames()
Description copied from interface: IConfigTemplate
Returns a list of configuration parameter names.

Specified by:
getConfigNames in interface IConfigTemplate
Returns:
parameter names

addConfigName

public void addConfigName(java.lang.String name)

getConfigDescriptor

public IDescriptor getConfigDescriptor(java.util.Locale locale,
                                       java.lang.String name)
Description copied from interface: IConfigTemplate
Returns the descriptors of configuration parameter.

Specified by:
getConfigDescriptor in interface IConfigTemplate
Parameters:
locale - user locale
name - configuration parameter name
Returns:
descriptor

getValueDescriptor

public IDescriptor getValueDescriptor(java.util.Locale locale,
                                      java.lang.String name)

getLocale

public java.util.Locale getLocale(IRequest request)

setConfig

public void setConfig(java.lang.String name,
                      java.lang.String value)
               throws EPropertyException
Description copied from interface: IConfigTemplate
Sets configuration parameter.

Specified by:
setConfig in interface IConfigTemplate
Parameters:
name - parameter name
value - parameter value
Throws:
EPropertyException - failed to set parameter

getConfig

public java.lang.String getConfig(java.lang.String name)
Description copied from interface: IConfigTemplate
Retrieves configuration parameter by name.

Specified by:
getConfig in interface IConfigTemplate
Returns:
parameter

init

public void init(IProfile profile,
                 IConfigStore config)
          throws EProfileException
Description copied from interface: IPolicyConstraint
Initializes this constraint policy.

Specified by:
init in interface IPolicyConstraint
Parameters:
profile - owner of this policy
config - configuration store for this constraint
Throws:
EProfileException - failed to initialize

getConfigStore

public IConfigStore getConfigStore()
Description copied from interface: IPolicyConstraint
Returns the corresponding configuration store of this constraint policy.

Specified by:
getConfigStore in interface IPolicyConstraint
Returns:
config store of this constraint

validate

public abstract void validate(IRequest request,
                              netscape.security.x509.X509CertInfo info)
                       throws ERejectException
Validates the request. The request is not modified during the validation.

Parameters:
request - enrollment request
info - certificate template
Throws:
ERejectException - request is rejected due to violation of constraint

validate

public void validate(IRequest request)
              throws ERejectException
Validates the request. The request is not modified during the validation. The current implementation of this method calls into the subclass's validate(request, info) method for validation checking.

Specified by:
validate in interface IPolicyConstraint
Parameters:
request - request
Throws:
ERejectException - request is rejected due to violation of constraint

getText

public java.lang.String getText(java.util.Locale locale)
Description copied from interface: IPolicyConstraint
Returns localized description of this constraint.

Specified by:
getText in interface IPolicyConstraint
Parameters:
locale - locale of the end-user
Returns:
localized description of this constraint

getName

public java.lang.String getName(java.util.Locale locale)
Description copied from interface: IPolicyConstraint
Returns localized name of this constraint.

Specified by:
getName in interface IPolicyConstraint
Parameters:
locale - locale of the end-user
Returns:
localized name of this constraint

getExtension

protected netscape.security.x509.Extension getExtension(java.lang.String name,
                                                        netscape.security.x509.X509CertInfo info)

isOptional

protected boolean isOptional(java.lang.String value)

getBoolean

protected boolean getBoolean(java.lang.String value)

getInt

protected int getInt(java.lang.String value)

getConfigBoolean

protected boolean getConfigBoolean(java.lang.String value)

getConfigInt

protected int getConfigInt(java.lang.String value)

isApplicable

public boolean isApplicable(IPolicyDefault def)
Description copied from interface: IPolicyConstraint
Checks if this constraint is applicable to the given default policy.

Specified by:
isApplicable in interface IPolicyConstraint
Parameters:
def - default policy to be checked
Returns:
true if this constraint can be applied to the given default policy