001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2008 Sun Microsystems, Inc.
025 */
026package org.opends.server.admin.std.server;
027
028
029
030import java.util.SortedSet;
031import org.opends.server.admin.server.ConfigurationChangeListener;
032
033
034
035/**
036 * A server-side interface for querying Character Set Password
037 * Validator settings.
038 * <p>
039 * The Character Set Password Validator determines whether a proposed
040 * password is acceptable by checking whether it contains a sufficient
041 * number of characters from one or more user-defined character sets
042 * and ranges.
043 */
044public interface CharacterSetPasswordValidatorCfg extends PasswordValidatorCfg {
045
046  /**
047   * Gets the configuration class associated with this Character Set Password Validator.
048   *
049   * @return Returns the configuration class associated with this Character Set Password Validator.
050   */
051  Class<? extends CharacterSetPasswordValidatorCfg> configurationClass();
052
053
054
055  /**
056   * Register to be notified when this Character Set Password Validator is changed.
057   *
058   * @param listener
059   *          The Character Set Password Validator configuration change listener.
060   */
061  void addCharacterSetChangeListener(ConfigurationChangeListener<CharacterSetPasswordValidatorCfg> listener);
062
063
064
065  /**
066   * Deregister an existing Character Set Password Validator configuration change listener.
067   *
068   * @param listener
069   *          The Character Set Password Validator configuration change listener.
070   */
071  void removeCharacterSetChangeListener(ConfigurationChangeListener<CharacterSetPasswordValidatorCfg> listener);
072
073
074
075  /**
076   * Gets the "allow-unclassified-characters" property.
077   * <p>
078   * Indicates whether this password validator allows passwords to
079   * contain characters outside of any of the user-defined character
080   * sets and ranges.
081   * <p>
082   * If this is "false", then only those characters in the
083   * user-defined character sets and ranges may be used in passwords.
084   * Any password containing a character not included in any character
085   * set or range will be rejected.
086   *
087   * @return Returns the value of the "allow-unclassified-characters" property.
088   */
089  boolean isAllowUnclassifiedCharacters();
090
091
092
093  /**
094   * Gets the "character-set" property.
095   * <p>
096   * Specifies a character set containing characters that a password
097   * may contain and a value indicating the minimum number of
098   * characters required from that set.
099   * <p>
100   * Each value must be an integer (indicating the minimum required
101   * characters from the set which may be zero, indicating that the
102   * character set is optional) followed by a colon and the characters
103   * to include in that set (for example,
104   * "3:abcdefghijklmnopqrstuvwxyz" indicates that a user password must
105   * contain at least three characters from the set of lowercase ASCII
106   * letters). Multiple character sets can be defined in separate
107   * values, although no character can appear in more than one
108   * character set.
109   *
110   * @return Returns an unmodifiable set containing the values of the "character-set" property.
111   */
112  SortedSet<String> getCharacterSet();
113
114
115
116  /**
117   * Gets the "character-set-ranges" property.
118   * <p>
119   * Specifies a character range containing characters that a password
120   * may contain and a value indicating the minimum number of
121   * characters required from that range.
122   * <p>
123   * Each value must be an integer (indicating the minimum required
124   * characters from the range which may be zero, indicating that the
125   * character range is optional) followed by a colon and one or more
126   * range specifications. A range specification is 3 characters: the
127   * first character allowed, a minus, and the last character allowed.
128   * For example, "3:A-Za-z0-9". The ranges in each value should not
129   * overlap, and the characters in each range specification should be
130   * ordered.
131   *
132   * @return Returns an unmodifiable set containing the values of the "character-set-ranges" property.
133   */
134  SortedSet<String> getCharacterSetRanges();
135
136
137
138  /**
139   * Gets the "java-class" property.
140   * <p>
141   * Specifies the fully-qualified name of the Java class that
142   * provides the password validator implementation.
143   *
144   * @return Returns the value of the "java-class" property.
145   */
146  String getJavaClass();
147
148
149
150  /**
151   * Gets the "min-character-sets" property.
152   * <p>
153   * Specifies the minimum number of character sets and ranges that a
154   * password must contain.
155   * <p>
156   * This property should only be used in conjunction with optional
157   * character sets and ranges (those requiring zero characters). Its
158   * value must include any mandatory character sets and ranges (those
159   * requiring greater than zero characters). This is useful in
160   * situations where a password must contain characters from mandatory
161   * character sets and ranges, and characters from at least N optional
162   * character sets and ranges. For example, it is quite common to
163   * require that a password contains at least one non-alphanumeric
164   * character as well as characters from two alphanumeric character
165   * sets (lower-case, upper-case, digits). In this case, this property
166   * should be set to 3.
167   *
168   * @return Returns the value of the "min-character-sets" property.
169   */
170  Integer getMinCharacterSets();
171
172}