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.ldap.schema.AttributeType;
025import org.forgerock.opendj.server.config.server.AttributeValuePasswordValidatorCfg;
026
027
028
029/**
030 * A client-side interface for reading and modifying Attribute Value
031 * Password Validator settings.
032 * <p>
033 * The Attribute Value Password Validator attempts to determine
034 * whether a proposed password is acceptable for use by determining
035 * whether that password is contained in any attribute within the
036 * user's entry.
037 */
038public interface AttributeValuePasswordValidatorCfgClient extends PasswordValidatorCfgClient {
039
040  /**
041   * Get the configuration definition associated with this Attribute Value Password Validator.
042   *
043   * @return Returns the configuration definition associated with this Attribute Value Password Validator.
044   */
045  ManagedObjectDefinition<? extends AttributeValuePasswordValidatorCfgClient, ? extends AttributeValuePasswordValidatorCfg> definition();
046
047
048
049  /**
050   * Gets the "check-substrings" property.
051   * <p>
052   * Indicates whether this password validator is to match portions of
053   * the password string against attribute values.
054   * <p>
055   * If "false" then only match the entire password against attribute
056   * values otherwise ("true") check whether the password contains
057   * attribute values.
058   *
059   * @return Returns the value of the "check-substrings" property.
060   */
061  boolean isCheckSubstrings();
062
063
064
065  /**
066   * Sets the "check-substrings" property.
067   * <p>
068   * Indicates whether this password validator is to match portions of
069   * the password string against attribute values.
070   * <p>
071   * If "false" then only match the entire password against attribute
072   * values otherwise ("true") check whether the password contains
073   * attribute values.
074   *
075   * @param value The value of the "check-substrings" property.
076   * @throws PropertyException
077   *           If the new value is invalid.
078   */
079  void setCheckSubstrings(Boolean value) throws PropertyException;
080
081
082
083  /**
084   * Gets the "java-class" property.
085   * <p>
086   * Specifies the fully-qualified name of the Java class that
087   * provides the password validator implementation.
088   *
089   * @return Returns the value of the "java-class" property.
090   */
091  String getJavaClass();
092
093
094
095  /**
096   * Sets the "java-class" property.
097   * <p>
098   * Specifies the fully-qualified name of the Java class that
099   * provides the password validator implementation.
100   *
101   * @param value The value of the "java-class" property.
102   * @throws PropertyException
103   *           If the new value is invalid.
104   */
105  void setJavaClass(String value) throws PropertyException;
106
107
108
109  /**
110   * Gets the "match-attribute" property.
111   * <p>
112   * Specifies the name(s) of the attribute(s) whose values should be
113   * checked to determine whether they match the provided password. If
114   * no values are provided, then the server checks if the proposed
115   * password matches the value of any attribute in the user's entry.
116   *
117   * @return Returns the values of the "match-attribute" property.
118   */
119  SortedSet<AttributeType> getMatchAttribute();
120
121
122
123  /**
124   * Sets the "match-attribute" property.
125   * <p>
126   * Specifies the name(s) of the attribute(s) whose values should be
127   * checked to determine whether they match the provided password. If
128   * no values are provided, then the server checks if the proposed
129   * password matches the value of any attribute in the user's entry.
130   *
131   * @param values The values of the "match-attribute" property.
132   * @throws PropertyException
133   *           If one or more of the new values are invalid.
134   */
135  void setMatchAttribute(Collection<AttributeType> values) throws PropertyException;
136
137
138
139  /**
140   * Gets the "min-substring-length" property.
141   * <p>
142   * Indicates the minimal length of the substring within the password
143   * in case substring checking is enabled.
144   * <p>
145   * If "check-substrings" option is set to true, then this parameter
146   * defines the length of the smallest word which should be used for
147   * substring matching. Use with caution because values below 3 might
148   * disqualify valid passwords.
149   *
150   * @return Returns the value of the "min-substring-length" property.
151   */
152  int getMinSubstringLength();
153
154
155
156  /**
157   * Sets the "min-substring-length" property.
158   * <p>
159   * Indicates the minimal length of the substring within the password
160   * in case substring checking is enabled.
161   * <p>
162   * If "check-substrings" option is set to true, then this parameter
163   * defines the length of the smallest word which should be used for
164   * substring matching. Use with caution because values below 3 might
165   * disqualify valid passwords.
166   *
167   * @param value The value of the "min-substring-length" property.
168   * @throws PropertyException
169   *           If the new value is invalid.
170   */
171  void setMinSubstringLength(Integer value) throws PropertyException;
172
173
174
175  /**
176   * Gets the "test-reversed-password" property.
177   * <p>
178   * Indicates whether this password validator should test the
179   * reversed value of the provided password as well as the order in
180   * which it was given.
181   *
182   * @return Returns the value of the "test-reversed-password" property.
183   */
184  Boolean isTestReversedPassword();
185
186
187
188  /**
189   * Sets the "test-reversed-password" property.
190   * <p>
191   * Indicates whether this password validator should test the
192   * reversed value of the provided password as well as the order in
193   * which it was given.
194   *
195   * @param value The value of the "test-reversed-password" property.
196   * @throws PropertyException
197   *           If the new value is invalid.
198   */
199  void setTestReversedPassword(boolean value) throws PropertyException;
200
201}