Class PolicyConstraint

java.lang.Object
com.netscape.cms.profile.constraint.PolicyConstraint
All Implemented Interfaces:
IConfigTemplate

public abstract class PolicyConstraint extends Object implements IConfigTemplate
This represents a constraint policy. A constraint policy validates if the given request conforms to the set rules.

Version:
$Revision$, $Date$
  • Constructor Details

    • PolicyConstraint

      public PolicyConstraint()
  • Method Details

    • init

      public abstract void init(ConfigStore config) throws EProfileException
      Initializes this constraint policy.
      Parameters:
      config - configuration store for this constraint
      Throws:
      EProfileException - failed to initialize
    • getConfigStore

      public abstract ConfigStore getConfigStore()
      Returns the corresponding configuration store of this constraint policy.
      Returns:
      config store of this constraint
    • validate

      public abstract void validate(Request request) throws ERejectException
      Validates the request. The request is not modified during the validation.
      Parameters:
      request - request to be validated
      Throws:
      ERejectException - reject the given request
    • getText

      public abstract String getText(Locale locale)
      Returns localized description of this constraint.
      Parameters:
      locale - locale of the end-user
      Returns:
      localized description of this constraint
    • getName

      public abstract String getName(Locale locale)
      Returns localized name of this constraint.
      Parameters:
      locale - locale of the end-user
      Returns:
      localized name of this constraint
    • isApplicable

      public abstract boolean isApplicable(PolicyDefault def)
      Checks if this constraint is applicable to the given default policy.
      Parameters:
      def - default policy to be checked
      Returns:
      true if this constraint can be applied to the given default policy