mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Nicolas Capponi
02.23.2013 b54a338f5933502809578214db03147c02e48b11
OpenDJ 3 : config framework

Reducing compilation errors in org.opends.server.admin packages

* Simple changes in org.opends.server.admin.server package
and org.opends.server.api package
** use i18n classes
** use Validator class from SDK
** remove API annotation

* Add stub classes DirectoryEnvironmentConfig and Embeddedutils

* Migrate generation of DynamicConstant class from ant to maven
** add new directory src/main/java-templates to hold source template
** add maven plugins to generate revision number, timestamp and
parse version number
3 files added
30 files modified
1549 ■■■■■ changed files
opendj-admin/pom.xml 123 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java-templates/org/opends/server/util/DynamicConstants.java 183 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/AbsoluteInheritedDefaultBehaviorProvider.java 58 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/ConfigurationClient.java 58 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/Constraint.java 82 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/DecodingException.java 3 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/doc/ConfigGuideGeneration.java 717 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/doc/package-info.java 4 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/AbstractConfigListenerAdaptor.java 10 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigAddListenerAdaptor.java 8 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigChangeListenerAdaptor.java 18 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigDeleteListenerAdaptor.java 12 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigExceptionFactory.java 10 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigurationAddListener.java 4 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigurationChangeListener.java 4 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigurationDeleteListener.java 4 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ConstraintViolationException.java 28 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/DelayedConfigAddListener.java 4 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObject.java 8 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectAddListener.java 4 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectAddListenerAdaptor.java 4 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectChangeListener.java 4 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectChangeListenerAdaptor.java 4 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectDecodingException.java 16 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectDeleteListener.java 4 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectDeleteListenerAdaptor.java 4 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagementContext.java 8 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/server/package-info.java 2 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/api/ConfigAddListener.java 3 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/api/ConfigChangeListener.java 4 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/api/ConfigDeleteListener.java 10 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/types/DirectoryEnvironmentConfig.java 39 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/util/EmbeddedUtils.java 105 ●●●●● patch | view | raw | blame | history
opendj-admin/pom.xml
@@ -57,6 +57,16 @@
    <adminPackage>org/forgerock/opendj/admin</adminPackage>
    <generatedSourcesDir>${project.build.directory}/generated-sources/admin/${adminPackage}</generatedSourcesDir>
    <xslDir>src/main/resources/stylesheets</xslDir>
    <!-- properties used to generate DynamicConstant class -->
    <serverProductName>OpenDJ</serverProductName>
    <serverShortProductName>OpenDJ</serverShortProductName>
    <issuesFixIds></issuesFixIds>
    <isDebugBuild>false</isDebugBuild>
    <docReferenceHome>http://opendj.forgerock.org/</docReferenceHome>
    <docReferenceWiki>http://opendj.forgerock.org/docs.html</docReferenceWiki>
    <docQuickRefGuide>http://opendj.forgerock.org/doc/admin-guide/index.html</docQuickRefGuide>
    <adminGuideUrl>http://opendj.forgerock.org/doc/admin-guide/index.html</adminGuideUrl>
  </properties>
  <build>
    <plugins>
@@ -350,19 +360,124 @@
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <!-- Parse the maven version to get version parts (major, minor, ...) -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.4</version>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.8</version>
        <executions>
          <execution>
            <id>parse-version</id>
            <goals>
              <goal>test-jar</goal>
              <goal>parse-version</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- Retrieve the SVN revision number and the build timestamp -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>1.2</version>
        <executions>
          <execution>
            <id>generate-buildnumber</id>
            <phase>validate</phase>
            <goals>
              <goal>create</goal>
            </goals>
            <configuration>
              <useLastCommittedRevision>true</useLastCommittedRevision>
              <buildNumberPropertyName>buildRevision</buildNumberPropertyName>
            </configuration>
          </execution>
          <execution>
            <id>generate-timestamp</id>
            <phase>validate</phase>
            <goals>
              <goal>create</goal>
            </goals>
            <configuration>
              <format>{0,date,yyyyMMddHHmmss}</format>
              <items>
                <item>timestamp</item>
              </items>
              <buildNumberPropertyName>buildDateTime</buildNumberPropertyName>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- Filter java sources located in src/main/java-templates -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>templating-maven-plugin</artifactId>
        <version>1.0-alpha-3</version>
        <executions>
          <execution>
            <id>filter-src</id>
            <goals>
              <goal>filter-sources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings
          only. It has no influence on the Maven build itself. -->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <versionRange>[1.8,)</versionRange>
                    <goals>
                      <goal>parse-version</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>templating-maven-plugin</artifactId>
                    <versionRange>[1.0-alpha-3,)</versionRange>
                    <goals>
                      <goal>filter-sources</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>xml-maven-plugin</artifactId>
                    <versionRange>[1.0,)</versionRange>
                    <goals>
                      <goal>transform</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <reporting>
    <plugins>
opendj-admin/src/main/java-templates/org/opends/server/util/DynamicConstants.java
New file
@@ -0,0 +1,183 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2013 ForgeRock AS
 */
package org.opends.server.util;
/**
 * This file contains a number of constants that are used throughout the
 * Directory Server source. It was dynamically generated as part of the
 * build process and should not be edited directly.
 */
public final class DynamicConstants {
    /**
     * The official full product name for the Directory Server.
     */
    public static String PRODUCT_NAME = "${serverProductName}";
    /**
     * The short product name for the Directory Server.
     */
    public static String SHORT_NAME = "${serverShortProductName}";
    /**
     * The major version number for the Directory Server.
     */
    public static int MAJOR_VERSION = ${parsedVersion.majorVersion};
    /**
     * The minor version number for the Directory Server.
     */
    public static int MINOR_VERSION = ${parsedVersion.minorVersion};
    /**
     * The point version number for the Directory Server.
     */
    public static int POINT_VERSION = ${parsedVersion.incrementalVersion};
    /**
     * The official build number for the Directory Server.
     */
    public static int BUILD_NUMBER = ${parsedVersion.buildNumber};
    /**
     * The version qualifier string for the Directory Server.
     */
    public static String VERSION_QUALIFIER = "${parsedVersion.qualifier}";
    /**
     * The set of bug IDs for fixes included in this build of the Directory
     * Server.
     */
    public static String FIX_IDS = "${issuesFixIds}";
    /**
     * The build ID for the generated build of the Directory Server.
     */
    public static String BUILD_ID = "${buildDateTime}";
    /**
     * The username of the user that created this build.
     */
    public static String BUILD_USER = "${user.name}";
    /**
     * The Java version used to generate this build.
     */
    public static String BUILD_JAVA_VERSION = "${java.version}";
    /**
     * The vendor for the Java version used to generate this build.
     */
    public static String BUILD_JAVA_VENDOR = "${java.vendor}";
    /**
     * The JVM version used to generate this build.
     */
    public static String BUILD_JVM_VERSION = "${java.vm.version}";
    /**
     * The vendor for the JVM used to generate this build.
     */
    public static String BUILD_JVM_VENDOR = "${java.vm.vendor}";
    /**
     * The operating system on which this build was generated.
     */
    public static String BUILD_OS = "${os.name} ${os.version} ${os.arch}";
    /**
     * Indicates whether this is a debug build of the Directory Server that may
     * include additional debugging facilities not available in standard release
     * versions.
     */
    public static boolean DEBUG_BUILD = ${isDebugBuild};
    /**
     * The Subversion revision number on which this build is based.
     */
    public static long REVISION_NUMBER = ${buildRevision};
    /**
     * The Subversion url repository location on which this build is based.
     */
    public static String URL_REPOSITORY = "${scm.url}";
    /**
     * The documentation home.
     */
    public static String DOC_REFERENCE_HOME = "${docReferenceHome}";
    /**
     * The documentation url.
     */
    public static String DOC_REFERENCE_WIKI = "${docReferenceWiki}";
    /**
     * The documentation url.
     */
    public static String DOC_QUICK_REFERENCE_GUIDE = "${docQuickRefGuide}";
    /**
     * The administration guide.
     */
    public static String ADMINISTRATION_GUIDE_URL = "${adminGuideUrl}";
    /**
     * A string representation of the version number.
     */
    public static String VERSION_NUMBER_STRING = "${project.version}";
    /**
     * A string representation of the version number.
     */
    public static String OPENDJ_NUMBER_STRING = "${project.version}";
    /**
     * A string representation of the release version.
     */
    public static String RELEASE_VERSION_STRING = OPENDJ_NUMBER_STRING;
    /**
     * A compact version string for this product, suitable for use in path names
     * and similar cases.
     */
    public static String COMPACT_VERSION_STRING = SHORT_NAME + "-" + VERSION_NUMBER_STRING;
    /**
     * A full version string for this product.
     */
    public static String FULL_VERSION_STRING = PRODUCT_NAME + " " + RELEASE_VERSION_STRING
            + (((FIX_IDS != null) && (FIX_IDS.length() > 0)) ? "+" + FIX_IDS : "");
    /**
     * A printable version string for this product.
     */
    public static final String PRINTABLE_VERSION_STRING = FULL_VERSION_STRING + System.getProperty("line.separator")
            + "Build " + BUILD_ID + System.getProperty("line.separator");
}
opendj-admin/src/main/java/org/opends/server/admin/AbsoluteInheritedDefaultBehaviorProvider.java
@@ -26,19 +26,15 @@
 */
package org.opends.server.admin;
/**
 * A default behavior provider which retrieves default values from a
 * managed object in an absolute location. It should be used by
 * properties which inherit their default value(s) from properties
 * held in an other managed object.
 * A default behavior provider which retrieves default values from a managed
 * object in an absolute location. It should be used by properties which inherit
 * their default value(s) from properties held in an other managed object.
 *
 * @param <T>
 *          The type of values represented by this provider.
 */
