Class ValidityConstraint
- java.lang.Object
-
- com.netscape.cms.profile.constraint.EnrollConstraint
-
- com.netscape.cms.profile.constraint.ValidityConstraint
-
- All Implemented Interfaces:
IPolicyConstraint
,IConfigTemplate
public class ValidityConstraint extends EnrollConstraint
This class implements the validity constraint. It checks if the validity in the certificate template satisfies the criteria.- Version:
- $Revision$, $Date$
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CONFIG_CHECK_NOT_AFTER
static java.lang.String
CONFIG_CHECK_NOT_BEFORE
static java.lang.String
CONFIG_NOT_BEFORE_GRACE_PERIOD
static java.lang.String
CONFIG_RANGE
static java.lang.String
CONFIG_RANGE_UNIT
static long
SECS_IN_MS
-
Fields inherited from class com.netscape.cms.profile.constraint.EnrollConstraint
CONFIG_NAME, CONFIG_PARAMS, mConfig, mConfigNames
-
-
Constructor Summary
Constructors Constructor Description ValidityConstraint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
convertRangeUnit(java.lang.String unit)
IDescriptor
getConfigDescriptor(java.util.Locale locale, java.lang.String name)
Returns the descriptors of configuration parameter.java.lang.String
getText(java.util.Locale locale)
Returns localized description of this constraint.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.void
setConfig(java.lang.String name, java.lang.String value)
Sets configuration parameter.void
validate(IRequest request, X509CertInfo info)
Validates the request.-
Methods inherited from class com.netscape.cms.profile.constraint.EnrollConstraint
addConfigName, getBoolean, getConfig, getConfig, getConfigBoolean, getConfigInt, getConfigNames, getConfigStore, getExtension, getInt, getLocale, getName, getValueDescriptor, isOptional, validate
-
-
-
-
Field Detail
-
CONFIG_RANGE
public static final java.lang.String CONFIG_RANGE
- See Also:
- Constant Field Values
-
CONFIG_RANGE_UNIT
public static final java.lang.String CONFIG_RANGE_UNIT
- See Also:
- Constant Field Values
-
CONFIG_NOT_BEFORE_GRACE_PERIOD
public static final java.lang.String CONFIG_NOT_BEFORE_GRACE_PERIOD
- See Also:
- Constant Field Values
-
CONFIG_CHECK_NOT_BEFORE
public static final java.lang.String CONFIG_CHECK_NOT_BEFORE
- See Also:
- Constant Field Values
-
CONFIG_CHECK_NOT_AFTER
public static final java.lang.String CONFIG_CHECK_NOT_AFTER
- See Also:
- Constant Field Values
-
SECS_IN_MS
public static final long SECS_IN_MS
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(IProfile profile, IConfigStore config) throws EProfileException
Description copied from interface:IPolicyConstraint
Initializes this constraint policy.- Specified by:
init
in interfaceIPolicyConstraint
- Overrides:
init
in classEnrollConstraint
- Parameters:
profile
- owner of this policyconfig
- configuration store for this constraint- Throws:
EProfileException
- failed to initialize
-
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 interfaceIConfigTemplate
- Overrides:
setConfig
in classEnrollConstraint
- Parameters:
name
- parameter namevalue
- parameter value- Throws:
EPropertyException
- failed to set parameter
-
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 interfaceIConfigTemplate
- Overrides:
getConfigDescriptor
in classEnrollConstraint
- Parameters:
locale
- user localename
- configuration parameter name- Returns:
- descriptor
-
convertRangeUnit
public int convertRangeUnit(java.lang.String unit) throws java.lang.Exception
- Throws:
java.lang.Exception
-
validate
public void validate(IRequest request, X509CertInfo info) throws ERejectException
Validates the request. The request is not modified during the validation.- Specified by:
validate
in classEnrollConstraint
- Parameters:
request
- enrollment requestinfo
- certificate template- 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 interfaceIPolicyConstraint
- Overrides:
getText
in classEnrollConstraint
- Parameters:
locale
- locale of the end-user- Returns:
- localized description of this constraint
-
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 interfaceIPolicyConstraint
- Overrides:
isApplicable
in classEnrollConstraint
- Parameters:
def
- default policy to be checked- Returns:
- true if this constraint can be applied to the given default policy
-
-