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 Random Password Generator 037 * settings. 038 * <p> 039 * The Random Password Generator creates random passwords based on 040 * fixed-length strings built from one or more character sets. 041 */ 042public interface RandomPasswordGeneratorCfg extends PasswordGeneratorCfg { 043 044 /** 045 * Gets the configuration class associated with this Random Password Generator. 046 * 047 * @return Returns the configuration class associated with this Random Password Generator. 048 */ 049 Class<? extends RandomPasswordGeneratorCfg> configurationClass(); 050 051 052 053 /** 054 * Register to be notified when this Random Password Generator is changed. 055 * 056 * @param listener 057 * The Random Password Generator configuration change listener. 058 */ 059 void addRandomChangeListener(ConfigurationChangeListener<RandomPasswordGeneratorCfg> listener); 060 061 062 063 /** 064 * Deregister an existing Random Password Generator configuration change listener. 065 * 066 * @param listener 067 * The Random Password Generator configuration change listener. 068 */ 069 void removeRandomChangeListener(ConfigurationChangeListener<RandomPasswordGeneratorCfg> listener); 070 071 072 073 /** 074 * Gets the "java-class" property. 075 * <p> 076 * Specifies the fully-qualified name of the Java class that 077 * provides the Random Password Generator implementation. 078 * 079 * @return Returns the value of the "java-class" property. 080 */ 081 String getJavaClass(); 082 083 084 085 /** 086 * Gets the "password-character-set" property. 087 * <p> 088 * Specifies one or more named character sets. 089 * <p> 090 * This is a multi-valued property, with each value defining a 091 * different character set. The format of the character set is the 092 * name of the set followed by a colon and the characters that are in 093 * that set. For example, the value 094 * "alpha:abcdefghijklmnopqrstuvwxyz" defines a character set named 095 * "alpha" containing all of the lower-case ASCII alphabetic 096 * characters. 097 * 098 * @return Returns an unmodifiable set containing the values of the "password-character-set" property. 099 */ 100 SortedSet<String> getPasswordCharacterSet(); 101 102 103 104 /** 105 * Gets the "password-format" property. 106 * <p> 107 * Specifies the format to use for the generated password. 108 * <p> 109 * The value is a comma-delimited list of elements in which each of 110 * those elements is comprised of the name of a character set defined 111 * in the password-character-set property, a colon, and the number of 112 * characters to include from that set. For example, a value of 113 * "alpha:3,numeric:2,alpha:3" generates an 8-character password in 114 * which the first three characters are from the "alpha" set, the 115 * next two are from the "numeric" set, and the final three are from 116 * the "alpha" set. 117 * 118 * @return Returns the value of the "password-format" property. 119 */ 120 String getPasswordFormat(); 121 122}