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