001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008 Sun Microsystems, Inc.
015 */
016package org.forgerock.opendj.server.config.client;
017
018
019
020import java.util.Collection;
021import java.util.SortedSet;
022import org.forgerock.opendj.config.ManagedObjectDefinition;
023import org.forgerock.opendj.config.PropertyException;
024import org.forgerock.opendj.server.config.server.CharacterSetPasswordValidatorCfg;
025
026
027
028/**
029 * A client-side interface for reading and modifying Character Set
030 * Password Validator settings.
031 * <p>
032 * The Character Set Password Validator determines whether a proposed
033 * password is acceptable by checking whether it contains a sufficient
034 * number of characters from one or more user-defined character sets
035 * and ranges.
036 */
037public interface CharacterSetPasswordValidatorCfgClient extends PasswordValidatorCfgClient {
038
039  /**
040   * Get the configuration definition associated with this Character Set Password Validator.
041   *
042   * @return Returns the configuration definition associated with this Character Set Password Validator.
043   */
044  ManagedObjectDefinition<? extends CharacterSetPasswordValidatorCfgClient, ? extends CharacterSetPasswordValidatorCfg> definition();
045
046
047
048  /**
049   * Gets the "allow-unclassified-characters" property.
050   * <p>
051   * Indicates whether this password validator allows passwords to
052   * contain characters outside of any of the user-defined character
053   * sets and ranges.
054   * <p>
055   * If this is "false", then only those characters in the
056   * user-defined character sets and ranges may be used in passwords.
057   * Any password containing a character not included in any character
058   * set or range will be rejected.
059   *
060   * @return Returns the value of the "allow-unclassified-characters" property.
061   */
062  Boolean isAllowUnclassifiedCharacters();
063
064
065
066  /**
067   * Sets the "allow-unclassified-characters" property.
068   * <p>
069   * Indicates whether this password validator allows passwords to
070   * contain characters outside of any of the user-defined character
071   * sets and ranges.
072   * <p>
073   * If this is "false", then only those characters in the
074   * user-defined character sets and ranges may be used in passwords.
075   * Any password containing a character not included in any character
076   * set or range will be rejected.
077   *
078   * @param value The value of the "allow-unclassified-characters" property.
079   * @throws PropertyException
080   *           If the new value is invalid.
081   */
082  void setAllowUnclassifiedCharacters(boolean value) throws PropertyException;
083
084
085
086  /**
087   * Gets the "character-set" property.
088   * <p>
089   * Specifies a character set containing characters that a password
090   * may contain and a value indicating the minimum number of
091   * characters required from that set.
092   * <p>
093   * Each value must be an integer (indicating the minimum required
094   * characters from the set which may be zero, indicating that the
095   * character set is optional) followed by a colon and the characters
096   * to include in that set (for example,
097   * "3:abcdefghijklmnopqrstuvwxyz" indicates that a user password must
098   * contain at least three characters from the set of lowercase ASCII
099   * letters). Multiple character sets can be defined in separate
100   * values, although no character can appear in more than one
101   * character set.
102   *
103   * @return Returns the values of the "character-set" property.
104   */
105  SortedSet<String> getCharacterSet();
106
107
108
109  /**
110   * Sets the "character-set" property.
111   * <p>
112   * Specifies a character set containing characters that a password
113   * may contain and a value indicating the minimum number of
114   * characters required from that set.
115   * <p>
116   * Each value must be an integer (indicating the minimum required
117   * characters from the set which may be zero, indicating that the
118   * character set is optional) followed by a colon and the characters
119   * to include in that set (for example,
120   * "3:abcdefghijklmnopqrstuvwxyz" indicates that a user password must
121   * contain at least three characters from the set of lowercase ASCII
122   * letters). Multiple character sets can be defined in separate
123   * values, although no character can appear in more than one
124   * character set.
125   *
126   * @param values The values of the "character-set" property.
127   * @throws PropertyException
128   *           If one or more of the new values are invalid.
129   */
130  void setCharacterSet(Collection<String> values) throws PropertyException;
131
132
133
134  /**
135   * Gets the "character-set-ranges" property.
136   * <p>
137   * Specifies a character range containing characters that a password
138   * may contain and a value indicating the minimum number of
139   * characters required from that range.
140   * <p>
141   * Each value must be an integer (indicating the minimum required
142   * characters from the range which may be zero, indicating that the
143   * character range is optional) followed by a colon and one or more
144   * range specifications. A range specification is 3 characters: the
145   * first character allowed, a minus, and the last character allowed.
146   * For example, "3:A-Za-z0-9". The ranges in each value should not
147   * overlap, and the characters in each range specification should be
148   * ordered.
149   *
150   * @return Returns the values of the "character-set-ranges" property.
151   */
152  SortedSet<String> getCharacterSetRanges();
153
154
155
156  /**
157   * Sets the "character-set-ranges" property.
158   * <p>
159   * Specifies a character range containing characters that a password
160   * may contain and a value indicating the minimum number of
161   * characters required from that range.
162   * <p>
163   * Each value must be an integer (indicating the minimum required
164   * characters from the range which may be zero, indicating that the
165   * character range is optional) followed by a colon and one or more
166   * range specifications. A range specification is 3 characters: the
167   * first character allowed, a minus, and the last character allowed.
168   * For example, "3:A-Za-z0-9". The ranges in each value should not
169   * overlap, and the characters in each range specification should be
170   * ordered.
171   *
172   * @param values The values of the "character-set-ranges" property.
173   * @throws PropertyException
174   *           If one or more of the new values are invalid.
175   */
176  void setCharacterSetRanges(Collection<String> values) throws PropertyException;
177
178
179
180  /**
181   * Gets the "java-class" property.
182   * <p>
183   * Specifies the fully-qualified name of the Java class that
184   * provides the password validator implementation.
185   *
186   * @return Returns the value of the "java-class" property.
187   */
188  String getJavaClass();
189
190
191
192  /**
193   * Sets the "java-class" property.
194   * <p>
195   * Specifies the fully-qualified name of the Java class that
196   * provides the password validator implementation.
197   *
198   * @param value The value of the "java-class" property.
199   * @throws PropertyException
200   *           If the new value is invalid.
201   */
202  void setJavaClass(String value) throws PropertyException;
203
204
205
206  /**
207   * Gets the "min-character-sets" property.
208   * <p>
209   * Specifies the minimum number of character sets and ranges that a
210   * password must contain.
211   * <p>
212   * This property should only be used in conjunction with optional
213   * character sets and ranges (those requiring zero characters). Its
214   * value must include any mandatory character sets and ranges (those
215   * requiring greater than zero characters). This is useful in
216   * situations where a password must contain characters from mandatory
217   * character sets and ranges, and characters from at least N optional
218   * character sets and ranges. For example, it is quite common to
219   * require that a password contains at least one non-alphanumeric
220   * character as well as characters from two alphanumeric character
221   * sets (lower-case, upper-case, digits). In this case, this property
222   * should be set to 3.
223   *
224   * @return Returns the value of the "min-character-sets" property.
225   */
226  Integer getMinCharacterSets();
227
228
229
230  /**
231   * Sets the "min-character-sets" property.
232   * <p>
233   * Specifies the minimum number of character sets and ranges that a
234   * password must contain.
235   * <p>
236   * This property should only be used in conjunction with optional
237   * character sets and ranges (those requiring zero characters). Its
238   * value must include any mandatory character sets and ranges (those
239   * requiring greater than zero characters). This is useful in
240   * situations where a password must contain characters from mandatory
241   * character sets and ranges, and characters from at least N optional
242   * character sets and ranges. For example, it is quite common to
243   * require that a password contains at least one non-alphanumeric
244   * character as well as characters from two alphanumeric character
245   * sets (lower-case, upper-case, digits). In this case, this property
246   * should be set to 3.
247   *
248   * @param value The value of the "min-character-sets" property.
249   * @throws PropertyException
250   *           If the new value is invalid.
251   */
252  void setMinCharacterSets(Integer value) throws PropertyException;
253
254}