public final class AbsoluteInheritedDefaultBehaviorProvider<T> extends
    DefaultBehaviorProvider<T> {
public final class AbsoluteInheritedDefaultBehaviorProvider<T> extends DefaultBehaviorProvider<T> {
  // The absolute path to the managed object containing the property.
  private ManagedObjectPath<?, ?> path = null;
@@ -50,27 +46,22 @@
  // The name of the property containing the inherited default values.
  private final String propertyName;
  /**
   * Create an absolute inherited default behavior provider associated
   * with the managed object at the specified absolute location.
     * Create an absolute inherited default behavior provider associated with
     * the managed object at the specified absolute location.
   *
   * @param pathString
   *          The string representation of the managed object path
   *          specifying the absolute location of the managed object.
   * @param propertyName
   *          The name of the property containing the inherited
   *          default values.
     *            The name of the property containing the inherited default
     *            values.
   */
  public AbsoluteInheritedDefaultBehaviorProvider(String pathString,
      String propertyName) {
    public AbsoluteInheritedDefaultBehaviorProvider(String pathString, String propertyName) {
    this.pathString = pathString;
    this.propertyName = propertyName;
  }
  /**
   * {@inheritDoc}
   */
@@ -78,47 +69,38 @@
    return v.visitAbsoluteInherited(this, p);
  }
  /**
   * Get the definition of the parent managed object containing the
   * inherited default values.
     * Get the definition of the parent managed object containing the inherited
     * default values.
   *
   * @return Returns the definition of the parent managed object
   *         containing the inherited default values.
     * @return Returns the definition of the parent managed object containing
     *         the inherited default values.
   */
  public AbstractManagedObjectDefinition<?, ?> getManagedObjectDefinition() {
    return path.getManagedObjectDefinition();
  }
  /**
   * Get the absolute path of the managed object containing the
   * property which has the default values.
     * Get the absolute path of the managed object containing the property which
     * has the default values.
   *
   * @return Returns the absolute path of the managed object
   *         containing the property which has the default values.
     * @return Returns the absolute path of the managed object containing the
     *         property which has the default values.
   */
  public ManagedObjectPath<?, ?> getManagedObjectPath() {
    return path;
  }
  /**
   * Gets the name of the property containing the inherited default
   * values.
     * Gets the name of the property containing the inherited default values.
   *
   * @return Returns the name of the property containing the inherited
   *         default values.
     * @return Returns the name of the property containing the inherited default
     *         values.
   */
  public String getPropertyName() {
    return propertyName;
  }
  /**
   * {@inheritDoc}
   */
opendj-admin/src/main/java/org/opends/server/admin/ConfigurationClient.java
@@ -27,33 +27,24 @@
package org.opends.server.admin;
import org.opends.server.admin.client.AuthorizationException;
import org.opends.server.admin.client.CommunicationException;
import org.opends.server.admin.client.ConcurrentModificationException;
import org.opends.server.admin.client.MissingMandatoryPropertiesException;
import org.opends.server.admin.client.OperationRejectedException;
/**
 * A common base interface for all managed object configuration
 * clients.
 * A common base interface for all managed object configuration clients.
 */
public interface ConfigurationClient {
  /**
   * Get the configuration definition associated with this
   * configuration.
     * Get the configuration definition associated with this configuration.
   *
   * @return Returns the configuration definition associated with this
   *         configuration.
   */
  ManagedObjectDefinition<? extends ConfigurationClient,
      ? extends Configuration> definition();
    ManagedObjectDefinition<? extends ConfigurationClient, ? extends Configuration> definition();
  /**
   * Get a property provider view of this configuration.
@@ -62,39 +53,32 @@
   */
  PropertyProvider properties();
  /**
   * If this is a new configuration this method will attempt to add it
   * to the server, otherwise it will commit any changes made to this
   * configuration.
     * If this is a new configuration this method will attempt to add it to the
     * server, otherwise it will commit any changes made to this configuration.
   *
   * @throws ManagedObjectAlreadyExistsException
   *           If this is a new configuration but it could not be
   *           added to the server because it already exists.
     *             If this is a new configuration but it could not be added to
     *             the server because it already exists.
   * @throws MissingMandatoryPropertiesException
   *           If this configuration contains some mandatory
   *           properties which have been left undefined.
     *             If this configuration contains some mandatory properties
     *             which have been left undefined.
   * @throws ConcurrentModificationException
   *           If this is a new configuration which is being added to
   *           the server but its parent has been removed by another
   *           client, or if this configuration is being modified but
   *           it has been removed from the server by another client.
     *             If this is a new configuration which is being added to the
     *             server but its parent has been removed by another client, or
     *             if this configuration is being modified but it has been
     *             removed from the server by another client.
   * @throws OperationRejectedException
   *           If the server refuses to add or modify this
   *           configuration due to some server-side constraint which
   *           cannot be satisfied.
     *             If the server refuses to add or modify this configuration due
     *             to some server-side constraint which cannot be satisfied.
   * @throws AuthorizationException
   *           If the server refuses to add or modify this
   *           configuration because the client does not have the
   *           correct privileges.
     *             If the server refuses to add or modify this configuration
     *             because the client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  void commit() throws ManagedObjectAlreadyExistsException,
      MissingMandatoryPropertiesException, ConcurrentModificationException,
      OperationRejectedException, AuthorizationException,
      CommunicationException;
    void commit() throws ManagedObjectAlreadyExistsException, MissingMandatoryPropertiesException,
            ConcurrentModificationException, OperationRejectedException, AuthorizationException, CommunicationException;
}
opendj-admin/src/main/java/org/opends/server/admin/Constraint.java
@@ -26,40 +26,32 @@
 */
package org.opends.server.admin;
import java.util.Collection;
import java.util.Collections;
import org.opends.server.admin.client.ClientConstraintHandler;
import org.opends.server.admin.server.ServerConstraintHandler;
/**
 * An interface for enforcing constraints and dependencies between
 * managed objects and their properties. Constraints express
 * relationships between managed objects and their properties, for
 * example:
 * An interface for enforcing constraints and dependencies between managed
 * objects and their properties. Constraints express relationships between
 * managed objects and their properties, for example:
 * <ul>
 * <li>referential integrity: where one managed object references
 * another a constraint can enforce referential integrity. The
 * constraint can prevent creation of references to non-existent
 * managed objects, and also prevent deletion of referenced managed
 * objects
 * <li>referential integrity: where one managed object references another a
 * constraint can enforce referential integrity. The constraint can prevent
 * creation of references to non-existent managed objects, and also prevent
 * deletion of referenced managed objects
 * <li>property dependencies: for example, when a boolean property is
 * <code>true</code>, one or more additional properties must be
 * specified. This is useful for features like SSL, which when
 * enabled, requires that various SSL related configuration options
 * are specified
 * <li>property constraints: for example, when an upper limit
 * property must not have a value which is less than the lower limit
 * property.
 * <code>true</code>, one or more additional properties must be specified. This
 * is useful for features like SSL, which when enabled, requires that various
 * SSL related configuration options are specified
 * <li>property constraints: for example, when an upper limit property must not
 * have a value which is less than the lower limit property.
 * </ul>
 * On the client-side constraints are enforced immediately before a
 * write operation is performed. That is to say, immediately before a
 * new managed object is created, changes to a managed object are
 * applied, or an existing managed object is deleted.
 * On the client-side constraints are enforced immediately before a write
 * operation is performed. That is to say, immediately before a new managed
 * object is created, changes to a managed object are applied, or an existing
 * managed object is deleted.
 */
public abstract class Constraint {
@@ -70,47 +62,37 @@
    // No implementation required.
  }
  /**
   * Gets the client-side constraint handlers which will be used to
   * enforce this constraint in client applications. The default
   * implementation is to return an empty set of client constraint
   * handlers.
     * Gets the client-side constraint handlers which will be used to enforce
     * this constraint in client applications. The default implementation is to
     * return an empty set of client constraint handlers.
   *
   * @return Returns the client-side constraint handlers which will be
   *         used to enforce this constraint in client applications.
   *         The returned collection must not be <code>null</code>
   *         but maybe empty (indicating that the constraint can only
   *         be enforced on the server-side).
     * @return Returns the client-side constraint handlers which will be used to
     *         enforce this constraint in client applications. The returned
     *         collection must not be <code>null</code> but maybe empty
     *         (indicating that the constraint can only be enforced on the
     *         server-side).
   */
  public Collection<ClientConstraintHandler> getClientConstraintHandlers() {
    return Collections.emptySet();
  }
  /**
   * Gets the server-side constraint handlers which will be used to
   * enforce this constraint within the server. The default
   * implementation is to return an empty set of server constraint
   * handlers.
     * Gets the server-side constraint handlers which will be used to enforce
     * this constraint within the server. The default implementation is to
     * return an empty set of server constraint handlers.
   *
   * @return Returns the server-side constraint handlers which will be
   *         used to enforce this constraint within the server. The
   *         returned collection must not be <code>null</code> and
   *         must not be empty, since constraints must always be
   *         enforced on the server.
     * @return Returns the server-side constraint handlers which will be used to
     *         enforce this constraint within the server. The returned
     *         collection must not be <code>null</code> and must not be empty,
     *         since constraints must always be enforced on the server.
   */
  public Collection<ServerConstraintHandler> getServerConstraintHandlers() {
    return Collections.emptySet();
  }
  /**
   * Initializes this constraint. The default implementation is to do
   * nothing.
     * Initializes this constraint. The default implementation is to do nothing.
   *
   * @throws Exception
   *           If this constraint could not be initialized.
opendj-admin/src/main/java/org/opends/server/admin/DecodingException.java
@@ -29,7 +29,6 @@
import org.forgerock.i18n.LocalizableMessage;
/**
 * The requested managed object was found but it could not be decoded.
 */
@@ -40,8 +39,6 @@
   */
  private static final long serialVersionUID = 1L;
  /**
   * Create a decoding exception with a message.
   *
opendj-admin/src/main/java/org/opends/server/admin/doc/ConfigGuideGeneration.java
@@ -35,36 +35,59 @@
import java.util.Properties;
import java.util.TreeMap;
import java.util.TreeSet;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.admin.meta.RootCfgDefn;
import org.opends.server.admin.ACIPropertyDefinition;
import org.opends.server.admin.AbsoluteInheritedDefaultBehaviorProvider;
import org.opends.server.admin.AbstractManagedObjectDefinition;
import org.opends.server.admin.AdministratorAction.Type;
import org.opends.server.admin.std.meta.RootCfgDefn;
import org.opends.server.admin.*;
import org.opends.server.admin.AggregationPropertyDefinition;
import org.opends.server.admin.AliasDefaultBehaviorProvider;
import org.opends.server.admin.AttributeTypePropertyDefinition;
import org.opends.server.admin.BooleanPropertyDefinition;
import org.opends.server.admin.ClassLoaderProvider;
import org.opends.server.admin.ClassPropertyDefinition;
import org.opends.server.admin.DNPropertyDefinition;
import org.opends.server.admin.DefaultBehaviorProvider;
import org.opends.server.admin.DefinedDefaultBehaviorProvider;
import org.opends.server.admin.DurationPropertyDefinition;
import org.opends.server.admin.EnumPropertyDefinition;
import org.opends.server.admin.IPAddressMaskPropertyDefinition;
import org.opends.server.admin.IPAddressPropertyDefinition;
import org.opends.server.admin.IntegerPropertyDefinition;
import org.opends.server.admin.LDAPProfile;
import org.opends.server.admin.ManagedObjectOption;
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyDefinitionVisitor;
import org.opends.server.admin.PropertyOption;
import org.opends.server.admin.RelationDefinition;
import org.opends.server.admin.RelationOption;
import org.opends.server.admin.RelativeInheritedDefaultBehaviorProvider;
import org.opends.server.admin.SizePropertyDefinition;
import org.opends.server.admin.StringPropertyDefinition;
import org.opends.server.admin.Tag;
import org.opends.server.admin.TopCfgDefn;
import org.opends.server.admin.UndefinedDefaultBehaviorProvider;
import org.opends.server.types.InitializationException;
import org.opends.server.util.EmbeddedUtils;
import org.opends.server.util.DynamicConstants;
import org.opends.server.util.EmbeddedUtils;
/**
 *  This class allow Configuration Guide documentation generation (html format).
 * It is based on the Admin Framework Introspection API
 *
 */
public class ConfigGuideGeneration {
  // Note : still to be done :
  // I18n support. Today all the strings are hardcoded in this file
  private final static String ACI_SYNTAX_REL_URL =
    "/doc/admin-guide/#about-acis";
  private final static String DURATION_SYNTAX_REL_URL =
    "duration-syntax.html";
    private final static String ACI_SYNTAX_REL_URL = "/doc/admin-guide/#about-acis";
    private final static String DURATION_SYNTAX_REL_URL = "duration-syntax.html";
  private final String CSS_FILE = "opendj-config.css";
  private final String MAIN_FILE = "index.html";
  private final String INHERITANCE_TREE_FILE =
    "ManagedObjectInheritanceTree.html";
    private final String INHERITANCE_TREE_FILE = "ManagedObjectInheritanceTree.html";
  private final String RELATION_TREE_FILE = "ManagedObjectRelationTree.html";
  private final String MO_LIST_FILE = "ManagedObjectList.html";
  private final String PROPERTIES_INDEX_FILE = "PropertiesIndex.html";
@@ -77,28 +100,25 @@
  private final String MAIN_FRAME = "mainFrame";
  /**
   * Entry point for documentation generation.
     * Entry point for documentation generation. Properties: GenerationDir - The
     * directory where the doc is generated (default is
     * /var/tmp/[CONFIG_GUIDE_DIR>]) LdapMapping - Presence means that the LDAP
     * mapping section is to be generated (default is no) OpenDJWiki - The URL
     * of the OpenDJ Wiki (default is
     * "http://wikis.forgerock.org/confluence/display/OPENDJ") OpenDJHome - The
     * URL of the OpenDJ project Home page (default is
     * "http://opendj.forgerock.org")
   *
   * Properties:
   * GenerationDir - The directory where the doc is generated
   *              (default is /var/tmp/[CONFIG_GUIDE_DIR>])
   * LdapMapping - Presence means that the LDAP mapping section is to be
   *               generated (default is no)
   * OpenDJWiki - The URL of the OpenDJ Wiki
   *              (default is
   *              "http://wikis.forgerock.org/confluence/display/OPENDJ")
   * OpenDJHome - The URL of the OpenDJ project Home page
   *              (default is "http://opendj.forgerock.org")
   *
   * @param args none.
     * @param args
     *            none.
   */
  public static void main(String[] args) {
    Properties properties = System.getProperties();
    generationDir = properties.getProperty("GenerationDir");
    if (generationDir == null) {
      // Default dir is prefixed by the system-dependent default temporary dir
      generationDir = System.getProperty("java.io.tmpdir") + File.separator +
        CONFIG_GUIDE_DIR;
            // Default dir is prefixed by the system-dependent default temporary
            // dir
            generationDir = System.getProperty("java.io.tmpdir") + File.separator + CONFIG_GUIDE_DIR;
    }
    // Create new dir if necessary
    try {
@@ -186,28 +206,24 @@
    // Build a sorted list of top managed objects
    TopCfgDefn topCfg = TopCfgDefn.getInstance();
    Collection<AbstractManagedObjectDefinition<?, ?>> topObjects =
      topCfg.getChildren();
        Collection<AbstractManagedObjectDefinition<?, ?>> topObjects = topCfg.getChildren();
    for (AbstractManagedObjectDefinition topObject : topObjects) {
      if (topObject.getName().equals("")) {
        // root
        continue;
      }
      if (topObject.hasOption(ManagedObjectOption.HIDDEN))
      {
            if (topObject.hasOption(ManagedObjectOption.HIDDEN)) {
        continue;
      }
      topMoList.put(topObject.getName(), topObject);
    }
    // Build a list of top relations by category (core, database, ...)
    for (RelationDefinition rel : topRelList.values()) {
      AbstractManagedObjectDefinition<?, ?> mo = rel.getChildDefinition();
      Collection<Tag> tags = mo.getAllTags();
      for (Tag tag : tags) {
        TreeMap<String, RelationDefinition> catMap =
          catTopRelList.get(tag.getName());
                TreeMap<String, RelationDefinition> catMap = catTopRelList.get(tag.getName());
        if (catMap == null) {
          catMap = new TreeMap<String, RelationDefinition>();
          catTopRelList.put(tag.getName(), catMap);
@@ -220,8 +236,7 @@
    for (AbstractManagedObjectDefinition<?, ?> topObject : topMoList.values()) {
      Collection<Tag> tags = topObject.getAllTags();
      for (Tag tag : tags) {
        TreeMap<String, AbstractManagedObjectDefinition> catMap =
          catTopMoList.get(tag.getName());
                TreeMap<String, AbstractManagedObjectDefinition> catMap = catTopMoList.get(tag.getName());
        if (catMap == null) {
          catMap = new TreeMap<String, AbstractManagedObjectDefinition>();
          catTopMoList.put(tag.getName(), catMap);
@@ -236,29 +251,22 @@
   * Generate the inheritance tree of all the managed objects.
   */
  @SuppressWarnings("unchecked")
  private void genManagedObjectInheritanceTree(
    TreeMap<String, TreeMap<String, AbstractManagedObjectDefinition>> list) {
    private void genManagedObjectInheritanceTree(TreeMap<String, TreeMap<String, AbstractManagedObjectDefinition>> list) {
    htmlHeader(DynamicConstants.PRODUCT_NAME + " " +
            "Configuration Reference - Inheritance View");
        htmlHeader(DynamicConstants.PRODUCT_NAME + " " + "Configuration Reference - Inheritance View");
    tabMenu(INHERITANCE_TREE_FILE);
    viewHelp("This view represents the inheritance relationships between " +
      "configuration components.");
        viewHelp("This view represents the inheritance relationships between " + "configuration components.");
    jumpSection();
    for (String catName : list.keySet()) {
      heading3(getFriendlyName(catName));
      // Get the list of the category
      TreeMap<String, AbstractManagedObjectDefinition> catList =
        list.get(catName);
            TreeMap<String, AbstractManagedObjectDefinition> catList = list.get(catName);
      for (AbstractManagedObjectDefinition mo : catList.values()) {
        if ((relList.get(mo.getName()) != null) &&
          (relList.get(mo.getName()).hasOption(RelationOption.HIDDEN))) {
                if ((relList.get(mo.getName()) != null) && (relList.get(mo.getName()).hasOption(RelationOption.HIDDEN))) {
          continue;
        }
        paragraph(
          getLink(mo.getUserFriendlyName().toString(),
          mo.getName() + ".html", MAIN_FRAME));
                paragraph(getLink(mo.getUserFriendlyName().toString(), mo.getName() + ".html", MAIN_FRAME));
        if (mo.hasChildren()) {
          genMoInheritanceTree(makeMOTreeMap(mo.getChildren()));
        }
@@ -270,13 +278,11 @@
  }
  @SuppressWarnings("unchecked")
  private void genMoInheritanceTree(
    TreeMap<String, AbstractManagedObjectDefinition> catList) {
    private void genMoInheritanceTree(TreeMap<String, AbstractManagedObjectDefinition> catList) {
    beginList();
    for (AbstractManagedObjectDefinition mo : catList.values()) {
      link(mo.getUserFriendlyName().toString(), mo.getName() + ".html",
        MAIN_FRAME);
            link(mo.getUserFriendlyName().toString(), mo.getName() + ".html", MAIN_FRAME);
      if (mo.hasChildren()) {
        genMoInheritanceTree(makeMOTreeMap(mo.getChildren()));
      }
@@ -285,8 +291,7 @@
  }
   private void jumpSection() {
     htmlBuff.append("<p class=\"category-index\">" +
       "<strong>Jump To:</strong><br>\n");
        htmlBuff.append("<p class=\"category-index\">" + "<strong>Jump To:</strong><br>\n");
     String[] catNames = catTopMoList.keySet().toArray(new String[0]);
    for (int ii=0; ii < catNames.length; ii++) {
@@ -299,19 +304,15 @@
    htmlBuff.append("</p>\n");
   }
  /**
   * Generate the relation tree of all the managed objects.
   */
  private void genManagedObjectRelationTree(
    TreeMap <String, TreeMap<String, RelationDefinition>> list) {
    private void genManagedObjectRelationTree(TreeMap<String, TreeMap<String, RelationDefinition>> list) {
    htmlHeader(DynamicConstants.PRODUCT_NAME +
            " Configuration Reference - Structure View");
        htmlHeader(DynamicConstants.PRODUCT_NAME + " Configuration Reference - Structure View");
    tabMenu(RELATION_TREE_FILE);
    viewHelp("This view represents the structural relationships between " +
      "components and indicates how certain components can exist only within " +
      "container components.");
        viewHelp("This view represents the structural relationships between "
                + "components and indicates how certain components can exist only within " + "container components.");
    jumpSection();
    for (String catName : list.keySet()) {
@@ -325,7 +326,6 @@
    generateFile(RELATION_TREE_FILE);
  }
  @SuppressWarnings("unchecked")
  private void genMORelationTree(TreeMap<String, RelationDefinition> list) {
    for (RelationDefinition rel : list.values()) {
@@ -338,13 +338,12 @@
      if (rel.hasOption(RelationOption.HIDDEN)) {
        continue;
      }
      String linkStr = getLink(childMo.getUserFriendlyName().toString(),
        childMo.getName() + ".html", MAIN_FRAME);
            String linkStr = getLink(childMo.getUserFriendlyName().toString(), childMo.getName() + ".html", MAIN_FRAME);
      String fromStr = "";
      if (!parentMo.getName().equals("")) {
        fromStr = " (from " +
          getLink(parentMo.getUserFriendlyName().toString(),
          parentMo.getName() + ".html", MAIN_FRAME) + ")";
                fromStr = " (from "
                        + getLink(parentMo.getUserFriendlyName().toString(), parentMo.getName() + ".html", MAIN_FRAME)
                        + ")";
      }
      if (!inList) {
        paragraph(linkStr + fromStr);
@@ -353,12 +352,10 @@
      }
      genMORelationSubTree(makeRelTreeMap(childMo.getAllRelationDefinitions()));
      if (childMo.hasChildren()) {
        for (Iterator<AbstractManagedObjectDefinition> it =
          childMo.getChildren().iterator(); it.hasNext();) {
                for (Iterator<AbstractManagedObjectDefinition> it = childMo.getChildren().iterator(); it.hasNext();) {
          AbstractManagedObjectDefinition mo = it.next();
          if (mo.hasOption(ManagedObjectOption.HIDDEN))
          {
                    if (mo.hasOption(ManagedObjectOption.HIDDEN)) {
            continue;
          }
          genMORelationSubTree(makeRelTreeMap(mo.getAllRelationDefinitions()));
@@ -367,7 +364,6 @@
    }
  }
  private void genMORelationSubTree(TreeMap<String, RelationDefinition> list) {
    if (!list.values().isEmpty()) {
      beginList();
@@ -376,17 +372,14 @@
    }
  }
  /**
   * Generate all the managed objects HTML pages.
   */
  @SuppressWarnings("unchecked")
  private void genAllManagedObject(
    TreeMap<String, AbstractManagedObjectDefinition> list) {
    private void genAllManagedObject(TreeMap<String, AbstractManagedObjectDefinition> list) {
    for (AbstractManagedObjectDefinition mo : list.values()) {
      if ((relList.get(mo.getName()) != null) &&
        (relList.get(mo.getName()).hasOption(RelationOption.HIDDEN))) {
            if ((relList.get(mo.getName()) != null) && (relList.get(mo.getName()).hasOption(RelationOption.HIDDEN))) {
        continue;
      }
      moList.put(mo.getName(), mo);
@@ -411,9 +404,7 @@
    // Abstract notice
    if (mo.hasChildren()) {
      paragraph(
        "Note: this is an abstract component, that cannot be instantiated.",
        TextStyle.ITALIC);
            paragraph("Note: this is an abstract component, that cannot be instantiated.", TextStyle.ITALIC);
    }
    // description
@@ -423,28 +414,23 @@
    // sub-components
    if (mo.hasChildren()) {
      heading3("Direct Subcomponents");
      paragraph("The following " + mo.getUserFriendlyPluralName() +
        " are available in the server :");
            paragraph("The following " + mo.getUserFriendlyPluralName() + " are available in the server :");
      beginList();
      @SuppressWarnings("unchecked")
      TreeMap<String, AbstractManagedObjectDefinition> children =
        makeMOTreeMap(mo.getChildren());
            TreeMap<String, AbstractManagedObjectDefinition> children = makeMOTreeMap(mo.getChildren());
      for ( AbstractManagedObjectDefinition child : children.values()) {
        link(child.getUserFriendlyName().toString(), child.getName() + ".html");
      }
      endList();
      paragraph("These " + mo.getUserFriendlyPluralName() +
        " inherit from the properties described below.");
            paragraph("These " + mo.getUserFriendlyPluralName() + " inherit from the properties described below.");
    }
    // Parent
    if (!mo.getParent().isTop()) {
      heading3("Parent Component");
      paragraph("The " + mo.getUserFriendlyName() +
        " component inherits from the " +
        getLink(mo.getParent().getUserFriendlyName().toString(),
        mo.getParent().getName() + ".html"));
            paragraph("The " + mo.getUserFriendlyName() + " component inherits from the "
                    + getLink(mo.getParent().getUserFriendlyName().toString(), mo.getParent().getName() + ".html"));
    }
    // Relations
@@ -463,7 +449,6 @@
      newline();
    }
    //------------------------------------------------------------------------
    // Properties
    //------------------------------------------------------------------------
@@ -473,10 +458,8 @@
    paragraph("A description of each property follows.");
    newline();
    TreeMap<String, PropertyDefinition> basicProps =
      new TreeMap<String, PropertyDefinition>();
    TreeMap<String, PropertyDefinition> advancedProps =
      new TreeMap<String, PropertyDefinition>();
        TreeMap<String, PropertyDefinition> basicProps = new TreeMap<String, PropertyDefinition>();
        TreeMap<String, PropertyDefinition> advancedProps = new TreeMap<String, PropertyDefinition>();
    // Properties actually defined in this managed object
    @SuppressWarnings("unchecked")
    Collection<PropertyDefinition> props = mo.getAllPropertyDefinitions();
@@ -519,9 +502,7 @@
    generateFile(mo.getName() + ".html");
  }
  private TreeMap<String, PropertyDefinition>
    getPropertyList(AbstractManagedObjectDefinition mo) {
    private TreeMap<String, PropertyDefinition> getPropertyList(AbstractManagedObjectDefinition mo) {
    @SuppressWarnings("unchecked")
    Collection<PropertyDefinition> props = mo.getAllPropertyDefinitions();
@@ -529,28 +510,22 @@
  }
  private void homeLink() {
    htmlBuff.append("<div style=\"font-size:11px;margin-top:-10px;" +
      "margin-bottom:-10px; text-align:right\"><a href=\"" +
      MAIN_FILE +
      "\" target=\"_top\">Configuration Reference Home</a></div>");
        htmlBuff.append("<div style=\"font-size:11px;margin-top:-10px;"
                + "margin-bottom:-10px; text-align:right\"><a href=\"" + MAIN_FILE
                + "\" target=\"_top\">Configuration Reference Home</a></div>");
  }
  private void generateRelationsSection(AbstractManagedObjectDefinition mo) {
    // Composition relations
    @SuppressWarnings("unchecked")
    Collection<RelationDefinition> compRels = mo.getRelationDefinitions();
    @SuppressWarnings("unchecked")
    Collection<RelationDefinition> reverseCompRels =
      mo.getReverseRelationDefinitions();
        Collection<RelationDefinition> reverseCompRels = mo.getReverseRelationDefinitions();
    // Aggregation properties
    @SuppressWarnings("unchecked")
    Collection<AggregationPropertyDefinition> aggregProps =
      mo.getAggregationPropertyDefinitions();
        Collection<AggregationPropertyDefinition> aggregProps = mo.getAggregationPropertyDefinitions();
    @SuppressWarnings("unchecked")
    Collection<AggregationPropertyDefinition> reverseAggregProps =
      mo.getReverseAggregationPropertyDefinitions();
        Collection<AggregationPropertyDefinition> reverseAggregProps = mo.getReverseAggregationPropertyDefinitions();
    // Check if something to print in composition relations
    // (even if the list not empty, it may contain only hidden relations)
@@ -583,11 +558,9 @@
    boolean isReverseAggregPropsEmpty = true;
    if (!reverseAggregProps.isEmpty()) {
      for (AggregationPropertyDefinition agg : reverseAggregProps) {
        AbstractManagedObjectDefinition fromMo =
          agg.getManagedObjectDefinition();
                AbstractManagedObjectDefinition fromMo = agg.getManagedObjectDefinition();
        @SuppressWarnings("unchecked")
        Collection<RelationDefinition> rels =
          fromMo.getAllReverseRelationDefinitions();
                Collection<RelationDefinition> rels = fromMo.getAllReverseRelationDefinitions();
        for (RelationDefinition rel : rels) {
          if (rel.hasOption(RelationOption.HIDDEN)) {
            continue;
@@ -597,7 +570,6 @@
      }
    }
    //
    // Relations FROM this component
    //
@@ -607,26 +579,22 @@
    }
    if (!isCompRelsEmpty) {
      paragraph(
        "The following components have a direct COMPOSITION relation FROM " +
        mo.getUserFriendlyPluralName() + " :");
            paragraph("The following components have a direct COMPOSITION relation FROM "
                    + mo.getUserFriendlyPluralName() + " :");
      for ( RelationDefinition rel : compRels) {
        if (rel.hasOption(RelationOption.HIDDEN)) {
          continue;
        }
        beginList();
        AbstractManagedObjectDefinition childRel = rel.getChildDefinition();
        link(childRel.getUserFriendlyName().toString(), childRel.getName() +
          ".html");
                link(childRel.getUserFriendlyName().toString(), childRel.getName() + ".html");
        endList();
      }
    }
    if (!aggregProps.isEmpty()) {
      paragraph(
        "The following components have a direct AGGREGATION relation FROM " +
        mo.getUserFriendlyPluralName() + " :");
      TreeMap<String, AbstractManagedObjectDefinition> componentList =
        new TreeMap<String, AbstractManagedObjectDefinition>();
            paragraph("The following components have a direct AGGREGATION relation FROM "
                    + mo.getUserFriendlyPluralName() + " :");
            TreeMap<String, AbstractManagedObjectDefinition> componentList = new TreeMap<String, AbstractManagedObjectDefinition>();
      for ( AggregationPropertyDefinition agg : aggregProps) {
        RelationDefinition rel = agg.getRelationDefinition();
        AbstractManagedObjectDefinition childRel = rel.getChildDefinition();
@@ -634,13 +602,11 @@
      }
      for (AbstractManagedObjectDefinition component : componentList.values()) {
        beginList();
        link(component.getUserFriendlyName().toString(), component.getName() +
          ".html");
                link(component.getUserFriendlyName().toString(), component.getName() + ".html");
        endList();
      }
    }
    //
    // Relations TO this component
    //
@@ -651,33 +617,27 @@
    if (!mo.getReverseRelationDefinitions().isEmpty()) {
      if (!isReverseCompRelsEmpty) {
        paragraph(
          "The following components have a direct COMPOSITION relation TO " +
          mo.getUserFriendlyPluralName() + " :");
                paragraph("The following components have a direct COMPOSITION relation TO "
                        + mo.getUserFriendlyPluralName() + " :");
        for ( RelationDefinition rel : reverseCompRels) {
          beginList();
          AbstractManagedObjectDefinition childRel = rel.getParentDefinition();
          link(childRel.getUserFriendlyName().toString(), childRel.getName() +
            ".html");
                    link(childRel.getUserFriendlyName().toString(), childRel.getName() + ".html");
          endList();
        }
      }
    }
    if (!isReverseAggregPropsEmpty) {
      paragraph(
        "The following components have a direct AGGREGATION relation TO " +
        mo.getUserFriendlyPluralName() + " :");
      TreeMap<String, AbstractManagedObjectDefinition> componentList =
        new TreeMap<String, AbstractManagedObjectDefinition>();
            paragraph("The following components have a direct AGGREGATION relation TO "
                    + mo.getUserFriendlyPluralName() + " :");
            TreeMap<String, AbstractManagedObjectDefinition> componentList = new TreeMap<String, AbstractManagedObjectDefinition>();
      for ( AggregationPropertyDefinition agg : reverseAggregProps) {
        AbstractManagedObjectDefinition fromMo =
          agg.getManagedObjectDefinition();
                AbstractManagedObjectDefinition fromMo = agg.getManagedObjectDefinition();
        componentList.put(fromMo.getName(), fromMo);
      }
      for (AbstractManagedObjectDefinition component : componentList.values()) {
        beginList();
        link(component.getUserFriendlyName().toString(), component.getName() +
          ".html");
                link(component.getUserFriendlyName().toString(), component.getName() + ".html");
        endList();
      }
@@ -685,19 +645,16 @@
  }
  private void generateProperty(
    AbstractManagedObjectDefinition mo, PropertyDefinition prop) {
    private void generateProperty(AbstractManagedObjectDefinition mo, PropertyDefinition prop) {
    // Property name
    paragraph(getAnchor(prop.getName()) + prop.getName(), TextStyle.STANDARD,
      "propertyname");
        paragraph(getAnchor(prop.getName()) + prop.getName(), TextStyle.STANDARD, "propertyname");
    // Property table
    startTable();
    tableRow("Description",
      ((prop.getSynopsis() != null) ? prop.getSynopsis().toString()+ " " : "") +
      ((prop.getDescription() != null) ?
        prop.getDescription().toString() : ""));
                ((prop.getSynopsis() != null) ? prop.getSynopsis().toString() + " " : "")
                        + ((prop.getDescription() != null) ? prop.getDescription().toString() : ""));
    // Default value
    String defValueStr = getDefaultBehaviorString(prop);
@@ -705,8 +662,7 @@
    tableRow("Allowed Values", getSyntaxStr(prop));
    tableRow("Multi-valued",
      (prop.hasOption(PropertyOption.MULTI_VALUED) ? "Yes" : "No"));
        tableRow("Multi-valued", (prop.hasOption(PropertyOption.MULTI_VALUED) ? "Yes" : "No"));
    if (prop.hasOption(PropertyOption.MANDATORY)) {
      tableRow("Required", "Yes");
@@ -716,21 +672,19 @@
    String action = "None";
    if (prop.getAdministratorAction() != null) {
      Message synopsis = prop.getAdministratorAction().getSynopsis();
            LocalizableMessage synopsis = prop.getAdministratorAction().getSynopsis();
      Type actionType = prop.getAdministratorAction().getType();
      String actionStr = "";
      if (actionType == Type.COMPONENT_RESTART) {
        actionStr = "The " + mo.getUserFriendlyName() +
          " must be disabled and re-enabled for changes to this setting " +
          "to take effect";
                actionStr = "The " + mo.getUserFriendlyName()
                        + " must be disabled and re-enabled for changes to this setting " + "to take effect";
      } else if (actionType == Type.SERVER_RESTART) {
        actionStr = "Restart the server";
      } else if (actionType == Type.NONE) {
        actionStr = "None";
      }
      String dot = (actionStr.equals("") ? "" : ". ");
      action = actionStr +
        ((synopsis != null) ? dot + synopsis : "");
            action = actionStr + ((synopsis != null) ? dot + synopsis : "");
    }
    tableRow("Admin Action Required", action);
@@ -750,35 +704,21 @@
  }
  private void propertiesLinkTable(TreeMap<String,
    PropertyDefinition> basicProps,
    private void propertiesLinkTable(TreeMap<String, PropertyDefinition> basicProps,
    TreeMap<String, PropertyDefinition> advancedProps) {
    htmlBuff.append(
      "<table border=\"0\" cellspacing=\"0\" class=\"jump-table\">\n" +
      "  <tr>\n" +
      "    <th>Basic Properties:</th>\n" +
      "    <th>Advanced Properties:</th>\n" +
      "  </tr>\n");
        htmlBuff.append("<table border=\"0\" cellspacing=\"0\" class=\"jump-table\">\n" + "  <tr>\n"
                + "    <th>Basic Properties:</th>\n" + "    <th>Advanced Properties:</th>\n" + "  </tr>\n");
    PropertyDefinition[] basicPropsArray =
      basicProps.values().toArray(new PropertyDefinition[0]);
    PropertyDefinition[] advancedPropsArray =
      advancedProps.values().toArray(new PropertyDefinition[0]);
        PropertyDefinition[] basicPropsArray = basicProps.values().toArray(new PropertyDefinition[0]);
        PropertyDefinition[] advancedPropsArray = advancedProps.values().toArray(new PropertyDefinition[0]);
    for (int ii=0;
        (ii < basicPropsArray.length) || (ii < advancedPropsArray.length);
        ii++) {
      String basicPropName =
        ii < basicPropsArray.length ? basicPropsArray[ii].getName() : null;
      String advancedPropName =
        ii < advancedPropsArray.length ?
          advancedPropsArray[ii].getName() : null;
        for (int ii = 0; (ii < basicPropsArray.length) || (ii < advancedPropsArray.length); ii++) {
            String basicPropName = ii < basicPropsArray.length ? basicPropsArray[ii].getName() : null;
            String advancedPropName = ii < advancedPropsArray.length ? advancedPropsArray[ii].getName() : null;
      String basicHtmlCell = "";
      if (basicPropName != null) {
        basicHtmlCell = "  <td>&darr;&nbsp;<a href=\"#" + basicPropName + "\">"
          + basicPropName + "</a></td>\n";
                basicHtmlCell = "  <td>&darr;&nbsp;<a href=\"#" + basicPropName + "\">" + basicPropName + "</a></td>\n";
      } else if ((basicPropsArray.length == 0) && (ii == 0)) {
        basicHtmlCell = "  <td>&nbsp;None</td>\n";
      } else if (ii >= basicPropsArray.length) {
@@ -788,8 +728,8 @@
      String advancedHtmlCell = "";
      if (advancedPropName != null) {
        advancedHtmlCell = "  <td>&darr;&nbsp;<a href=\"#" + advancedPropName +
          "\">" + advancedPropName + "</a></td>\n";
                advancedHtmlCell = "  <td>&darr;&nbsp;<a href=\"#" + advancedPropName + "\">" + advancedPropName
                        + "</a></td>\n";
      } else if ((advancedPropsArray.length == 0) && (ii == 0)) {
        advancedHtmlCell = "  <td>&nbsp;None</td>\n";
      }
@@ -801,19 +741,17 @@
    htmlBuff.append("</table>\n");
  }
  private void genLdapMapping(AbstractManagedObjectDefinition mo) {
    //------------------------------------------------------------------------
    // LDAP mapping
    //------------------------------------------------------------------------
    heading3("LDAP Mapping");
    paragraph(
      "Each configuration property can be mapped to a specific " +
      "LDAP attribute under the \"cn=config\" entry. " +
      "The mappings that follow are provided for information only. " +
      "In general, you should avoid changing the server configuration " +
      "by manipulating the LDAP attributes directly.");
        paragraph("Each configuration property can be mapped to a specific "
                + "LDAP attribute under the \"cn=config\" entry. "
                + "The mappings that follow are provided for information only. "
                + "In general, you should avoid changing the server configuration "
                + "by manipulating the LDAP attributes directly.");
    // Managed object table
    startTable();
@@ -828,17 +766,14 @@
        superior = "top";
      } else {
        if (moList.get(mo.getParent().getName()) != null) {
          superior =
            ldapProfile.getObjectClass(moList.get(mo.getParent().getName()));
                    superior = ldapProfile.getObjectClass(moList.get(mo.getParent().getName()));
        } else {
          System.err.println(
            "Error: managed object " + mo.getName() + " not found.");
                    System.err.println("Error: managed object " + mo.getName() + " not found.");
        }
      }
      tableRow("objectclass superior", superior);
    } else {
      System.err.println(
        "Error: objectclass superior not found for " + mo.getName());
            System.err.println("Error: objectclass superior not found for " + mo.getName());
    }
    endTable();
@@ -854,14 +789,11 @@
  }
  private void genManagedObjectList(
    TreeMap<String, AbstractManagedObjectDefinition> list) {
    private void genManagedObjectList(TreeMap<String, AbstractManagedObjectDefinition> list) {
    htmlHeader(DynamicConstants.PRODUCT_NAME
            + " Configuration Reference - Components View");
        htmlHeader(DynamicConstants.PRODUCT_NAME + " Configuration Reference - Components View");
    tabMenu(MO_LIST_FILE);
    viewHelp("This view provides a list of all configuration components, " +
      "in alphabetical order.");
        viewHelp("This view provides a list of all configuration components, " + "in alphabetical order.");
    newline();
    StringBuffer moPointers = new StringBuffer();
@@ -874,11 +806,8 @@
        moPointers.append(getAnchor(letter) + getHeading2(letter));
        lettersPointers += getLink(letter, "#" + letter) + " ";
      }
      moPointers.append(
        "<p> " +
        getLink(mo.getUserFriendlyName().toString(), mo.getName() + ".html",
        MAIN_FRAME) +
        "</p>\n");
            moPointers.append("<p> " + getLink(mo.getUserFriendlyName().toString(), mo.getName() + ".html", MAIN_FRAME)
                    + "</p>\n");
    }
    paragraph(lettersPointers);
    htmlBuff.append(moPointers);
@@ -892,8 +821,7 @@
    TreeSet<String> propMoList = new TreeSet<String>();
    for (AbstractManagedObjectDefinition<?, ?> mo : moList.values()) {
      for (PropertyDefinition<?> prop : mo.getPropertyDefinitions()) {
        propMoList.add(
          prop.getName() + "," + prop.getManagedObjectDefinition().getName());
                propMoList.add(prop.getName() + "," + prop.getManagedObjectDefinition().getName());
      }
    }
@@ -909,22 +837,18 @@
        htmlBuff.append(getAnchor(letter) + getHeading2(letter));
        lettersPointers += getLink(letter, "#" + letter) + " ";
      }
      String propLink = getLink(propName,
        mo.getName() + ".html" + "#" + propName, MAIN_FRAME);
      String moLink =
        getLink(mo.getUserFriendlyName().toString(), mo.getName() + ".html",
        MAIN_FRAME, "#666");
            String propLink = getLink(propName, mo.getName() + ".html" + "#" + propName, MAIN_FRAME);
            String moLink = getLink(mo.getUserFriendlyName().toString(), mo.getName() + ".html", MAIN_FRAME, "#666");
      paragraph(propLink + "  [ " + moLink + " ]");
    }
    String indexBody = htmlBuff.toString();
    htmlBuff = new StringBuffer();
    htmlHeader(DynamicConstants.PRODUCT_NAME +
            " Configuration Reference - Properties View");
        htmlHeader(DynamicConstants.PRODUCT_NAME + " Configuration Reference - Properties View");
    tabMenu(PROPERTIES_INDEX_FILE);
    viewHelp("This view provides a list of all configuration properties, " +
      "in alphabetical order, and indicates the configuration component to " +
      "which each property applies.");
        viewHelp("This view provides a list of all configuration properties, "
                + "in alphabetical order, and indicates the configuration component to "
                + "which each property applies.");
    newline();
    paragraph(lettersPointers);
@@ -934,15 +858,12 @@
  }
    private void genWelcomePage() {
    htmlHeader(DynamicConstants.PRODUCT_NAME +
            " Configuration Reference - Welcome");
        htmlHeader(DynamicConstants.PRODUCT_NAME + " Configuration Reference - Welcome");
    heading2("About This Reference");
    paragraph("This reference " +
      "describes the " + DynamicConstants.PRODUCT_NAME +
      " configuration properties that can be manipulated " +
      "with the dsconfig command.");
    paragraph("Configuration components are grouped according to the area of " +
      "the server in which they are used, as follows:");
        paragraph("This reference " + "describes the " + DynamicConstants.PRODUCT_NAME
                + " configuration properties that can be manipulated " + "with the dsconfig command.");
        paragraph("Configuration components are grouped according to the area of "
                + "the server in which they are used, as follows:");
    beginList();
    for (String catName : catTopMoList.keySet()) {
@@ -950,37 +871,30 @@
    }
    endList();
    paragraph(
      "For ease of reference, the configuration is described on multiple " +
      "tabs. These tabs provide alternative views of the configuration " +
      "components:");
        paragraph("For ease of reference, the configuration is described on multiple "
                + "tabs. These tabs provide alternative views of the configuration " + "components:");
    beginList();
    bullet("The <strong>Inheritance</strong> view represents the inheritance " +
      "relationships between configuration components. A sub-component " +
      "inherits all of the properties of its parent component.");
    bullet("The <strong>Structure</strong> view represents the structural " +
      "relationships between components and indicates how certain components " +
      "can exist only within container components. When a container " +
      "component is deleted, all of the components within it are also " +
      "deleted.");
    bullet(
      "The <strong>Components</strong> view provides an alphabetical list " +
      "of all configuration components.");
    bullet(
      "The <strong>Properties</strong> view provides an alphabetical list " +
      "of all configuration properties, and indicates the configuration " +
      "component to which each property applies.");
        bullet("The <strong>Inheritance</strong> view represents the inheritance "
                + "relationships between configuration components. A sub-component "
                + "inherits all of the properties of its parent component.");
        bullet("The <strong>Structure</strong> view represents the structural "
                + "relationships between components and indicates how certain components "
                + "can exist only within container components. When a container "
                + "component is deleted, all of the components within it are also " + "deleted.");
        bullet("The <strong>Components</strong> view provides an alphabetical list "
                + "of all configuration components.");
        bullet("The <strong>Properties</strong> view provides an alphabetical list "
                + "of all configuration properties, and indicates the configuration "
                + "component to which each property applies.");
    endList();
    newline();
    paragraph("When you set up " +
            DynamicConstants.PRODUCT_NAME +
            ", certain components are created in the " +
      "configuration by default. These components are configured with " +
      "specific values, which are not necessarily the same as the " +
      "\"default values\" of new components that you create using dsconfig. " +
      "The \"default values\" listed in this document refer to the values " +
      "of the new components that you create using dsconfig.");
        paragraph("When you set up " + DynamicConstants.PRODUCT_NAME + ", certain components are created in the "
                + "configuration by default. These components are configured with "
                + "specific values, which are not necessarily the same as the "
                + "\"default values\" of new components that you create using dsconfig. "
                + "The \"default values\" listed in this document refer to the values "
                + "of the new components that you create using dsconfig.");
    htmlFooter();
    generateFile(WELCOME_FILE);
@@ -988,23 +902,16 @@
  }
  private void genMainTopPage() {
    htmlHeader(DynamicConstants.PRODUCT_NAME +
            " Configuration Reference - Main Top");
    htmlBuff.append("<div class=\"breadcrumb\"><span class=\"pageactions\">" +
      "<a href=\"" + OpenDJHome + "\" target=\"_parent\">" +
      "<span style=\"font-size: 12px;\">&laquo;&nbsp;&nbsp;</span>" +
      "Back to " +
      DynamicConstants.PRODUCT_NAME + " Home</a></span>&nbsp;&nbsp;</div>\n");
    htmlBuff.append("<table class=\"titletable\" cellspacing=\"0\" " +
      "width=\"100%\">\n");
        htmlHeader(DynamicConstants.PRODUCT_NAME + " Configuration Reference - Main Top");
        htmlBuff.append("<div class=\"breadcrumb\"><span class=\"pageactions\">" + "<a href=\"" + OpenDJHome
                + "\" target=\"_parent\">" + "<span style=\"font-size: 12px;\">&laquo;&nbsp;&nbsp;</span>" + "Back to "
                + DynamicConstants.PRODUCT_NAME + " Home</a></span>&nbsp;&nbsp;</div>\n");
        htmlBuff.append("<table class=\"titletable\" cellspacing=\"0\" " + "width=\"100%\">\n");
    htmlBuff.append("<tbody><tr>\n");
    htmlBuff.append("  <td><h2>"+
            DynamicConstants.PRODUCT_NAME +
            " Configuration Reference</h2></td>\n");
    htmlBuff.append("  <td valign=\"bottom\" width=\"10%\">" +
      "<a href=\"" + OpenDJHome + "\" target=\"_parent\">" +
      "<img src=\"opendj_logo_sm.png\" alt=\"OpenDJ Logo\" align=\"bottom\" " +
      "border=\"0\" height=\"33\" width=\"114\"></a></td>\n");
        htmlBuff.append("  <td><h2>" + DynamicConstants.PRODUCT_NAME + " Configuration Reference</h2></td>\n");
        htmlBuff.append("  <td valign=\"bottom\" width=\"10%\">" + "<a href=\"" + OpenDJHome + "\" target=\"_parent\">"
                + "<img src=\"opendj_logo_sm.png\" alt=\"OpenDJ Logo\" align=\"bottom\" "
                + "border=\"0\" height=\"33\" width=\"114\"></a></td>\n");
    htmlBuff.append("</tr>\n");
    htmlBuff.append("</tbody></table>\n");
@@ -1014,22 +921,17 @@
  }
  private void genIndexPage() {
    htmlBuff.append(getHtmlHeader(
            DynamicConstants.PRODUCT_NAME + " Configuration Reference"));
        htmlBuff.append(getHtmlHeader(DynamicConstants.PRODUCT_NAME + " Configuration Reference"));
    htmlBuff.append("<frameset rows=\"80,*\" framespacing=\"1\" " +
      "frameborder=\"yes\" border=\"1\" bordercolor=\"#333333\">\n");
    htmlBuff.append("  <frame src=\"" + MAINTOP_FILE + "\" name=\"topFrame\" " +
      "id=\"topFrame\" border=\"1\" title=\"topFrame\" scrolling=\"no\">\n");
    htmlBuff.append("  <frameset cols=\"375,*\" frameborder=\"yes\" " +
      "border=\"1\" " +
      "framespacing=\"1\">\n");
    htmlBuff.append("     <frame src=\"" + INHERITANCE_TREE_FILE + "\" " +
      "name=\"leftFrame\" id=\"leftFrame\" title=\"leftFrame\" " +
      "scrolling=\"auto\">\n");
    htmlBuff.append("     <frame src=\"" + WELCOME_FILE +
      "\" name=\"mainFrame\" " +
      "id=\"mainFrame\" title=\"mainFrame\" scrolling=\"auto\">\n");
        htmlBuff.append("<frameset rows=\"80,*\" framespacing=\"1\" "
                + "frameborder=\"yes\" border=\"1\" bordercolor=\"#333333\">\n");
        htmlBuff.append("  <frame src=\"" + MAINTOP_FILE + "\" name=\"topFrame\" "
                + "id=\"topFrame\" border=\"1\" title=\"topFrame\" scrolling=\"no\">\n");
        htmlBuff.append("  <frameset cols=\"375,*\" frameborder=\"yes\" " + "border=\"1\" " + "framespacing=\"1\">\n");
        htmlBuff.append("     <frame src=\"" + INHERITANCE_TREE_FILE + "\" "
                + "name=\"leftFrame\" id=\"leftFrame\" title=\"leftFrame\" " + "scrolling=\"auto\">\n");
        htmlBuff.append("     <frame src=\"" + WELCOME_FILE + "\" name=\"mainFrame\" "
                + "id=\"mainFrame\" title=\"mainFrame\" scrolling=\"auto\">\n");
    htmlBuff.append("   </frameset>\n");
    htmlBuff.append("</frameset>\n");
    htmlBuff.append("<noframes><body>\n");
@@ -1040,8 +942,7 @@
    generateFile(INDEX_FILE);
  }
  private String getBaseDN(
    AbstractManagedObjectDefinition mo, LDAPProfile ldapProfile) {
    private String getBaseDN(AbstractManagedObjectDefinition mo, LDAPProfile ldapProfile) {
    RelationDefinition rel = relList.get(mo.getName());
    if (rel != null) {
@@ -1064,8 +965,7 @@
  @SuppressWarnings("unchecked")
  private String getSyntaxStr(PropertyDefinition prop) {
    // Create a visitor for performing syntax specific processing.
    PropertyDefinitionVisitor<String, Void> visitor =
      new PropertyDefinitionVisitor<String, Void>() {
        PropertyDefinitionVisitor<String, Void> visitor = new PropertyDefinitionVisitor<String, Void>() {
      @Override
      public String visitACI(ACIPropertyDefinition prop, Void p) {
@@ -1073,20 +973,19 @@
      }
      @Override
      public String visitAggregation(
        AggregationPropertyDefinition prop, Void p) {
            public String visitAggregation(AggregationPropertyDefinition prop, Void p) {
        RelationDefinition rel = prop.getRelationDefinition();
        String linkStr = getLink(rel.getUserFriendlyName().toString(),
          rel.getName() + ".html");
      return "The DN of any " +  linkStr + ". " +
        ((prop.getSourceConstraintSynopsis() != null) ?
          prop.getSourceConstraintSynopsis().toString() : "");
                String linkStr = getLink(rel.getUserFriendlyName().toString(), rel.getName() + ".html");
                return "The DN of any "
                        + linkStr
                        + ". "
                        + ((prop.getSourceConstraintSynopsis() != null) ? prop.getSourceConstraintSynopsis().toString()
                                : "");
      }
      @Override
      public String visitAttributeType(
        AttributeTypePropertyDefinition prop, Void p) {
            public String visitAttributeType(AttributeTypePropertyDefinition prop, Void p) {
        return "The name of an attribute type defined in the server schema.";
      }
@@ -1097,8 +996,7 @@
      @Override
      public String visitClass(ClassPropertyDefinition prop, Void p) {
        String classStr =
          "A java class that implements or extends the class(es) :";
                String classStr = "A java class that implements or extends the class(es) :";
        for (String clazz : prop.getInstanceOfInterface()) {
          classStr += getNewLine() + clazz;
        }
@@ -1118,24 +1016,19 @@
      public String visitDuration(DurationPropertyDefinition prop, Void p) {
        String durationStr = "";
        durationStr += getLink("A duration Syntax", durationSyntaxPage) +
          ". ";
                durationStr += getLink("A duration Syntax", durationSyntaxPage) + ". ";
        if (prop.isAllowUnlimited()) {
          durationStr += "A value of \"-1\" or \"unlimited\" for no limit. ";
        }
        if (prop.getMaximumUnit() != null) {
          durationStr += "Maximum unit is \"" +
            prop.getMaximumUnit().getLongName() + "\". ";
                    durationStr += "Maximum unit is \"" + prop.getMaximumUnit().getLongName() + "\". ";
        }
        long lowerLimitStr = new Double(prop.getBaseUnit().
          fromMilliSeconds(prop.getLowerLimit())).longValue();
        durationStr += "Lower limit is " + lowerLimitStr +
          " " + prop.getBaseUnit().getLongName() + ". ";
                long lowerLimitStr = new Double(prop.getBaseUnit().fromMilliSeconds(prop.getLowerLimit())).longValue();
                durationStr += "Lower limit is " + lowerLimitStr + " " + prop.getBaseUnit().getLongName() + ". ";
        if (prop.getUpperLimit() != null) {
          long upperLimitStr = new Double(prop.getBaseUnit().
            fromMilliSeconds(prop.getUpperLimit())).longValue();
          durationStr += "Upper limit is " + upperLimitStr +
            " " + prop.getBaseUnit().getLongName() + ". ";
                    long upperLimitStr = new Double(prop.getBaseUnit().fromMilliSeconds(prop.getUpperLimit()))
                            .longValue();
                    durationStr += "Upper limit is " + upperLimitStr + " " + prop.getBaseUnit().getLongName() + ". ";
        }
        return durationStr;
@@ -1177,8 +1070,7 @@
      }
      @Override
      public String visitIPAddressMask(
        IPAddressMaskPropertyDefinition prop, Void p) {
            public String visitIPAddressMask(IPAddressMaskPropertyDefinition prop, Void p) {
        return "An IP address mask";
      }
@@ -1225,32 +1117,23 @@
    if (defaultBehav instanceof UndefinedDefaultBehaviorProvider) {
      defValueStr = "None";
    } else if (defaultBehav instanceof DefinedDefaultBehaviorProvider) {
      DefinedDefaultBehaviorProvider defBehav =
        (DefinedDefaultBehaviorProvider) defaultBehav;
      for (Iterator<String> it = defBehav.getDefaultValues().iterator();
      it.hasNext();) {
            DefinedDefaultBehaviorProvider defBehav = (DefinedDefaultBehaviorProvider) defaultBehav;
            for (Iterator<String> it = defBehav.getDefaultValues().iterator(); it.hasNext();) {
        String str = it.next();
        defValueStr += str + (it.hasNext() ? "\n" : "");
      }
    } else if (defaultBehav instanceof AliasDefaultBehaviorProvider) {
      AliasDefaultBehaviorProvider aliasBehav = (
        AliasDefaultBehaviorProvider) defaultBehav;
            AliasDefaultBehaviorProvider aliasBehav = (AliasDefaultBehaviorProvider) defaultBehav;
      defValueStr = aliasBehav.getSynopsis().toString();
    } else if
      (defaultBehav instanceof RelativeInheritedDefaultBehaviorProvider) {
      RelativeInheritedDefaultBehaviorProvider relativBehav =
        (RelativeInheritedDefaultBehaviorProvider) defaultBehav;
      defValueStr = getDefaultBehaviorString(
        relativBehav.getManagedObjectDefinition().
        getPropertyDefinition(relativBehav.getPropertyName()));
    } else if
      (defaultBehav instanceof AbsoluteInheritedDefaultBehaviorProvider) {
      AbsoluteInheritedDefaultBehaviorProvider absoluteBehav =
        (AbsoluteInheritedDefaultBehaviorProvider) defaultBehav;
      defValueStr = getDefaultBehaviorString(
        absoluteBehav.getManagedObjectDefinition().
        getPropertyDefinition(absoluteBehav.getPropertyName()));
        } else if (defaultBehav instanceof RelativeInheritedDefaultBehaviorProvider) {
            RelativeInheritedDefaultBehaviorProvider relativBehav = (RelativeInheritedDefaultBehaviorProvider) defaultBehav;
            defValueStr = getDefaultBehaviorString(relativBehav.getManagedObjectDefinition().getPropertyDefinition(
                    relativBehav.getPropertyName()));
        } else if (defaultBehav instanceof AbsoluteInheritedDefaultBehaviorProvider) {
            AbsoluteInheritedDefaultBehaviorProvider absoluteBehav = (AbsoluteInheritedDefaultBehaviorProvider) defaultBehav;
            defValueStr = getDefaultBehaviorString(absoluteBehav.getManagedObjectDefinition().getPropertyDefinition(
                    absoluteBehav.getPropertyName()));
    }
    return defValueStr;
  }
@@ -1261,11 +1144,9 @@
    if (coll == null) {
      return null;
    }
    TreeMap<String, AbstractManagedObjectDefinition> map =
      new TreeMap<String, AbstractManagedObjectDefinition>();
        TreeMap<String, AbstractManagedObjectDefinition> map = new TreeMap<String, AbstractManagedObjectDefinition>();
    for (AbstractManagedObjectDefinition mo : coll) {
      if (mo.hasOption(ManagedObjectOption.HIDDEN))
      {
            if (mo.hasOption(ManagedObjectOption.HIDDEN)) {
        continue;
      }
      map.put(mo.getName(), mo);
@@ -1273,28 +1154,24 @@
    return map;
  }
  private TreeMap<String, RelationDefinition> makeRelTreeMap(
    Collection<RelationDefinition> coll) {
    private TreeMap<String, RelationDefinition> makeRelTreeMap(Collection<RelationDefinition> coll) {
    if (coll == null) {
      return null;
    }
    TreeMap<String, RelationDefinition> map =
      new TreeMap<String, RelationDefinition>();
        TreeMap<String, RelationDefinition> map = new TreeMap<String, RelationDefinition>();
    for (RelationDefinition rel : coll) {
      map.put(rel.getChildDefinition().getName(), rel);
    }
    return map;
  }
  private TreeMap<String, PropertyDefinition> makePropTreeMap(
    Collection<PropertyDefinition> coll) {
    private TreeMap<String, PropertyDefinition> makePropTreeMap(Collection<PropertyDefinition> coll) {
    if (coll == null) {
      return null;
    }
    TreeMap<String, PropertyDefinition> map =
      new TreeMap<String, PropertyDefinition>();
        TreeMap<String, PropertyDefinition> map = new TreeMap<String, PropertyDefinition>();
    for (PropertyDefinition prop : coll) {
      map.put(prop.getName(), prop);
    }
@@ -1311,10 +1188,7 @@
  }
  private void bullet(String str) {
    htmlBuff.append(
      "<li>" +
      str +
      "</li>\n");
        htmlBuff.append("<li>" + str + "</li>\n");
  }
  private void heading2(String string) {
@@ -1335,10 +1209,7 @@
  private String getHeading(String str, int level) {
    String strLevel = (new Integer(level)).toString();
    return "<h" + strLevel + ">" +
      "<a name=\"" + str + "\"></a>" +
      str +
      "</h" + strLevel + ">\n";
        return "<h" + strLevel + ">" + "<a name=\"" + str + "\"></a>" + str + "</h" + strLevel + ">\n";
  }
  private String getHeading2(String str) {
@@ -1350,53 +1221,37 @@
  }
  private void htmlHeader(String pageTitle) {
    htmlBuff.append(getHtmlHeader(pageTitle) +
      "<body>\n");
        htmlBuff.append(getHtmlHeader(pageTitle) + "<body>\n");
  }
  private final String Now = new Date().toString();
  private String getHtmlHeader(String pageTitle) {
    return ("<html>\n" +
      "<head>\n" +
      "<meta http-equiv=\"content-type\"\n" +
      "content=\"text/html; charset=ISO-8859-1\">\n" +
      "<title>" + pageTitle + "</title>\n" +
      "<link rel=\"stylesheet\" type=\"text/css\"\n" +
      "href=\"" + CSS_FILE + "\">\n" +
      "<link rel=\"shortcut icon\" href=\"" + FAVICON + "\">\n" +
      "<meta name=\"date generated\" content=\"" + Now + "\">\n" +
      "</head>\n");
        return ("<html>\n" + "<head>\n" + "<meta http-equiv=\"content-type\"\n"
                + "content=\"text/html; charset=ISO-8859-1\">\n" + "<title>" + pageTitle + "</title>\n"
                + "<link rel=\"stylesheet\" type=\"text/css\"\n" + "href=\"" + CSS_FILE + "\">\n"
                + "<link rel=\"shortcut icon\" href=\"" + FAVICON + "\">\n"
                + "<meta name=\"date generated\" content=\"" + Now + "\">\n" + "</head>\n");
  }
  // Add a Tab Menu, the active tab is the one given as parameter
  private void tabMenu(String activeTab) {
    htmlBuff.append(
      "<div class=\"tabmenu\"> " +
        htmlBuff.append("<div class=\"tabmenu\"> " +
      "<span><a " +
      (activeTab.equals(INHERITANCE_TREE_FILE) ? "class=\"activetab\" " : "") +
      "href=\"" + INHERITANCE_TREE_FILE + "\"" +
      " title=\"Inheritance View of Components\">Inheritance</a></span> " +
        "<span><a " + (activeTab.equals(INHERITANCE_TREE_FILE) ? "class=\"activetab\" " : "") + "href=\""
                + INHERITANCE_TREE_FILE + "\"" + " title=\"Inheritance View of Components\">Inheritance</a></span> " +
      "<span><a " +
      (activeTab.equals(RELATION_TREE_FILE) ? "class=\"activetab\" " : "") +
      "href=\"" + RELATION_TREE_FILE + "\"" +
      " title=\"Relational View of Components\">Structure</a></span> " +
                "<span><a " + (activeTab.equals(RELATION_TREE_FILE) ? "class=\"activetab\" " : "") + "href=\""
                + RELATION_TREE_FILE + "\"" + " title=\"Relational View of Components\">Structure</a></span> " +
      "<span><a " +
      (activeTab.equals(MO_LIST_FILE) ? "class=\"activetab\" " : "") +
      "href=\"" + MO_LIST_FILE + "\"" +
      " title=\"Alphabetical Index of Components\">Components</a></span> " +
                "<span><a " + (activeTab.equals(MO_LIST_FILE) ? "class=\"activetab\" " : "") + "href=\"" + MO_LIST_FILE
                + "\"" + " title=\"Alphabetical Index of Components\">Components</a></span> " +
      "<span><a " +
      (activeTab.equals(PROPERTIES_INDEX_FILE) ? "class=\"activetab\" " : "") +
      "href=\"" + PROPERTIES_INDEX_FILE + "\"" +
      " title=\"Alphabetical Index of Properties\" >Properties</a></span>" +
                "<span><a " + (activeTab.equals(PROPERTIES_INDEX_FILE) ? "class=\"activetab\" " : "") + "href=\""
                + PROPERTIES_INDEX_FILE + "\"" + " title=\"Alphabetical Index of Properties\" >Properties</a></span>" +
      "</div>" +
      "\n"
      );
                "</div>" + "\n");
  }
  private String getLink(String str, String link) {
@@ -1408,12 +1263,8 @@
  }
  private String getLink(String str, String link, String target, String color) {
    return "<a " +
      (color != null ? "style=\"color:" + color + "\" " : "") +
      "href=\"" + link + "\"" +
      (target == null ? "" : " target=\"" + target + "\"") +
      ">"
      + str + "</a>";
        return "<a " + (color != null ? "style=\"color:" + color + "\" " : "") + "href=\"" + link + "\""
                + (target == null ? "" : " target=\"" + target + "\"") + ">" + str + "</a>";
  }
  private void link(String str, String link) {
@@ -1444,15 +1295,14 @@
  }
  private void newline() {
    htmlBuff.append(
      getNewLine());
        htmlBuff.append(getNewLine());
  }
  private String getNewLine() {
    return "<br>\n";
  }
  private void paragraph(Message description) {
    private void paragraph(LocalizableMessage description) {
    if (description != null) {
      paragraph(description.toString());
    }
@@ -1482,14 +1332,7 @@
      classStr = "class=" + pClass;
    }
    htmlBuff.append(
      "<p " +
      indentStr + " " +
      styleStr + " " +
      classStr +
      ">" +
      description +
      "</p>\n");
        htmlBuff.append("<p " + indentStr + " " + styleStr + " " + classStr + ">" + description + "</p>\n");
  }
  private int getIndentPixels() {
@@ -1497,20 +1340,14 @@
  }
  private void startTable() {
    htmlBuff.append(
      "<table " +
      "style=\"width: 100%; text-align: left;\"" +
      "border=\"1\"" +
      "cellpadding=\"1\"" +
      "cellspacing=\"0\"" +
      ">\n");
        htmlBuff.append("<table " + "style=\"width: 100%; text-align: left;\"" + "border=\"1\"" + "cellpadding=\"1\""
                + "cellspacing=\"0\"" + ">\n");
    htmlBuff.append("<tbody>\n");
  }
  /*
   * Generate a "friendly" name from a string :
   * '-' and '_' replaced by space
     * Generate a "friendly" name from a string : '-' and '_' replaced by space
   * first letter of a word in uppercase
   */
  private String getFriendlyName(String str) {
@@ -1528,20 +1365,13 @@
  }
  private void tableRow(String... strings) {
    htmlBuff.append(
      "<tr>\n");
        htmlBuff.append("<tr>\n");
    for (int ii = 0; ii < strings.length; ii++) {
      String string = strings[ii];
      htmlBuff.append(
        "<td style=\"" +
        "vertical-align: top; " +
        ((ii == 0) ? "width: 20%;" : "") +
        "\">" +
        string +
        "<br></td>");
            htmlBuff.append("<td style=\"" + "vertical-align: top; " + ((ii == 0) ? "width: 20%;" : "") + "\">"
                    + string + "<br></td>");
    }
    htmlBuff.append(
      "</tr>\n");
        htmlBuff.append("</tr>\n");
  }
  /**
@@ -1555,8 +1385,7 @@
  private void beginList() {
    inList = true;
    listLevel++;
    htmlBuff.append(
      "<ul>\n");
        htmlBuff.append("<ul>\n");
  }
  private void endList() {
@@ -1564,23 +1393,15 @@
    if (listLevel == 0) {
      inList = false;
    }
    htmlBuff.append(
      "</ul>\n");
        htmlBuff.append("</ul>\n");
  }
  private void htmlFooter() {
    htmlBuff.append(
      "</body>\n" +
      "</html>\n");
        htmlBuff.append("</body>\n" + "</html>\n");
  }
  private void viewHelp(String helpStr) {
    htmlBuff.append(
      "<p class=\"view-help\" >" +
      helpStr +
      "</p>" +
      "\n"
      );
        htmlBuff.append("<p class=\"view-help\" >" + helpStr + "</p>" + "\n");
  }
  private void generateFile(String fileName) {
@@ -1599,21 +1420,13 @@
  }
  // Relation List from RootConfiguration
  private final TreeMap<String, RelationDefinition> topRelList =
    new TreeMap<String, RelationDefinition>();
  private final TreeMap<String, RelationDefinition> relList =
    new TreeMap<String, RelationDefinition>();
  private final TreeMap<String, TreeMap<String, RelationDefinition>>
    catTopRelList = new TreeMap<String, TreeMap<String, RelationDefinition>>();
    private final TreeMap<String, RelationDefinition> topRelList = new TreeMap<String, RelationDefinition>();
    private final TreeMap<String, RelationDefinition> relList = new TreeMap<String, RelationDefinition>();
    private final TreeMap<String, TreeMap<String, RelationDefinition>> catTopRelList = new TreeMap<String, TreeMap<String, RelationDefinition>>();
  // managed object list
  private final TreeMap<String, AbstractManagedObjectDefinition> moList =
    new TreeMap<String, AbstractManagedObjectDefinition>();
  private final TreeMap<String, AbstractManagedObjectDefinition> topMoList =
    new TreeMap<String, AbstractManagedObjectDefinition>();
  private final TreeMap<String,
                        TreeMap<String, AbstractManagedObjectDefinition>>
    catTopMoList =
      new TreeMap<String, TreeMap<String, AbstractManagedObjectDefinition>>();
    private final TreeMap<String, AbstractManagedObjectDefinition> moList = new TreeMap<String, AbstractManagedObjectDefinition>();
    private final TreeMap<String, AbstractManagedObjectDefinition> topMoList = new TreeMap<String, AbstractManagedObjectDefinition>();
    private final TreeMap<String, TreeMap<String, AbstractManagedObjectDefinition>> catTopMoList = new TreeMap<String, TreeMap<String, AbstractManagedObjectDefinition>>();
  private final int ind = 0;
  private StringBuffer htmlBuff = new StringBuffer();
  private static String generationDir;
opendj-admin/src/main/java/org/opends/server/admin/doc/package-info.java
@@ -25,14 +25,10 @@
 *      Copyright 2007-2008 Sun Microsystems, Inc.
 */
/**
 * Administration documentation classes.
 * <p>
 * This package contains classes used to generate administration documentation.
 */
@org.opends.server.types.PublicAPI(
     stability=org.opends.server.types.StabilityLevel.PRIVATE)
package org.opends.server.admin.doc;
opendj-admin/src/main/java/org/opends/server/admin/server/AbstractConfigListenerAdaptor.java
@@ -30,8 +30,8 @@
import java.util.Collection;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
@@ -57,10 +57,10 @@
   * @param unacceptableReason
   *          The single message to which messages should be appended.
   */
  protected final void generateUnacceptableReason(Collection<Message> reasons,
      MessageBuilder unacceptableReason) {
  protected final void generateUnacceptableReason(Collection<LocalizableMessage> reasons,
      LocalizableMessageBuilder unacceptableReason) {
    boolean isFirst = true;
    for (Message reason : reasons) {
    for (LocalizableMessage reason : reasons) {
      if (isFirst) {
        isFirst = false;
      } else {
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigAddListenerAdaptor.java
@@ -33,8 +33,8 @@
import java.util.LinkedList;
import java.util.List;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.opends.server.admin.Configuration;
import org.opends.server.admin.Constraint;
import org.opends.server.admin.DecodingException;
@@ -213,7 +213,7 @@
   * {@inheritDoc}
   */
  public boolean configAddIsAcceptable(ConfigEntry configEntry,
      MessageBuilder unacceptableReason) {
      LocalizableMessageBuilder unacceptableReason) {
    DN dn = configEntry.getDN();
    AttributeValue av = dn.getRDN().getAttributeValue(0);
    String name = av.getValue().toString().trim();
@@ -257,7 +257,7 @@
    }
    // Let the add listener decide.
    List<Message> reasons = new LinkedList<Message>();
    List<LocalizableMessage> reasons = new LinkedList<Message>();
    if (listener.isConfigurationAddAcceptable(cachedManagedObject, reasons)) {
      return true;
    } else {
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigChangeListenerAdaptor.java
@@ -37,8 +37,8 @@
import java.util.Set;
import org.opends.messages.AdminMessages;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.opends.server.admin.AbsoluteInheritedDefaultBehaviorProvider;
import org.opends.server.admin.AbstractManagedObjectDefinition;
import org.opends.server.admin.AliasDefaultBehaviorProvider;
@@ -262,7 +262,7 @@
      public boolean configChangeIsAcceptable(ConfigEntry configEntry,
          MessageBuilder unacceptableReason) {
          LocalizableMessageBuilder unacceptableReason) {
        ConfigEntry dependentConfigEntry = getConfigEntry(dn);
        if (dependentConfigEntry != null) {
          return ConfigChangeListenerAdaptor.this.configChangeIsAcceptable(
@@ -310,7 +310,7 @@
      public boolean configDeleteIsAcceptable(ConfigEntry configEntry,
          MessageBuilder unacceptableReason) {
          LocalizableMessageBuilder unacceptableReason) {
        // Always acceptable.
        return true;
      }
@@ -369,7 +369,7 @@
   * {@inheritDoc}
   */
  public boolean configChangeIsAcceptable(ConfigEntry configEntry,
      MessageBuilder unacceptableReason) {
      LocalizableMessageBuilder unacceptableReason) {
    return configChangeIsAcceptable(configEntry, unacceptableReason,
        configEntry);
  }
@@ -396,7 +396,7 @@
   *         does not.
   */
  public boolean configChangeIsAcceptable(ConfigEntry configEntry,
      MessageBuilder unacceptableReason, ConfigEntry newConfigEntry) {
      LocalizableMessageBuilder unacceptableReason, ConfigEntry newConfigEntry) {
    try {
      ServerManagementContext context = ServerManagementContext.getInstance();
      cachedManagedObject = context.decode(path, configEntry, newConfigEntry);
@@ -414,7 +414,7 @@
    }
    // Let the change listener decide.
    List<Message> reasons = new LinkedList<Message>();
    List<LocalizableMessage> reasons = new LinkedList<Message>();
    if (listener.isConfigurationChangeAcceptable(cachedManagedObject,reasons)) {
      return true;
    } else {
@@ -471,7 +471,7 @@
      if (configEntry != null) {
        return configEntry;
      } else {
        Message message = AdminMessages.ERR_ADMIN_MANAGED_OBJECT_DOES_NOT_EXIST
        LocalizableMessage message = AdminMessages.ERR_ADMIN_MANAGED_OBJECT_DOES_NOT_EXIST
            .get(String.valueOf(dn));
        ErrorLogger.logError(message);
      }
@@ -481,7 +481,7 @@
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message = AdminMessages.ERR_ADMIN_CANNOT_GET_MANAGED_OBJECT.get(
      LocalizableMessage message = AdminMessages.ERR_ADMIN_CANNOT_GET_MANAGED_OBJECT.get(
          String.valueOf(dn), StaticUtils.getExceptionMessage(e));
      ErrorLogger.logError(message);
    }
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigDeleteListenerAdaptor.java
@@ -28,14 +28,14 @@
import static org.opends.messages.AdminMessages.*;
import static com.forgerock.opendj.ldap.AdminMessages.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import java.util.LinkedList;
import java.util.List;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.opends.server.admin.Configuration;
import org.opends.server.admin.Constraint;
import org.opends.server.admin.DecodingException;
@@ -214,7 +214,7 @@
   * {@inheritDoc}
   */
  public boolean configDeleteIsAcceptable(ConfigEntry configEntry,
      MessageBuilder unacceptableReason) {
      LocalizableMessageBuilder unacceptableReason) {
    DN dn = configEntry.getDN();
    AttributeValue av = dn.getRDN().getAttributeValue(0);
    String name = av.getValue().toString().trim();
@@ -249,7 +249,7 @@
      return false;
    }
    List<Message> reasons = new LinkedList<Message>();
    List<LocalizableMessage> reasons = new LinkedList<Message>();
    // Enforce any constraints.
    boolean isDeleteAllowed = true;
@@ -263,7 +263,7 @@
            isDeleteAllowed = false;
          }
        } catch (ConfigException e) {
          Message message = ERR_SERVER_CONSTRAINT_EXCEPTION.get(e
          LocalizableMessage message = ERR_SERVER_CONSTRAINT_EXCEPTION.get(e
              .getMessageObject());
          reasons.add(message);
          isDeleteAllowed = false;
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigExceptionFactory.java
@@ -25,7 +25,7 @@
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin.server;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
@@ -78,7 +78,7 @@
   */
  public ConfigException createDecodingExceptionAdaptor(DN dn,
      DefinitionDecodingException e) {
    Message message = AdminMessages.ERR_ADMIN_MANAGED_OBJECT_DECODING_PROBLEM.
    LocalizableMessage message = AdminMessages.ERR_ADMIN_MANAGED_OBJECT_DECODING_PROBLEM.
        get(String.valueOf(dn), stackTraceToSingleLineString(e));
    return new ConfigException(message, e);
  }
@@ -97,7 +97,7 @@
  public ConfigException createDecodingExceptionAdaptor(
      ServerManagedObjectDecodingException e) {
    DN dn = e.getPartialManagedObject().getDN();
    Message message =
    LocalizableMessage message =
            AdminMessages.ERR_ADMIN_MANAGED_OBJECT_DECODING_PROBLEM.get(
                    String.valueOf(dn),
        stackTraceToSingleLineString(e));
@@ -117,7 +117,7 @@
  public ConfigException createDecodingExceptionAdaptor(
      ConstraintViolationException e) {
    DN dn = e.getManagedObject().getDN();
    Message message = AdminMessages.ERR_ADMIN_MANAGED_OBJECT_DECODING_PROBLEM
    LocalizableMessage message = AdminMessages.ERR_ADMIN_MANAGED_OBJECT_DECODING_PROBLEM
        .get(String.valueOf(dn), stackTraceToSingleLineString(e));
    return new ConfigException(message, e);
  }
@@ -140,7 +140,7 @@
  public ConfigException createClassLoadingExceptionAdaptor(DN dn,
      String className, Exception e) {
    Message message = AdminMessages.ERR_ADMIN_CANNOT_INSTANTIATE_CLASS.
    LocalizableMessage message = AdminMessages.ERR_ADMIN_CANNOT_INSTANTIATE_CLASS.
        get(String.valueOf(className), String.valueOf(dn),
            stackTraceToSingleLineString(e));
    return new ConfigException(message, e);
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigurationAddListener.java
@@ -25,7 +25,7 @@
 *      Copyright 2007-2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin.server;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
@@ -60,7 +60,7 @@
   *         acceptable, or <code>false</code> if it is not.
   */
  public boolean isConfigurationAddAcceptable(T configuration,
      List<Message> unacceptableReasons);
      List<LocalizableMessage> unacceptableReasons);
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigurationChangeListener.java
@@ -25,7 +25,7 @@
 *      Copyright 2007-2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin.server;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
@@ -61,7 +61,7 @@
   *         acceptable, or <code>false</code> if it is not.
   */
  public boolean isConfigurationChangeAcceptable(T configuration,
      List<Message> unacceptableReasons);
      List<LocalizableMessage> unacceptableReasons);
opendj-admin/src/main/java/org/opends/server/admin/server/ConfigurationDeleteListener.java
@@ -25,7 +25,7 @@
 *      Copyright 2007-2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin.server;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
@@ -60,7 +60,7 @@
   *         acceptable, or <code>false</code> if it is not.
   */
  public boolean isConfigurationDeleteAcceptable(T configuration,
      List<Message> unacceptableReasons);
      List<LocalizableMessage> unacceptableReasons);
opendj-admin/src/main/java/org/opends/server/admin/server/ConstraintViolationException.java
@@ -29,16 +29,16 @@
import static org.opends.messages.AdminMessages.*;
import static com.forgerock.opendj.ldap.AdminMessages.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.opends.server.admin.DecodingException;
import org.opends.server.util.Validator;
import static com.forgerock.opendj.util.Validator.*;
@@ -60,7 +60,7 @@
  // Gets the default message.
  private static Message getDefaultMessage(Collection<Message> messages) {
  private static LocalizableMessage getDefaultMessage(Collection<Message> messages) {
    Validator.ensureNotNull(messages);
    Validator.ensureTrue(!messages.isEmpty());
@@ -76,14 +76,14 @@
  // Merge the messages into a single message.
  private static Message getSingleMessage(Collection<Message> messages) {
  private static LocalizableMessage getSingleMessage(Collection<Message> messages) {
    if (messages.size() == 1) {
      return messages.iterator().next();
    } else {
      MessageBuilder builder = new MessageBuilder();
      LocalizableMessageBuilder builder = new MessageBuilder();
      boolean isFirst = true;
      for (Message m : messages) {
      for (LocalizableMessage m : messages) {
        if (!isFirst) {
          builder.append(";  ");
        }
@@ -96,7 +96,7 @@
  }
  // The messages describing the constraint violations that occurred.
  private final Collection<Message> messages;
  private final Collection<LocalizableMessage> messages;
@@ -113,11 +113,11 @@
   *          non-empty).
   */
  public ConstraintViolationException(ServerManagedObject<?> managedObject,
      Collection<Message> messages) {
      Collection<LocalizableMessage> messages) {
    super(getDefaultMessage(messages));
    this.managedObject = managedObject;
    this.messages = new ArrayList<Message>(messages);
    this.messages = new ArrayList<LocalizableMessage>(messages);
  }
@@ -134,7 +134,7 @@
   *          occurred.
   */
  public ConstraintViolationException(ServerManagedObject<?> managedObject,
      Message message) {
      LocalizableMessage message) {
    this(managedObject, Collections.singleton(message));
  }
@@ -147,7 +147,7 @@
   * @return Returns an unmodifiable collection view of the messages
   *         describing the constraint violations that occurred.
   */
  public Collection<Message> getMessages() {
  public Collection<LocalizableMessage> getMessages() {
    return Collections.unmodifiableCollection(messages);
  }
@@ -160,7 +160,7 @@
   * @return Returns a single message listing all the messages
   *         combined into a single list separated by semi-colons.
   */
  public Message getMessagesAsSingleMessage() {
  public LocalizableMessage getMessagesAsSingleMessage() {
    return getSingleMessage(messages);
  }
opendj-admin/src/main/java/org/opends/server/admin/server/DelayedConfigAddListener.java
@@ -40,7 +40,7 @@
import org.forgerock.opendj.ldap.DN;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.ResultCode;
import org.opends.messages.MessageBuilder;
import org.forgerock.i18n.LocalizableMessageBuilder;
/**
@@ -155,7 +155,7 @@
   * {@inheritDoc}
   */
  public boolean configAddIsAcceptable(ConfigEntry configEntry,
      MessageBuilder unacceptableReason) {
      LocalizableMessageBuilder unacceptableReason) {
    // Always acceptable.
    return true;
  }
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObject.java
@@ -1165,7 +1165,7 @@
  void ensureIsUsable() throws ConstraintViolationException {
    // Enforce any constraints.
    boolean isUsable = true;
    List<Message> reasons = new LinkedList<Message>();
    List<LocalizableMessage> reasons = new LinkedList<Message>();
    for (Constraint constraint : definition.getAllConstraints()) {
      for (ServerConstraintHandler handler : constraint
          .getServerConstraintHandlers()) {
@@ -1174,7 +1174,7 @@
            isUsable = false;
          }
        } catch (ConfigException e) {
          Message message = ERR_SERVER_CONSTRAINT_EXCEPTION.get(e
          LocalizableMessage message = ERR_SERVER_CONSTRAINT_EXCEPTION.get(e
              .getMessageObject());
          reasons.add(message);
          isUsable = false;
@@ -1356,7 +1356,7 @@
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message = ERR_ADMIN_CANNOT_GET_LISTENER_BASE.get(
      LocalizableMessage message = ERR_ADMIN_CANNOT_GET_LISTENER_BASE.get(
          String.valueOf(dn), stackTraceToSingleLineString(e));
      throw new ConfigException(message, e);
    }
@@ -1402,7 +1402,7 @@
    }
    // No parent entry could be found.
    Message message = ERR_ADMIN_UNABLE_TO_REGISTER_LISTENER
    LocalizableMessage message = ERR_ADMIN_UNABLE_TO_REGISTER_LISTENER
        .get(String.valueOf(baseDN));
    throw new ConfigException(message);
  }
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectAddListener.java
@@ -28,7 +28,7 @@
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
import java.util.List;
@@ -61,7 +61,7 @@
   *         acceptable, or <code>false</code> if it is not.
   */
  public boolean isConfigurationAddAcceptable(
      ServerManagedObject<? extends T> mo, List<Message> unacceptableReasons);
      ServerManagedObject<? extends T> mo, List<LocalizableMessage> unacceptableReasons);
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectAddListenerAdaptor.java
@@ -30,7 +30,7 @@
import java.util.List;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.admin.Configuration;
import org.opends.server.types.ConfigChangeResult;
@@ -92,7 +92,7 @@
   * {@inheritDoc}
   */
  public boolean isConfigurationAddAcceptable(
      ServerManagedObject<? extends T> mo, List<Message> unacceptableReasons) {
      ServerManagedObject<? extends T> mo, List<LocalizableMessage> unacceptableReasons) {
    return listener.isConfigurationAddAcceptable(mo.getConfiguration(),
        unacceptableReasons);
  }
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectChangeListener.java
@@ -28,7 +28,7 @@
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
import java.util.List;
@@ -62,7 +62,7 @@
   *         acceptable, or <code>false</code> if it is not.
   */
  public boolean isConfigurationChangeAcceptable(
      ServerManagedObject<? extends T> mo, List<Message> unacceptableReasons);
      ServerManagedObject<? extends T> mo, List<LocalizableMessage> unacceptableReasons);
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectChangeListenerAdaptor.java
@@ -30,7 +30,7 @@
import java.util.List;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.admin.Configuration;
import org.opends.server.types.ConfigChangeResult;
@@ -94,7 +94,7 @@
   * {@inheritDoc}
   */
  public boolean isConfigurationChangeAcceptable(
      ServerManagedObject<? extends T> mo, List<Message> unacceptableReasons) {
      ServerManagedObject<? extends T> mo, List<LocalizableMessage> unacceptableReasons) {
    return listener.isConfigurationChangeAcceptable(mo.getConfiguration(),
        unacceptableReasons);
  }
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectDecodingException.java
@@ -29,18 +29,18 @@
import static org.opends.messages.AdminMessages.*;
import static com.forgerock.opendj.ldap.AdminMessages.*;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.opends.server.admin.DecodingException;
import org.opends.server.admin.ManagedObjectDefinition;
import org.opends.server.admin.PropertyException;
import org.opends.server.util.Validator;
import static com.forgerock.opendj.util.Validator.*;
@@ -58,11 +58,11 @@
  // Create the message.
  private static Message createMessage(
  private static LocalizableMessage createMessage(
      ServerManagedObject<?> partialManagedObject,
      Collection<PropertyException> causes) {
    Validator.ensureNotNull(causes);
    Validator.ensureTrue(!causes.isEmpty());
    ensureNotNull(causes);
    ensureTrue(!causes.isEmpty(), "causes should nnot be empty");
    ManagedObjectDefinition<?, ?> d = partialManagedObject
        .getManagedObjectDefinition();
@@ -70,7 +70,7 @@
      return ERR_MANAGED_OBJECT_DECODING_EXCEPTION_SINGLE.get(d
          .getUserFriendlyName(), causes.iterator().next().getMessageObject());
    } else {
      MessageBuilder builder = new MessageBuilder();
      LocalizableMessageBuilder builder = new MessageBuilder();
      boolean isFirst = true;
      for (PropertyException cause : causes) {
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectDeleteListener.java
@@ -28,7 +28,7 @@
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
import java.util.List;
@@ -62,7 +62,7 @@
   *         acceptable, or <code>false</code> if it is not.
   */
  public boolean isConfigurationDeleteAcceptable(
      ServerManagedObject<? extends T> mo, List<Message> unacceptableReasons);
      ServerManagedObject<? extends T> mo, List<LocalizableMessage> unacceptableReasons);
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectDeleteListenerAdaptor.java
@@ -30,7 +30,7 @@
import java.util.List;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.admin.Configuration;
import org.opends.server.types.ConfigChangeResult;
@@ -93,7 +93,7 @@
   * {@inheritDoc}
   */
  public boolean isConfigurationDeleteAcceptable(
      ServerManagedObject<? extends T> mo, List<Message> unacceptableReasons) {
      ServerManagedObject<? extends T> mo, List<LocalizableMessage> unacceptableReasons) {
    return listener.isConfigurationDeleteAcceptable(mo.getConfiguration(),
        unacceptableReasons);
  }
opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagementContext.java
@@ -29,7 +29,7 @@
import static org.opends.messages.AdminMessages.*;
import static com.forgerock.opendj.ldap.AdminMessages.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import static org.opends.server.util.StaticUtils.*;
@@ -44,7 +44,7 @@
import java.util.SortedSet;
import java.util.TreeSet;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.admin.AbsoluteInheritedDefaultBehaviorProvider;
import org.opends.server.admin.AbstractManagedObjectDefinition;
import org.opends.server.admin.AggregationPropertyDefinition;
@@ -955,7 +955,7 @@
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message = ERR_ADMIN_CANNOT_GET_MANAGED_OBJECT.get(
      LocalizableMessage message = ERR_ADMIN_CANNOT_GET_MANAGED_OBJECT.get(
          String.valueOf(dn), stackTraceToSingleLineString(e));
      throw new ConfigException(message, e);
    }
@@ -963,7 +963,7 @@
    // The configuration handler is free to return null indicating
    // that the entry does not exist.
    if (configEntry == null) {
      Message message = ERR_ADMIN_MANAGED_OBJECT_DOES_NOT_EXIST
      LocalizableMessage message = ERR_ADMIN_MANAGED_OBJECT_DOES_NOT_EXIST
          .get(String.valueOf(dn));
      throw new ConfigException(message);
    }
opendj-admin/src/main/java/org/opends/server/admin/server/package-info.java
@@ -35,7 +35,5 @@
 * access the server's current configuration and register
 * to be notified when the configuration changes.
 */
@org.opends.server.types.PublicAPI(
     stability=org.opends.server.types.StabilityLevel.PRIVATE)
package org.opends.server.admin.server;
opendj-admin/src/main/java/org/opends/server/api/ConfigAddListener.java
@@ -26,6 +26,7 @@
 */
package org.opends.server.api;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.opends.server.types.ConfigChangeResult;
/**
@@ -47,7 +48,7 @@
     * @return {@code true} if the proposed entry contains an acceptable
     *         configuration, or {@code false} if it does not.
     */
    public boolean configAddIsAcceptable(ConfigEntry configEntry, MessageBuilder unacceptableReason);
    public boolean configAddIsAcceptable(ConfigEntry configEntry, LocalizableMessageBuilder unacceptableReason);
    /**
     * Attempts to apply a new configuration based on the provided added entry.
opendj-admin/src/main/java/org/opends/server/api/ConfigChangeListener.java
@@ -30,7 +30,7 @@
import org.opends.server.config.ConfigEntry;
import org.opends.server.types.ConfigChangeResult;
import org.opends.messages.MessageBuilder;
import org.forgerock.i18n.LocalizableMessageBuilder;
/**
@@ -61,7 +61,7 @@
   *          not.
   */
  public boolean configChangeIsAcceptable(ConfigEntry configEntry,
                      MessageBuilder unacceptableReason);
                      LocalizableMessageBuilder unacceptableReason);
opendj-admin/src/main/java/org/opends/server/api/ConfigDeleteListener.java
@@ -28,9 +28,8 @@
import org.opends.server.config.ConfigEntry;
import org.opends.server.types.ConfigChangeResult;
import org.opends.messages.MessageBuilder;
import org.forgerock.i18n.LocalizableMessageBuilder;
/**
@@ -38,11 +37,6 @@
 * component should implement if it wishes to be able to receive
 * notification if entries below a configuration entry are removed.
 */
@org.opends.server.types.PublicAPI(
     stability=org.opends.server.types.StabilityLevel.VOLATILE,
     mayInstantiate=false,
     mayExtend=true,
     mayInvoke=false)
public interface ConfigDeleteListener
{
  /**
@@ -60,7 +54,7 @@
   *          the configuration, or {@code false} if not.
   */
  public boolean configDeleteIsAcceptable(ConfigEntry configEntry,
                      MessageBuilder unacceptableReason);
                      LocalizableMessageBuilder unacceptableReason);
opendj-admin/src/main/java/org/opends/server/types/DirectoryEnvironmentConfig.java
New file
@@ -0,0 +1,39 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2013 ForgeRock AS.
 */
package org.opends.server.types;
/**
 * This class provides a set of properties that may control various aspects of
 * the server environment. Note that these properties may only be altered before
 * the Directory Server is started. Any attempt to change an environment
 * configuration property while the server is running will be rejected.
 */
public final class DirectoryEnvironmentConfig {
    // TODO : implements
}
opendj-admin/src/main/java/org/opends/server/util/EmbeddedUtils.java
New file
@@ -0,0 +1,105 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.util;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.config.ConfigException;
import org.opends.server.types.DirectoryEnvironmentConfig;
import org.opends.server.types.InitializationException;
/**
 * This class provides a number of utility methods for using OpenDS in an
 * embedded manner (i.e., running within the same JVM as another application and
 * controlled by that application).
 */
public final class EmbeddedUtils {
    /**
     * Indicates whether the Directory Server is currently running.
     *
     * @return {@code true} if the server is currently running, or {@code false}
     *         if not.
     */
    public static boolean isRunning() {
        throw new RuntimeException("not implemented");
    }
    /**
     * Attempts to start the Directory Server.
     *
     * @param config
     *            The environment configuration to use for the server.
     * @throws ConfigException
     *             If a configuration problem is detected during the server
     *             initialization or startup process.
     * @throws InitializationException
     *             If the Directory Server is already running, or if an error
     *             occurs during server initialization or startup.
     */
    public static void startServer(DirectoryEnvironmentConfig config) throws ConfigException, InitializationException {
        throw new RuntimeException("not implemented");
    }
    /**
     * Attempts to stop the Directory Server.
     *
     * @param className
     *            The name of the class that initiated the shutdown.
     * @param reason
     *            A message explaining the reason for the shutdown.
     */
    public static void stopServer(String className, LocalizableMessage reason) {
        throw new RuntimeException("not implemented");
    }
    /**
     * Attempts to restart the Directory Server. This will perform an in-core
     * restart in which the existing server instance will be shut down, a new
     * instance will be created, and it will be reinitialized and restarted.
     *
     * @param className
     *            The name of the class that initiated the restart.
     * @param reason
     *            A message explaining the reason for the retart.
     * @param config
     *            The environment configuration to use for the new server
     *            instance.
     */
    public static void restartServer(String className, LocalizableMessage reason, DirectoryEnvironmentConfig config) {
        throw new RuntimeException("not implemented");
    }
    /**
     * Sets up a number of internal server data structures to ensure that they
     * are properly initialized for use. This is necessary if server libraries
     * are going to be used without the server running (e.g., to facilitate use
     * in an LDAP client API, for DN processing, etc.). This will have no effect
     * if the server has already been initialized for client use.
     */
    public static void initializeForClientUse() {
        throw new RuntimeException("not implemented");
    }
}