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.RandomPasswordGeneratorCfg; 025 026 027 028/** 029 * A client-side interface for reading and modifying Random Password 030 * Generator settings. 031 * <p> 032 * The Random Password Generator creates random passwords based on 033 * fixed-length strings built from one or more character sets. 034 */ 035public interface RandomPasswordGeneratorCfgClient extends PasswordGeneratorCfgClient { 036 037 /** 038 * Get the configuration definition associated with this Random Password Generator. 039 * 040 * @return Returns the configuration definition associated with this Random Password Generator. 041 */ 042 ManagedObjectDefinition<? extends RandomPasswordGeneratorCfgClient, ? extends RandomPasswordGeneratorCfg> definition(); 043 044 045 046 /** 047 * Gets the "java-class" property. 048 * <p> 049 * Specifies the fully-qualified name of the Java class that 050 * provides the Random Password Generator implementation. 051 * 052 * @return Returns the value of the "java-class" property. 053 */ 054 String getJavaClass(); 055 056 057 058 /** 059 * Sets the "java-class" property. 060 * <p> 061 * Specifies the fully-qualified name of the Java class that 062 * provides the Random Password Generator implementation. 063 * 064 * @param value The value of the "java-class" property. 065 * @throws PropertyException 066 * If the new value is invalid. 067 */ 068 void setJavaClass(String value) throws PropertyException; 069 070 071 072 /** 073 * Gets the "password-character-set" property. 074 * <p> 075 * Specifies one or more named character sets. 076 * <p> 077 * This is a multi-valued property, with each value defining a 078 * different character set. The format of the character set is the 079 * name of the set followed by a colon and the characters that are in 080 * that set. For example, the value 081 * "alpha:abcdefghijklmnopqrstuvwxyz" defines a character set named 082 * "alpha" containing all of the lower-case ASCII alphabetic 083 * characters. 084 * 085 * @return Returns the values of the "password-character-set" property. 086 */ 087 SortedSet<String> getPasswordCharacterSet(); 088 089 090 091 /** 092 * Sets the "password-character-set" property. 093 * <p> 094 * Specifies one or more named character sets. 095 * <p> 096 * This is a multi-valued property, with each value defining a 097 * different character set. The format of the character set is the 098 * name of the set followed by a colon and the characters that are in 099 * that set. For example, the value 100 * "alpha:abcdefghijklmnopqrstuvwxyz" defines a character set named 101 * "alpha" containing all of the lower-case ASCII alphabetic 102 * characters. 103 * 104 * @param values The values of the "password-character-set" property. 105 * @throws PropertyException 106 * If one or more of the new values are invalid. 107 */ 108 void setPasswordCharacterSet(Collection<String> values) throws PropertyException; 109 110 111 112 /** 113 * Gets the "password-format" property. 114 * <p> 115 * Specifies the format to use for the generated password. 116 * <p> 117 * The value is a comma-delimited list of elements in which each of 118 * those elements is comprised of the name of a character set defined 119 * in the password-character-set property, a colon, and the number of 120 * characters to include from that set. For example, a value of 121 * "alpha:3,numeric:2,alpha:3" generates an 8-character password in 122 * which the first three characters are from the "alpha" set, the 123 * next two are from the "numeric" set, and the final three are from 124 * the "alpha" set. 125 * 126 * @return Returns the value of the "password-format" property. 127 */ 128 String getPasswordFormat(); 129 130 131 132 /** 133 * Sets the "password-format" property. 134 * <p> 135 * Specifies the format to use for the generated password. 136 * <p> 137 * The value is a comma-delimited list of elements in which each of 138 * those elements is comprised of the name of a character set defined 139 * in the password-character-set property, a colon, and the number of 140 * characters to include from that set. For example, a value of 141 * "alpha:3,numeric:2,alpha:3" generates an 8-character password in 142 * which the first three characters are from the "alpha" set, the 143 * next two are from the "numeric" set, and the final three are from 144 * the "alpha" set. 145 * 146 * @param value The value of the "password-format" property. 147 * @throws PropertyException 148 * If the new value is invalid. 149 */ 150 void setPasswordFormat(String value) throws PropertyException; 151 152}