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

Nicolas Capponi
26.31.2013 efa949b25f472d7e4c39733678d8f0e5229f8201
Checkpoint commit for OPENDJ-1235 : Migrate configuration framework

* Fix all checkstyle errors.

* Migrate missing package-info.java files for some packages
113 files modified
6 files added
3700 ■■■■ changed files
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ACIPropertyDefinition.java 48 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/AbstractManagedObjectDefinition.java 48 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/AggregationPropertyDefinition.java 108 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/AttributeTypePropertyDefinition.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/BooleanPropertyDefinition.java 65 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ClassLoaderProvider.java 75 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ClassPropertyDefinition.java 26 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/Configuration.java 5 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ConfigurationClient.java patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DNPropertyDefinition.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DefaultBehaviorProvider.java 53 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DefaultBehaviorProviderVisitor.java 21 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DefaultManagedObject.java 73 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DefinedDefaultBehaviorProvider.java 19 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DefinitionDecodingException.java 29 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DefinitionResolver.java 41 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DurationPropertyDefinition.java 26 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DurationUnit.java 115 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/EnumPropertyDefinition.java 17 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/GenericConstraint.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/IPAddressMaskPropertyDefinition.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/IPAddressPropertyDefinition.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/IllegalPropertyValueException.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/IllegalPropertyValueStringException.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/InstantiableRelationDefinition.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/IntegerPropertyDefinition.java 14 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/LDAPProfile.java 15 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectAlreadyExistsException.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectDefinition.java 58 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectDefinitionI18NResource.java 18 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectDefinitionResource.java 55 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectNotFoundException.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectOption.java 14 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectPath.java 54 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectPathSerializer.java 94 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/OptionalRelationDefinition.java 97 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyDefinition.java 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyDefinitionUsageBuilder.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyDefinitionVisitor.java 94 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyIsMandatoryException.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyIsReadOnlyException.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyIsSingleValuedException.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyNotFoundException.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyOption.java 23 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyProvider.java 30 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyValueVisitor.java 104 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/Reference.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/RelationDefinition.java 10 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/RelationDefinitionVisitor.java 41 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/RelationOption.java 15 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/RelativeInheritedDefaultBehaviorProvider.java 83 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/SetRelationDefinition.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/SingletonRelationDefinition.java 100 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/SizePropertyDefinition.java 17 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/SizeUnit.java 125 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/StringPropertyDefinition.java 14 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/Tag.java 33 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/UndefinedDefaultBehaviorProvider.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/UnknownPropertyDefinitionException.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/AdminClientException.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/AuthenticationException.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/AuthenticationNotSupportedException.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ClientConstraintHandler.java 16 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ConcurrentModificationException.java 29 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/IllegalManagedObjectNameException.java 58 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ManagedObject.java 105 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ManagedObjectDecodingException.java 59 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ManagementContext.java 28 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/MissingMandatoryPropertiesException.java 62 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/OperationRejectedException.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ldap/LDAPDriver.java 48 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ldap/LDAPManagedObject.java 14 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ldap/LDAPNameBuilder.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/spi/AbstractManagedObject.java 165 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/spi/Driver.java 50 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/spi/Property.java 82 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/spi/PropertySet.java 123 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/spi/package-info.java 2 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/condition/ContainsCondition.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/doc/ConfigGuideGeneration.java 139 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/package-info.java 2 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ConfigChangeListenerAdaptor.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ConfigurationAddListener.java 27 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/DelayedConfigAddListener.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObject.java 101 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectAddListenerAdaptor.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectChangeListener.java 39 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectChangeListenerAdaptor.java 2 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagementContext.java 57 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/api/package-info.java 44 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/authorization/dseecompat/Aci.java 13 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/authorization/dseecompat/AciException.java 26 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/authorization/dseecompat/package-info.java 31 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/config/package-info.java 45 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/core/DirectoryServer.java 16 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/core/package-info.java 54 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/types/AddressMask.java 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/types/OpenDsException.java 54 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/types/package-info.java 35 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/util/EmbeddedUtils.java 6 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/util/package-info.java 58 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/forgerock/opendj/config/ConfigurationMock.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/AbstractManagedObjectDefinitionTest.java patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/DNPropertyDefinitionTest.java patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/DurationPropertyDefinitionTest.java patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/DurationUnitTest.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/IntegerPropertyDefinitionTest.java patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/MockLDAPProfile.java 35 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/SizeUnitTest.java patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/TestCfg.java 6 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/TestChildCfgDefn.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/ValidateConfigDefinitionsTest.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/client/ldap/LDAPClientTest.java 6 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/client/ldap/MockLDAPConnection.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/server/AdminTestCaseUtils.java 16 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/server/AggregationServerTest.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/server/DNBuilderTest.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/server/DefaultBehaviorTest.java patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/server/ListenerTest.java patch | view | raw | blame | history
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ACIPropertyDefinition.java
@@ -38,19 +38,15 @@
/**
 * ACI property definition.
 */
public class ACIPropertyDefinition extends PropertyDefinition<Aci> {
public final class ACIPropertyDefinition extends PropertyDefinition<Aci> {
  /**
   * An interface for incrementally constructing ACI property
   * definitions.
     * An interface for incrementally constructing ACI property definitions.
   */
  public static class Builder extends
      AbstractBuilder<Aci, ACIPropertyDefinition> {
    public static final class Builder extends AbstractBuilder<Aci, ACIPropertyDefinition> {
    // Private constructor
    private Builder(
        AbstractManagedObjectDefinition<?, ?> d, String propertyName) {
        private Builder(AbstractManagedObjectDefinition<?, ?> d, String propertyName) {
      super(d, propertyName);
    }
@@ -58,50 +54,39 @@
     * {@inheritDoc}
     */
    @Override
    protected ACIPropertyDefinition buildInstance(
        AbstractManagedObjectDefinition<?, ?> d,
        String propertyName, EnumSet<PropertyOption> options,
        AdministratorAction adminAction,
        protected ACIPropertyDefinition buildInstance(AbstractManagedObjectDefinition<?, ?> d, String propertyName,
            EnumSet<PropertyOption> options, AdministratorAction adminAction,
        DefaultBehaviorProvider<Aci> defaultBehavior) {
      return new ACIPropertyDefinition(d, propertyName, options,
          adminAction, defaultBehavior);
            return new ACIPropertyDefinition(d, propertyName, options, adminAction, defaultBehavior);
    }
  }
  /**
   * Create a ACI property definition builder.
   *
   * @param d
   *          The managed object definition associated with this
   *          property definition.
     *            The managed object definition associated with this property
     *            definition.
   * @param propertyName
   *          The property name.
   * @return Returns the new ACI property definition builder.
   */
  public static Builder createBuilder(
      AbstractManagedObjectDefinition<?, ?> d, String propertyName) {
    public static Builder createBuilder(AbstractManagedObjectDefinition<?, ?> d, String propertyName) {
    return new Builder(d, propertyName);
  }
  // Private constructor.
  private ACIPropertyDefinition(
      AbstractManagedObjectDefinition<?, ?> d, String propertyName,
      EnumSet<PropertyOption> options,
      AdministratorAction adminAction,
    private ACIPropertyDefinition(AbstractManagedObjectDefinition<?, ?> d, String propertyName,
        EnumSet<PropertyOption> options, AdministratorAction adminAction,
      DefaultBehaviorProvider<Aci> defaultBehavior) {
    super(d, Aci.class, propertyName, options, adminAction,
        defaultBehavior);
        super(d, Aci.class, propertyName, options, adminAction, defaultBehavior);
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public void validateValue(Aci value)
      throws IllegalPropertyValueException {
    public void validateValue(Aci value) {
    Reject.ifNull(value);
    // No additional validation required.
@@ -111,8 +96,7 @@
   * {@inheritDoc}
   */
  @Override
  public Aci decodeValue(String value)
      throws IllegalPropertyValueStringException {
    public Aci decodeValue(String value) {
    Reject.ifNull(value);
    try {
@@ -123,7 +107,6 @@
    }
  }
  /**
   * {@inheritDoc}
   */
@@ -140,7 +123,6 @@
    return v.visitACI(this, value, p);
  }
  /**
   * {@inheritDoc}
   */
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/AbstractManagedObjectDefinition.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2007-2010 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
import java.util.ArrayList;
@@ -121,7 +120,8 @@
     *            <code>null</code> parent, unless the definition is being used
     *            for testing).
     */
    protected AbstractManagedObjectDefinition(String name, AbstractManagedObjectDefinition<? super C, ? super S> parent) {
    protected AbstractManagedObjectDefinition(String name,
        AbstractManagedObjectDefinition<? super C, ? super S> parent) {
        this.name = name;
        this.parent = parent;
        this.constraints = new LinkedList<Constraint>();
@@ -168,8 +168,8 @@
     *         definition.
     */
    public final Collection<AbstractManagedObjectDefinition<? extends C, ? extends S>> getAllChildren() {
        List<AbstractManagedObjectDefinition<? extends C, ? extends S>> list = new ArrayList<AbstractManagedObjectDefinition<? extends C, ? extends S>>(
                children.values());
        List<AbstractManagedObjectDefinition<? extends C, ? extends S>> list =
            new ArrayList<AbstractManagedObjectDefinition<? extends C, ? extends S>>(children.values());
        for (AbstractManagedObjectDefinition<? extends C, ? extends S> child : children.values()) {
            list.addAll(child.getAllChildren());
@@ -237,7 +237,8 @@
        // This method does not used a cached set of relations because
        // relations may be updated after child definitions have been
        // defined.
        List<RelationDefinition<? super C, ? super S>> rdlist = new LinkedList<RelationDefinition<? super C, ? super S>>();
        List<RelationDefinition<? super C, ? super S>> rdlist =
            new LinkedList<RelationDefinition<? super C, ? super S>>();
        if (parent != null) {
            rdlist.addAll(parent.getAllReverseRelationDefinitions());
@@ -310,8 +311,7 @@
     *             empty or if the requested subordinate managed object
     *             definition was not found.
     */
    public final AbstractManagedObjectDefinition<? extends C, ? extends S> getChild(String name)
            throws IllegalArgumentException {
    public final AbstractManagedObjectDefinition<? extends C, ? extends S> getChild(String name) {
        if ((name == null) || (name.length() == 0)) {
            throw new IllegalArgumentException("null or empty managed object name");
        }
@@ -369,7 +369,7 @@
     * @throws UnsupportedOperationException
     *             If this managed object definition is the {@link TopCfgDefn}.
     */
    public final LocalizableMessage getDescription() throws UnsupportedOperationException {
    public final LocalizableMessage getDescription() {
        return getDescription(Locale.getDefault());
    }
@@ -385,7 +385,7 @@
     * @throws UnsupportedOperationException
     *             If this managed object definition is the {@link TopCfgDefn}.
     */
    public final LocalizableMessage getDescription(Locale locale) throws UnsupportedOperationException {
    public final LocalizableMessage getDescription(Locale locale) {
        try {
            return ManagedObjectDefinitionI18NResource.getInstance().getMessage(this, "description", locale);
        } catch (MissingResourceException e) {
@@ -425,7 +425,7 @@
     *             If the specified property name was null or empty or if the
     *             requested property definition was not found.
     */
    public final PropertyDefinition<?> getPropertyDefinition(String name) throws IllegalArgumentException {
    public final PropertyDefinition<?> getPropertyDefinition(String name) {
        if ((name == null) || (name.length() == 0)) {
            throw new IllegalArgumentException("null or empty property name");
        }
@@ -462,7 +462,7 @@
     *             If the specified relation name was null or empty or if the
     *             requested relation definition was not found.
     */
    public final RelationDefinition<?, ?> getRelationDefinition(String name) throws IllegalArgumentException {
    public final RelationDefinition<?, ?> getRelationDefinition(String name) {
        if ((name == null) || (name.length() == 0)) {
            throw new IllegalArgumentException("null or empty relation name");
        }
@@ -514,8 +514,7 @@
     *             or if the requested aggregation property definition was not
     *             found.
     */
    public final AggregationPropertyDefinition<?, ?> getAggregationPropertyDefinition(String name)
            throws IllegalArgumentException {
    public final AggregationPropertyDefinition<?, ?> getAggregationPropertyDefinition(String name) {
        if ((name == null) || (name.length() == 0)) {
            throw new IllegalArgumentException("null or empty aggregation property name");
        }
@@ -563,7 +562,7 @@
     * @throws UnsupportedOperationException
     *             If this managed object definition is the {@link TopCfgDefn}.
     */
    public final LocalizableMessage getSynopsis() throws UnsupportedOperationException {
    public final LocalizableMessage getSynopsis() {
        return getSynopsis(Locale.getDefault());
    }
@@ -578,7 +577,7 @@
     * @throws UnsupportedOperationException
     *             If this managed object definition is the {@link TopCfgDefn}.
     */
    public final LocalizableMessage getSynopsis(Locale locale) throws UnsupportedOperationException {
    public final LocalizableMessage getSynopsis(Locale locale) {
        return ManagedObjectDefinitionI18NResource.getInstance().getMessage(this, "synopsis", locale);
    }
@@ -591,7 +590,7 @@
     * @throws UnsupportedOperationException
     *             If this managed object definition is the {@link TopCfgDefn}.
     */
    public final LocalizableMessage getUserFriendlyName() throws UnsupportedOperationException {
    public final LocalizableMessage getUserFriendlyName() {
        return getUserFriendlyName(Locale.getDefault());
    }
@@ -606,7 +605,7 @@
     * @throws UnsupportedOperationException
     *             If this managed object definition is the {@link TopCfgDefn}.
     */
    public final LocalizableMessage getUserFriendlyName(Locale locale) throws UnsupportedOperationException {
    public final LocalizableMessage getUserFriendlyName(Locale locale) {
        return LocalizableMessage.raw(ManagedObjectDefinitionI18NResource.getInstance().getMessage(this,
                "user-friendly-name", locale));
    }
@@ -620,7 +619,7 @@
     * @throws UnsupportedOperationException
     *             If this managed object definition is the {@link TopCfgDefn}.
     */
    public final LocalizableMessage getUserFriendlyPluralName() throws UnsupportedOperationException {
    public final LocalizableMessage getUserFriendlyPluralName() {
        return getUserFriendlyPluralName(Locale.getDefault());
    }
@@ -635,9 +634,9 @@
     * @throws UnsupportedOperationException
     *             If this managed object definition is the {@link TopCfgDefn}.
     */
    public final LocalizableMessage getUserFriendlyPluralName(Locale locale) throws UnsupportedOperationException {
        return ManagedObjectDefinitionI18NResource.getInstance().getMessage(this,
                "user-friendly-plural-name", locale);
    public final LocalizableMessage getUserFriendlyPluralName(Locale locale) {
        return ManagedObjectDefinitionI18NResource.getInstance()
            .getMessage(this, "user-friendly-plural-name", locale);
    }
    /**
@@ -941,8 +940,8 @@
    // Register a relation definition in the referenced managed object
    // definition's reverse lookup table.
    private <CC extends ConfigurationClient, SS extends Configuration> void registerReverseRelationDefinition(
            RelationDefinition<CC, SS> rd) {
    private <C1 extends ConfigurationClient, S1 extends Configuration> void registerReverseRelationDefinition(
        RelationDefinition<C1, S1> rd) {
        rd.getChildDefinition().reverseRelationDefinitions.add(rd);
    }
@@ -963,7 +962,8 @@
        }
        for (AbstractManagedObjectDefinition<? extends C, ? extends S> child : d.getChildren()) {
            AbstractManagedObjectDefinition<? extends C, ? extends S> rd = resolveManagedObjectDefinitionAux(child, r);
            AbstractManagedObjectDefinition<? extends C, ? extends S> rd =
                resolveManagedObjectDefinitionAux(child, r);
            if (rd != null) {
                return rd;
            }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/AggregationPropertyDefinition.java
@@ -112,7 +112,7 @@
     *            The type of server managed object configuration that this
     *            aggregation property definition refers to.
     */
    public static class Builder<C extends ConfigurationClient, S extends Configuration> extends
    public static final class Builder<C extends ConfigurationClient, S extends Configuration> extends
            AbstractBuilder<String, AggregationPropertyDefinition<C, S>> {
        // The string representation of the managed object path specifying
@@ -216,7 +216,7 @@
    /**
     * A change listener which prevents the named component from being disabled.
     */
    private class ReferentialIntegrityChangeListener implements ServerManagedObjectChangeListener<S> {
    private final class ReferentialIntegrityChangeListener implements ServerManagedObjectChangeListener<S> {
        // The error message which should be returned if an attempt is
        // made to disable the referenced component.
@@ -267,11 +267,11 @@
            } catch (ConfigException e) {
                // The condition could not be evaluated.
                debugLogger.trace("Unable to perform post add", e);
                LocalizableMessage message = ERR_REFINT_UNABLE_TO_EVALUATE_TARGET_CONDITION.get(mo
                        .getManagedObjectDefinition().getUserFriendlyName(), String.valueOf(mo.getDN()),
                        getExceptionMessage(e));
                LocalizedLogger logger = LocalizedLogger
                        .getLocalizedLogger(ERR_REFINT_UNABLE_TO_EVALUATE_TARGET_CONDITION.resourceName());
                LocalizableMessage message =
                    ERR_REFINT_UNABLE_TO_EVALUATE_TARGET_CONDITION.get(mo.getManagedObjectDefinition()
                        .getUserFriendlyName(), String.valueOf(mo.getDN()), getExceptionMessage(e));
                LocalizedLogger logger =
                    LocalizedLogger.getLocalizedLogger(ERR_REFINT_UNABLE_TO_EVALUATE_TARGET_CONDITION.resourceName());
                logger.error(message);
                unacceptableReasons.add(message);
                return false;
@@ -288,7 +288,7 @@
    /**
     * A delete listener which prevents the named component from being deleted.
     */
    private class ReferentialIntegrityDeleteListener implements ConfigurationDeleteListener<S> {
    private final class ReferentialIntegrityDeleteListener implements ConfigurationDeleteListener<S> {
        // The DN of the referenced configuration entry.
        private final DN dn;
@@ -345,8 +345,8 @@
         * {@inheritDoc}
         */
        @Override
        public boolean isUsable(ServerManagedObject<?> managedObject, Collection<LocalizableMessage> unacceptableReasons)
                throws ConfigException {
        public boolean isUsable(ServerManagedObject<?> managedObject,
            Collection<LocalizableMessage> unacceptableReasons) throws ConfigException {
            SortedSet<String> names = managedObject.getPropertyValues(AggregationPropertyDefinition.this);
            ServerManagementContext context = managedObject.getServerContext();
            LocalizableMessage thisUFN = managedObject.getManagedObjectDefinition().getUserFriendlyName();
@@ -360,8 +360,8 @@
                String thatDN = path.toDN().toString();
                if (!context.managedObjectExists(path)) {
                    LocalizableMessage msg = ERR_SERVER_REFINT_DANGLING_REFERENCE.get(name, getName(), thisUFN, thisDN, thatUFN,
                            thatDN);
                    LocalizableMessage msg =
                        ERR_SERVER_REFINT_DANGLING_REFERENCE.get(name, getName(), thisUFN, thisDN, thatUFN, thatDN);
                    unacceptableReasons.add(msg);
                    isUsable = false;
                } else if (needsEnabling) {
@@ -369,8 +369,8 @@
                    // required.
                    ServerManagedObject<? extends S> ref = context.getManagedObject(path);
                    if (!targetIsEnabledCondition.evaluate(ref)) {
                        LocalizableMessage msg = ERR_SERVER_REFINT_TARGET_DISABLED.get(name, getName(), thisUFN, thisDN, thatUFN,
                                thatDN);
                        LocalizableMessage msg =
                            ERR_SERVER_REFINT_TARGET_DISABLED.get(name, getName(), thisUFN, thisDN, thatUFN, thatDN);
                        unacceptableReasons.add(msg);
                        isUsable = false;
                    }
@@ -421,7 +421,8 @@
                String thatDN = dn.toString();
                // Register the delete listener.
                LocalizableMessage msg = ERR_SERVER_REFINT_CANNOT_DELETE.get(thatUFN, thatDN, getName(), thisUFN, thisDN);
                LocalizableMessage msg =
                    ERR_SERVER_REFINT_CANNOT_DELETE.get(thatUFN, thatDN, getName(), thisUFN, thisDN);
                ReferentialIntegrityDeleteListener dl = new ReferentialIntegrityDeleteListener(dn, msg);
                parent.registerDeleteListener(getRelationDefinition(), dl);
                dlist.add(dl);
@@ -510,14 +511,14 @@
                try {
                    ref = context.getManagedObject(path);
                } catch (DefinitionDecodingException e) {
                    LocalizableMessage msg = ERR_CLIENT_REFINT_TARGET_INVALID.get(ufn, name, getName(),
                            e.getMessageObject());
                    LocalizableMessage msg =
                        ERR_CLIENT_REFINT_TARGET_INVALID.get(ufn, name, getName(), e.getMessageObject());
                    unacceptableReasons.add(msg);
                    isAcceptable = false;
                    continue;
                } catch (ManagedObjectDecodingException e) {
                    LocalizableMessage msg = ERR_CLIENT_REFINT_TARGET_INVALID.get(ufn, name, getName(),
                            e.getMessageObject());
                    LocalizableMessage msg =
                        ERR_CLIENT_REFINT_TARGET_INVALID.get(ufn, name, getName(), e.getMessageObject());
                    unacceptableReasons.add(msg);
                    isAcceptable = false;
                    continue;
@@ -571,14 +572,14 @@
            for (ManagedObject<?> mo : findReferences(context, getManagedObjectDefinition(), path.getName())) {
                String name = mo.getManagedObjectPath().getName();
                if (name == null) {
                    LocalizableMessage msg = ERR_CLIENT_REFINT_CANNOT_DELETE_WITHOUT_NAME.get(getName(), mo
                            .getManagedObjectDefinition().getUserFriendlyName(), getManagedObjectDefinition()
                            .getUserFriendlyName());
                    LocalizableMessage msg =
                        ERR_CLIENT_REFINT_CANNOT_DELETE_WITHOUT_NAME.get(getName(), mo.getManagedObjectDefinition()
                            .getUserFriendlyName(), getManagedObjectDefinition().getUserFriendlyName());
                    unacceptableReasons.add(msg);
                } else {
                    LocalizableMessage msg = ERR_CLIENT_REFINT_CANNOT_DELETE_WITH_NAME.get(getName(), mo
                            .getManagedObjectDefinition().getUserFriendlyName(), name, getManagedObjectDefinition()
                            .getUserFriendlyName());
                    LocalizableMessage msg =
                        ERR_CLIENT_REFINT_CANNOT_DELETE_WITH_NAME.get(getName(), mo.getManagedObjectDefinition()
                            .getUserFriendlyName(), name, getManagedObjectDefinition().getUserFriendlyName());
                    unacceptableReasons.add(msg);
                }
                isAcceptable = false;
@@ -606,14 +607,16 @@
                if (targetNeedsEnablingCondition.evaluate(context, mo)) {
                    String name = mo.getManagedObjectPath().getName();
                    if (name == null) {
                        LocalizableMessage msg = ERR_CLIENT_REFINT_CANNOT_DISABLE_WITHOUT_NAME.get(managedObject
                        LocalizableMessage msg =
                            ERR_CLIENT_REFINT_CANNOT_DISABLE_WITHOUT_NAME.get(managedObject
                                .getManagedObjectDefinition().getUserFriendlyName(), getName(), mo
                                .getManagedObjectDefinition().getUserFriendlyName());
                        unacceptableReasons.add(msg);
                    } else {
                        LocalizableMessage msg = ERR_CLIENT_REFINT_CANNOT_DISABLE_WITH_NAME.get(managedObject
                                .getManagedObjectDefinition().getUserFriendlyName(), getName(), mo
                                .getManagedObjectDefinition().getUserFriendlyName(), name);
                        LocalizableMessage msg =
                            ERR_CLIENT_REFINT_CANNOT_DISABLE_WITH_NAME.get(
                                managedObject.getManagedObjectDefinition().getUserFriendlyName(), getName(),
                                mo.getManagedObjectDefinition().getUserFriendlyName(), name);
                        unacceptableReasons.add(msg);
                    }
                    isAcceptable = false;
@@ -624,14 +627,14 @@
        // Find all managed objects which reference the named managed
        // object using this property.
        private <CC extends ConfigurationClient> List<ManagedObject<? extends CC>> findReferences(
                ManagementContext context, AbstractManagedObjectDefinition<CC, ?> mod, String name)
        private <C1 extends ConfigurationClient> List<ManagedObject<? extends C1>> findReferences(
            ManagementContext context, AbstractManagedObjectDefinition<C1, ?> mod, String name)
                throws ErrorResultException {
            List<ManagedObject<? extends CC>> instances = findInstances(context, mod);
            List<ManagedObject<? extends C1>> instances = findInstances(context, mod);
            Iterator<ManagedObject<? extends CC>> i = instances.iterator();
            Iterator<ManagedObject<? extends C1>> i = instances.iterator();
            while (i.hasNext()) {
                ManagedObject<? extends CC> mo = i.next();
                ManagedObject<? extends C1> mo = i.next();
                boolean hasReference = false;
                for (String value : mo.getPropertyValues(AggregationPropertyDefinition.this)) {
@@ -651,35 +654,38 @@
        // Find all instances of a specific type of managed object.
        @SuppressWarnings("unchecked")
        private <CC extends ConfigurationClient> List<ManagedObject<? extends CC>> findInstances(
                ManagementContext context, AbstractManagedObjectDefinition<CC, ?> mod) throws ErrorResultException {
            List<ManagedObject<? extends CC>> instances = new LinkedList<ManagedObject<? extends CC>>();
        private <C1 extends ConfigurationClient> List<ManagedObject<? extends C1>> findInstances(
            ManagementContext context, AbstractManagedObjectDefinition<C1, ?> mod) throws ErrorResultException {
            List<ManagedObject<? extends C1>> instances = new LinkedList<ManagedObject<? extends C1>>();
            if (mod == RootCfgDefn.getInstance()) {
                instances.add((ManagedObject<? extends CC>) context.getRootConfigurationManagedObject());
                instances.add((ManagedObject<? extends C1>) context.getRootConfigurationManagedObject());
            } else {
                for (RelationDefinition<? super CC, ?> rd : mod.getAllReverseRelationDefinitions()) {
                for (RelationDefinition<? super C1, ?> rd : mod.getAllReverseRelationDefinitions()) {
                    for (ManagedObject<?> parent : findInstances(context, rd.getParentDefinition())) {
                        try {
                            if (rd instanceof SingletonRelationDefinition) {
                                SingletonRelationDefinition<? super CC, ?> srd = (SingletonRelationDefinition<? super CC, ?>) rd;
                                SingletonRelationDefinition<? super C1, ?> srd =
                                    (SingletonRelationDefinition<? super C1, ?>) rd;
                                ManagedObject<?> mo = parent.getChild(srd);
                                if (mo.getManagedObjectDefinition().isChildOf(mod)) {
                                    instances.add((ManagedObject<? extends CC>) mo);
                                    instances.add((ManagedObject<? extends C1>) mo);
                                }
                            } else if (rd instanceof OptionalRelationDefinition) {
                                OptionalRelationDefinition<? super CC, ?> ord = (OptionalRelationDefinition<? super CC, ?>) rd;
                                OptionalRelationDefinition<? super C1, ?> ord =
                                    (OptionalRelationDefinition<? super C1, ?>) rd;
                                ManagedObject<?> mo = parent.getChild(ord);
                                if (mo.getManagedObjectDefinition().isChildOf(mod)) {
                                    instances.add((ManagedObject<? extends CC>) mo);
                                    instances.add((ManagedObject<? extends C1>) mo);
                                }
                            } else if (rd instanceof InstantiableRelationDefinition) {
                                InstantiableRelationDefinition<? super CC, ?> ird = (InstantiableRelationDefinition<? super CC, ?>) rd;
                                InstantiableRelationDefinition<? super C1, ?> ird =
                                    (InstantiableRelationDefinition<? super C1, ?>) rd;
                                for (String name : parent.listChildren(ird)) {
                                    ManagedObject<?> mo = parent.getChild(ird, name);
                                    if (mo.getManagedObjectDefinition().isChildOf(mod)) {
                                        instances.add((ManagedObject<? extends CC>) mo);
                                        instances.add((ManagedObject<? extends C1>) mo);
                                    }
                                }
                            }
@@ -719,11 +725,13 @@
    // The active server-side referential integrity change listeners
    // associated with this property.
    private final Map<DN, List<ReferentialIntegrityChangeListener>> changeListeners = new HashMap<DN, List<ReferentialIntegrityChangeListener>>();
    private final Map<DN, List<ReferentialIntegrityChangeListener>> changeListeners =
        new HashMap<DN, List<ReferentialIntegrityChangeListener>>();
    // The active server-side referential integrity delete listeners
    // associated with this property.
    private final Map<DN, List<ReferentialIntegrityDeleteListener>> deleteListeners = new HashMap<DN, List<ReferentialIntegrityDeleteListener>>();
    private final Map<DN, List<ReferentialIntegrityDeleteListener>> deleteListeners =
        new HashMap<DN, List<ReferentialIntegrityDeleteListener>>();
    // The name of the managed object which is the parent of the
    // aggregated managed objects.
@@ -803,7 +811,7 @@
     * {@inheritDoc}
     */
    @Override
    public String decodeValue(String value) throws IllegalPropertyValueStringException {
    public String decodeValue(String value) {
        Reject.ifNull(value);
        try {
@@ -938,7 +946,7 @@
     * {@inheritDoc}
     */
    @Override
    public String normalizeValue(String value) throws IllegalPropertyValueException {
    public String normalizeValue(String value) {
        try {
            Reference<C, S> reference = Reference.parseName(parentPath, relationDefinition, value);
            return reference.getNormalizedName();
@@ -971,7 +979,7 @@
     * {@inheritDoc}
     */
    @Override
    public void validateValue(String value) throws IllegalPropertyValueException {
    public void validateValue(String value) {
        try {
            Reference.parseName(parentPath, relationDefinition, value);
        } catch (IllegalArgumentException e) {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/AttributeTypePropertyDefinition.java
@@ -42,7 +42,7 @@
     * An interface for incrementally constructing attribute type property
     * definitions.
     */
    public static class Builder extends AbstractBuilder<AttributeType, AttributeTypePropertyDefinition> {
    public static final class Builder extends AbstractBuilder<AttributeType, AttributeTypePropertyDefinition> {
        // Private constructor
        private Builder(AbstractManagedObjectDefinition<?, ?> d, String propertyName) {
@@ -138,7 +138,7 @@
     * {@inheritDoc}
     */
    @Override
    public AttributeType decodeValue(String value) throws IllegalPropertyValueStringException {
    public AttributeType decodeValue(String value) {
        Reject.ifNull(value);
        String name = value.trim().toLowerCase();
@@ -160,7 +160,7 @@
     * {@inheritDoc}
     */
    @Override
    public String encodeValue(AttributeType value) throws IllegalPropertyValueException {
    public String encodeValue(AttributeType value) {
        return value.getNameOrOID();
    }
@@ -168,7 +168,7 @@
     * {@inheritDoc}
     */
    @Override
    public void validateValue(AttributeType value) throws IllegalPropertyValueException {
    public void validateValue(AttributeType value) {
        Reject.ifNull(value);
        // No implementation required.
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/BooleanPropertyDefinition.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
import org.forgerock.util.Reject;
@@ -35,13 +34,12 @@
/**
 * Boolean property definition.
 */
public final class BooleanPropertyDefinition extends
    PropertyDefinition<Boolean> {
public final class BooleanPropertyDefinition extends PropertyDefinition<Boolean> {
  /**
   * Mapping used for parsing boolean values. This mapping is more flexible than
   * the standard boolean string parser and supports common true/false synonyms
   * used in configuration.
     * Mapping used for parsing boolean values. This mapping is more flexible
     * than the standard boolean string parser and supports common true/false
     * synonyms used in configuration.
   */
  private static final Map<String, Boolean> VALUE_MAP;
  static {
@@ -52,87 +50,64 @@
    VALUE_MAP.put("true", Boolean.TRUE);
  }
  /**
   * An interface for incrementally constructing boolean property definitions.
   */
  public static class Builder extends
      AbstractBuilder<Boolean, BooleanPropertyDefinition> {
    public static final class Builder extends AbstractBuilder<Boolean, BooleanPropertyDefinition> {
    // Private constructor
    private Builder(
        AbstractManagedObjectDefinition<?, ?> d, String propertyName) {
        private Builder(AbstractManagedObjectDefinition<?, ?> d, String propertyName) {
      super(d, propertyName);
    }
    /**
     * {@inheritDoc}
     */
    @Override
    protected BooleanPropertyDefinition buildInstance(
        AbstractManagedObjectDefinition<?, ?> d, String propertyName,
        EnumSet<PropertyOption> options,
        AdministratorAction adminAction,
        protected BooleanPropertyDefinition buildInstance(AbstractManagedObjectDefinition<?, ?> d,
            String propertyName, EnumSet<PropertyOption> options, AdministratorAction adminAction,
        DefaultBehaviorProvider<Boolean> defaultBehavior) {
      return new BooleanPropertyDefinition(d, propertyName, options,
          adminAction, defaultBehavior);
            return new BooleanPropertyDefinition(d, propertyName, options, adminAction, defaultBehavior);
    }
  }
  /**
   * Create a boolean property definition builder.
   *
   * @param d
   *          The managed object definition associated with this
   *          property definition.
     *            The managed object definition associated with this property
     *            definition.
   * @param propertyName
   *          The property name.
   * @return Returns the new boolean property definition builder.
   */
  public static Builder createBuilder(
      AbstractManagedObjectDefinition<?, ?> d, String propertyName) {
    public static Builder createBuilder(AbstractManagedObjectDefinition<?, ?> d, String propertyName) {
    return new Builder(d, propertyName);
  }
  // Private constructor.
  private BooleanPropertyDefinition(
      AbstractManagedObjectDefinition<?, ?> d, String propertyName,
      EnumSet<PropertyOption> options,
      AdministratorAction adminAction,
    private BooleanPropertyDefinition(AbstractManagedObjectDefinition<?, ?> d, String propertyName,
        EnumSet<PropertyOption> options, AdministratorAction adminAction,
      DefaultBehaviorProvider<Boolean> defaultBehavior) {
    super(d, Boolean.class, propertyName, options, adminAction,
        defaultBehavior);
        super(d, Boolean.class, propertyName, options, adminAction, defaultBehavior);
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public void validateValue(Boolean value)
      throws IllegalPropertyValueException {
    public void validateValue(Boolean value) {
    Reject.ifNull(value);
    // No additional validation required.
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public Boolean decodeValue(String value)
      throws IllegalPropertyValueStringException {
    public Boolean decodeValue(String value) {
    Reject.ifNull(value);
    String nvalue = value.trim().toLowerCase();
@@ -145,8 +120,6 @@
    }
  }
  /**
   * {@inheritDoc}
   */
@@ -155,8 +128,6 @@
    return v.visitBoolean(this, p);
  }
  /**
   * {@inheritDoc}
   */
@@ -165,8 +136,6 @@
    return v.visitBoolean(this, value, p);
  }
  /**
   * {@inheritDoc}
   */
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ClassLoaderProvider.java
@@ -80,7 +80,8 @@
 */
public final class ClassLoaderProvider {
    private static final LocalizedLogger adminLogger = LocalizedLogger.getLocalizedLogger(AdminMessages.resourceName());
    private static final LocalizedLogger adminLogger = LocalizedLogger.getLocalizedLogger(AdminMessages
        .resourceName());
    private static final Logger debugLogger = LoggerFactory.getLogger(ClassLoaderProvider.class);
    /**
@@ -117,7 +118,7 @@
         * @throws SecurityException
         *             If a required system property value cannot be accessed.
         */
        public void addJarFile(File jarFile) throws SecurityException, MalformedURLException {
        public void addJarFile(File jarFile) throws MalformedURLException {
            addURL(jarFile.toURI().toURL());
        }
@@ -145,8 +146,8 @@
    // The attribute names for build information is name, version and revision
    // number
    private static final String[] BUILD_INFORMATION_ATTRIBUTE_NAMES = new String[] {
            Attributes.Name.EXTENSION_NAME.toString(), Attributes.Name.IMPLEMENTATION_VERSION.toString(),
    private static final String[] BUILD_INFORMATION_ATTRIBUTE_NAMES =
        new String[] { Attributes.Name.EXTENSION_NAME.toString(), Attributes.Name.IMPLEMENTATION_VERSION.toString(),
            REVISION_NUMBER };
    /**
@@ -192,8 +193,7 @@
     *             If one of the extension names was not a single relative path
     *             name element or was an absolute path.
     */
    public synchronized void addExtension(String... extensions) throws InitializationException, IllegalStateException,
            IllegalArgumentException {
    public synchronized void addExtension(String... extensions) throws InitializationException {
        Reject.ifNull(extensions);
        if (loader == null) {
@@ -230,7 +230,7 @@
     * @throws IllegalStateException
     *             If this class loader provider is already disabled.
     */
    public synchronized void disable() throws IllegalStateException {
    public synchronized void disable() {
        if (loader == null) {
            throw new IllegalStateException("Class loader provider already disabled.");
        }
@@ -248,7 +248,7 @@
     * @throws IllegalStateException
     *             If this class loader provider is already enabled.
     */
    public synchronized void enable() throws InitializationException, IllegalStateException {
    public synchronized void enable() throws InitializationException {
        enable(RootCfgDefn.class.getClassLoader());
    }
@@ -263,7 +263,7 @@
     * @throws IllegalStateException
     *             If this class loader provider is already enabled.
     */
    public synchronized void enable(ClassLoader parent) throws InitializationException, IllegalStateException {
    public synchronized void enable(ClassLoader parent) throws InitializationException {
        if (loader != null) {
            throw new IllegalStateException("Class loader provider already enabled.");
        }
@@ -361,8 +361,9 @@
                loader.addJarFile(extension);
            } catch (Exception e) {
                debugLogger.trace("Unable to register the jar file with the class loader", e);
                LocalizableMessage message = ERR_ADMIN_CANNOT_OPEN_JAR_FILE.get(extension.getName(),
                        extension.getParent(), stackTraceToSingleLineString(e, DynamicConstants.DEBUG_BUILD));
                LocalizableMessage message =
                    ERR_ADMIN_CANNOT_OPEN_JAR_FILE.get(extension.getName(), extension.getParent(),
                        stackTraceToSingleLineString(e, DynamicConstants.DEBUG_BUILD));
                throw new InitializationException(message);
            }
            jarFiles.add(extension);
@@ -381,8 +382,9 @@
     *         <code>null</code> if there is no information available.
     */
    public String printExtensionInformation() {
        File extensionsPath = new File(new StringBuilder(DirectoryServer.getServerRoot()).append(File.separator)
                .append(LIB_DIR).append(File.separator).append(EXTENSIONS_DIR).toString());
        File extensionsPath =
            new File(new StringBuilder(DirectoryServer.getServerRoot()).append(File.separator).append(LIB_DIR)
                .append(File.separator).append(EXTENSIONS_DIR).toString());
        if (!extensionsPath.exists() || !extensionsPath.isDirectory()) {
            // no extensions' directory
@@ -500,7 +502,8 @@
            if (!extensionsPath.isDirectory()) {
                // The extensions directory is not a directory. This is more
                // critical.
                LocalizableMessage message = ERR_ADMIN_EXTENSIONS_DIR_NOT_DIRECTORY.get(String.valueOf(extensionsPath));
                LocalizableMessage message =
                    ERR_ADMIN_EXTENSIONS_DIR_NOT_DIRECTORY.get(String.valueOf(extensionsPath));
                throw new InitializationException(message);
            }
@@ -528,7 +531,8 @@
            throw e;
        } catch (Exception e) {
            debugLogger.trace("Unable to initialize all extensions", e);
            LocalizableMessage message = ERR_ADMIN_EXTENSIONS_CANNOT_LIST_FILES.get(String.valueOf(extensionsPath),
            LocalizableMessage message =
                ERR_ADMIN_EXTENSIONS_CANNOT_LIST_FILES.get(String.valueOf(extensionsPath),
                    stackTraceToSingleLineString(e, DynamicConstants.DEBUG_BUILD));
            throw new InitializationException(message, e);
        }
@@ -553,7 +557,8 @@
            loadDefinitionClasses(is);
        } catch (InitializationException e) {
            debugLogger.trace("Unable to initialize core components", e);
            LocalizableMessage message = ERR_CLASS_LOADER_CANNOT_LOAD_CORE.get(CORE_MANIFEST,
            LocalizableMessage message =
                ERR_CLASS_LOADER_CANNOT_LOAD_CORE.get(CORE_MANIFEST,
                    stackTraceToSingleLineString(e, DynamicConstants.DEBUG_BUILD));
            throw new InitializationException(message);
        }
@@ -578,8 +583,9 @@
                is = jarFile.getInputStream(entry);
            } catch (Exception e) {
                debugLogger.trace("Unable to get input stream from jar", e);
                LocalizableMessage message = ERR_ADMIN_CANNOT_READ_EXTENSION_MANIFEST.get(EXTENSION_MANIFEST,
                        jarFile.getName(), stackTraceToSingleLineString(e, DynamicConstants.DEBUG_BUILD));
                LocalizableMessage message =
                    ERR_ADMIN_CANNOT_READ_EXTENSION_MANIFEST.get(EXTENSION_MANIFEST, jarFile.getName(),
                        stackTraceToSingleLineString(e, DynamicConstants.DEBUG_BUILD));
                throw new InitializationException(message);
            }
@@ -587,15 +593,16 @@
                loadDefinitionClasses(is);
            } catch (InitializationException e) {
                debugLogger.trace("Unable to load classes from input stream", e);
                LocalizableMessage message = ERR_CLASS_LOADER_CANNOT_LOAD_EXTENSION.get(jarFile.getName(),
                        EXTENSION_MANIFEST, stackTraceToSingleLineString(e, DynamicConstants.DEBUG_BUILD));
                LocalizableMessage message =
                    ERR_CLASS_LOADER_CANNOT_LOAD_EXTENSION.get(jarFile.getName(), EXTENSION_MANIFEST,
                        stackTraceToSingleLineString(e, DynamicConstants.DEBUG_BUILD));
                throw new InitializationException(message);
            }
            try {
                // Log build information of extensions in the error log
                String[] information = getBuildInformation(jarFile);
                LocalizableMessage message = NOTE_LOG_EXTENSION_INFORMATION.get(jarFile.getName(), information[1],
                        information[2]);
                LocalizableMessage message =
                    NOTE_LOG_EXTENSION_INFORMATION.get(jarFile.getName(), information[1], information[2]);
                LocalizedLogger.getLocalizedLogger(message.resourceName()).error(message);
            } catch (Exception e) {
                // Do not log information for that extension
@@ -615,13 +622,15 @@
     */
    private void loadDefinitionClasses(InputStream is) throws InitializationException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(is));
        List<AbstractManagedObjectDefinition<?, ?>> definitions = new LinkedList<AbstractManagedObjectDefinition<?, ?>>();
        List<AbstractManagedObjectDefinition<?, ?>> definitions =
            new LinkedList<AbstractManagedObjectDefinition<?, ?>>();
        while (true) {
            String className;
            try {
                className = reader.readLine();
            } catch (IOException e) {
                LocalizableMessage msg = ERR_CLASS_LOADER_CANNOT_READ_MANIFEST_FILE.get(String.valueOf(e.getMessage()));
                LocalizableMessage msg =
                    ERR_CLASS_LOADER_CANNOT_READ_MANIFEST_FILE.get(String.valueOf(e.getMessage()));
                throw new InitializationException(msg, e);
            }
@@ -648,8 +657,8 @@
            try {
                theClass = Class.forName(className, true, loader);
            } catch (Exception e) {
                LocalizableMessage msg = ERR_CLASS_LOADER_CANNOT_LOAD_CLASS.get(className,
                        String.valueOf(e.getMessage()));
                LocalizableMessage msg =
                    ERR_CLASS_LOADER_CANNOT_LOAD_CLASS.get(className, String.valueOf(e.getMessage()));
                throw new InitializationException(msg, e);
            }
            if (AbstractManagedObjectDefinition.class.isAssignableFrom(theClass)) {
@@ -659,7 +668,8 @@
                try {
                    method = theClass.getMethod("getInstance");
                } catch (Exception e) {
                    LocalizableMessage msg = ERR_CLASS_LOADER_CANNOT_FIND_GET_INSTANCE_METHOD.get(className,
                    LocalizableMessage msg =
                        ERR_CLASS_LOADER_CANNOT_FIND_GET_INSTANCE_METHOD.get(className,
                            String.valueOf(e.getMessage()));
                    throw new InitializationException(msg, e);
                }
@@ -669,7 +679,8 @@
                try {
                    d = (AbstractManagedObjectDefinition<?, ?>) method.invoke(null);
                } catch (Exception e) {
                    LocalizableMessage msg = ERR_CLASS_LOADER_CANNOT_INVOKE_GET_INSTANCE_METHOD.get(className,
                    LocalizableMessage msg =
                        ERR_CLASS_LOADER_CANNOT_INVOKE_GET_INSTANCE_METHOD.get(className,
                            String.valueOf(e.getMessage()));
                    throw new InitializationException(msg, e);
                }
@@ -682,8 +693,9 @@
            try {
                d.initialize();
            } catch (Exception e) {
                LocalizableMessage msg = ERR_CLASS_LOADER_CANNOT_INITIALIZE_DEFN.get(d.getName(), d.getClass()
                        .getName(), String.valueOf(e.getMessage()));
                LocalizableMessage msg =
                    ERR_CLASS_LOADER_CANNOT_INITIALIZE_DEFN.get(d.getName(), d.getClass().getName(),
                        String.valueOf(e.getMessage()));
                throw new InitializationException(msg, e);
            }
        }
@@ -707,7 +719,8 @@
        } catch (Exception e) {
            debugLogger.trace("Unable to load jar file: " + jar, e);
            LocalizableMessage message = ERR_ADMIN_CANNOT_OPEN_JAR_FILE.get(jar.getName(), jar.getParent(),
            LocalizableMessage message =
                ERR_ADMIN_CANNOT_OPEN_JAR_FILE.get(jar.getName(), jar.getParent(),
                    stackTraceToSingleLineString(e, DynamicConstants.DEBUG_BUILD));
            throw new InitializationException(message);
        }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ClassPropertyDefinition.java
@@ -52,7 +52,7 @@
    /**
     * An interface for incrementally constructing class property definitions.
     */
    public static class Builder extends AbstractBuilder<String, ClassPropertyDefinition> {
    public static final class Builder extends AbstractBuilder<String, ClassPropertyDefinition> {
        // List of interfaces which property values must implement.
        private List<String> instanceOfInterfaces;
@@ -165,10 +165,8 @@
    }
    // Load a named class.
    private static Class<?> loadClass(String className, boolean initialize)
            throws ClassNotFoundException, LinkageError {
        return Class.forName(className, initialize, ClassLoaderProvider.getInstance()
                .getClassLoader());
    private static Class<?> loadClass(String className, boolean initialize) throws ClassNotFoundException {
        return Class.forName(className, initialize, ClassLoaderProvider.getInstance().getClassLoader());
    }
    // List of interfaces which property values must implement.
@@ -203,7 +201,7 @@
     * {@inheritDoc}
     */
    @Override
    public String decodeValue(String value) throws IllegalPropertyValueStringException {
    public String decodeValue(String value) {
        Reject.ifNull(value);
        try {
@@ -245,8 +243,7 @@
     *             If the referenced class does not implement the requested
     *             type.
     */
    public <T> Class<? extends T> loadClass(String className, Class<T> instanceOf)
            throws IllegalPropertyValueException, ClassCastException {
    public <T> Class<? extends T> loadClass(String className, Class<T> instanceOf) {
        Reject.ifNull(className, instanceOf);
        // Make sure that the named class is valid.
@@ -261,7 +258,7 @@
     * {@inheritDoc}
     */
    @Override
    public String normalizeValue(String value) throws IllegalPropertyValueException {
    public String normalizeValue(String value) {
        Reject.ifNull(value);
        return value.trim();
@@ -271,7 +268,7 @@
     * {@inheritDoc}
     */
    @Override
    public void validateValue(String value) throws IllegalPropertyValueException {
    public void validateValue(String value) {
        Reject.ifNull(value);
        // Always make sure the name is a valid class name.
@@ -289,20 +286,18 @@
    /*
     * Do some basic checks to make sure the string representation is valid.
     */
    private void validateClassName(String className) throws IllegalPropertyValueException {
    private void validateClassName(String className) {
        String nvalue = className.trim();
        if (!nvalue.matches(CLASS_RE)) {
            throw new IllegalPropertyValueException(this, className);
        }
    }
    /*
     * Make sure that named class implements the interfaces named by this
     * definition.
     */
    private Class<?> validateClassInterfaces(String className, boolean initialize)
            throws IllegalPropertyValueException {
    private Class<?> validateClassInterfaces(String className, boolean initialize) {
        Class<?> theClass = loadClassForValidation(className, className, initialize);
        for (String i : instanceOfInterfaces) {
            Class<?> instanceOfClass = loadClassForValidation(className, i, initialize);
@@ -313,8 +308,7 @@
        return theClass;
    }
    private Class<?> loadClassForValidation(String componentClassName, String classToBeLoaded,
            boolean initialize) {
    private Class<?> loadClassForValidation(String componentClassName, String classToBeLoaded, boolean initialize) {
        try {
            return loadClass(classToBeLoaded.trim(), initialize);
        } catch (ClassNotFoundException e) {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/Configuration.java
@@ -29,8 +29,7 @@
import org.forgerock.opendj.ldap.DN;
/**
 * A common base interface for all server managed object
 * configurations.
 * A common base interface for all server managed object configurations.
 */
public interface Configuration {
@@ -42,8 +41,6 @@
   */
  DN dn();
  /**
   * Gets the configuration class associated with this configuration.
   *
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ConfigurationClient.java
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DNPropertyDefinition.java
@@ -44,7 +44,7 @@
    /**
     * An interface for incrementally constructing DN property definitions.
     */
    public static class Builder extends AbstractBuilder<DN, DNPropertyDefinition> {
    public static final class Builder extends AbstractBuilder<DN, DNPropertyDefinition> {
        // Optional base DN which all valid values must be immediately
        // subordinate to.
@@ -65,7 +65,7 @@
         *             If the provided string is not a valid DN string
         *             representation.
         */
        public void setBaseDN(String baseDN) throws IllegalArgumentException {
        public void setBaseDN(String baseDN) {
            if (baseDN == null) {
                setBaseDN((DN) null);
            } else {
@@ -134,7 +134,7 @@
     * {@inheritDoc}
     */
    @Override
    public void validateValue(DN value) throws IllegalPropertyValueException {
    public void validateValue(DN value) {
        Reject.ifNull(value);
        if (baseDN != null) {
@@ -154,7 +154,7 @@
     * {@inheritDoc}
     */
    @Override
    public DN decodeValue(String value) throws IllegalPropertyValueStringException {
    public DN decodeValue(String value) {
        Reject.ifNull(value);
        try {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DefaultBehaviorProvider.java
@@ -25,32 +25,27 @@
 */
package org.opends.server.admin;
/**
 * An interface for determining the default behavior of a property. A
 * property exhibits default behavior when it has no values defined.
 * There are four different types of default behavior:
 * An interface for determining the default behavior of a property. A property
 * exhibits default behavior when it has no values defined. There are four
 * different types of default behavior:
 * <ol>
 * <li>there is no default behavior - e.g. leaving a "description"
 * unset has no side-effects. This default behavior is represented
 * using the {@link UndefinedDefaultBehaviorProvider} implementation
 * <li>the property defaults to one or more real values of the
 * property. This default behavior is represented using the
 * <li>there is no default behavior - e.g. leaving a "description" unset has no
 * side-effects. This default behavior is represented using the
 * {@link UndefinedDefaultBehaviorProvider} implementation
 * <li>the property defaults to one or more real values of the property. This
 * default behavior is represented using the
 * {@link DefinedDefaultBehaviorProvider} implementation
 * <li>the property defaults to some special behavior that cannot be
 * represented using real property values. This default behavior is
 * represented using the {@link AliasDefaultBehaviorProvider}
 * implementation
 * <li>the property inherits its values from property held in another
 * managed object (e.g. the parent managed object). This default
 * behavior is represented using the
 * {@link AbsoluteInheritedDefaultBehaviorProvider} and
 * <li>the property defaults to some special behavior that cannot be represented
 * using real property values. This default behavior is represented using the
 * {@link AliasDefaultBehaviorProvider} implementation
 * <li>the property inherits its values from property held in another managed
 * object (e.g. the parent managed object). This default behavior is represented
 * using the {@link AbsoluteInheritedDefaultBehaviorProvider} and
 * {@link RelativeInheritedDefaultBehaviorProvider} implementations.
 * </ol>
 * An application can perform actions based on the type of the default
 * behavior by implementing the {@link DefaultBehaviorProviderVisitor}
 * interface.
 * An application can perform actions based on the type of the default behavior
 * by implementing the {@link DefaultBehaviorProviderVisitor} interface.
 *
 * @param <T>
 *          The type of values represented by this provider.
@@ -64,8 +59,6 @@
    // No implementation required.
  }
  /**
   * Apply a visitor to this default behavior provider.
   *
@@ -80,21 +73,17 @@
   *          Optional additional visitor parameter.
   * @return Returns a result as specified by the visitor.
   */
  public abstract <R, P>
  R accept(DefaultBehaviorProviderVisitor<T, R, P> v, P p);
    public abstract <R, P> R accept(DefaultBehaviorProviderVisitor<T, R, P> v, P p);
  /**
   * Performs any run-time initialization required by this default
   * behavior provider. This may include resolving managed object
   * paths and property names.
     * Performs any run-time initialization required by this default behavior
     * provider. This may include resolving managed object paths and property
     * names.
   * <p>
   * The default implementation is to do nothing.
   *
   * @throws Exception
   *           If this default behavior provider could not be
   *           initialized.
     *             If this default behavior provider could not be initialized.
   */
  protected void initialize() throws Exception {
    // Default implementation is to do nothing.
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DefaultBehaviorProviderVisitor.java
@@ -23,16 +23,13 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
/**
 * A visitor of default behavior providers, in the style of the visitor design
 * pattern. Classes implementing this interface can query default behavior
 * providers in a type-safe manner when the kind of default behavior provider
 * is unknown at compile time. When a visitor is passed to a default behavior
 * providers in a type-safe manner when the kind of default behavior provider is
 * unknown at compile time. When a visitor is passed to a default behavior
 * provider's accept method, the corresponding visit method most applicable to
 * that default behavior provider is invoked.
 *
@@ -43,9 +40,9 @@
 *          {@link java.lang.Void} for visitors that do not need to return
 *          results.
 * @param <P>
 *          The type of the additional parameter to this visitor's methods. Use
 *          {@link java.lang.Void} for visitors that do not need an additional
 *          parameter.
 *            The type of the additional parameter to this visitor's methods.
 *            Use {@link java.lang.Void} for visitors that do not need an
 *            additional parameter.
 */
public interface DefaultBehaviorProviderVisitor<T, R, P> {
@@ -60,8 +57,6 @@
   */
  R visitAbsoluteInherited(AbsoluteInheritedDefaultBehaviorProvider<T> d, P p);
  /**
   * Visit an alias default behavior provider.
   *
@@ -73,8 +68,6 @@
   */
  R visitAlias(AliasDefaultBehaviorProvider<T> d, P p);
  /**
   * Visit an defined default behavior provider.
   *
@@ -86,8 +79,6 @@
   */
  R visitDefined(DefinedDefaultBehaviorProvider<T> d, P p);
  /**
   * Visit a relative inherited default behavior provider.
   *
@@ -99,8 +90,6 @@
   */
  R visitRelativeInherited(RelativeInheritedDefaultBehaviorProvider<T> d, P p);
  /**
   * Visit an undefined default behavior provider.
   *
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DefaultManagedObject.java
@@ -25,8 +25,6 @@
 */
package org.opends.server.admin;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -34,42 +32,34 @@
import java.util.SortedSet;
import java.util.TreeSet;
/**
 * A default managed object which should be created when a parent
 * managed object is created. Default managed objects are associated
 * with a {@link RelationDefinition}.
 * A default managed object which should be created when a parent managed object
 * is created. Default managed objects are associated with a
 * {@link RelationDefinition}.
 *
 * @param <C>
 *          The type of client default managed object configuration.
 * @param <S>
 *          The type of server default managed object configuration.
 */
public final class DefaultManagedObject
    <C extends ConfigurationClient, S extends Configuration>
    implements PropertyProvider {
public final class DefaultManagedObject<C extends ConfigurationClient, S extends Configuration> implements
    PropertyProvider {
  /**
   * An interface for incrementally constructing default managed
   * objects.
     * An interface for incrementally constructing default managed objects.
   *
   * @param <C>
   *          The type of client default managed object configuration.
   * @param <S>
   *          The type of server default managed object configuration.
   */
  public static final class Builder
      <C extends ConfigurationClient, S extends Configuration> {
    public static final class Builder<C extends ConfigurationClient, S extends Configuration> {
    // The default managed object's definition.
    private final ManagedObjectDefinition<C, S> definition;
    // The string encoded default managed object's properties.
    private final Map<String, List<String>> propertyStringValues =
      new HashMap<String, List<String>>();
        private final Map<String, List<String>> propertyStringValues = new HashMap<String, List<String>>();
    /**
     * Creates a new default managed object builder.
@@ -81,11 +71,9 @@
      this.definition = definition;
    }
    /**
     * Construct a default managed object based on the properties of
     * this builder.
         * Construct a default managed object based on the properties of this
         * builder.
     *
     * @return Returns the new default managed object.
     */
@@ -93,21 +81,17 @@
      return new DefaultManagedObject<C, S>(definition, propertyStringValues);
    }
    /**
     * Defines a property's values for the default managed object.
     *
     * @param name
     *          The name of the property.
     * @param values
     *          One or more property values in the string
     *          representation.
         *            One or more property values in the string representation.
     */
    public void setPropertyValues(String name, String... values) {
      if (values == null || values.length == 0) {
        throw new IllegalArgumentException(
            "null or empty values specified for property " + name);
                throw new IllegalArgumentException("null or empty values specified for property " + name);
      }
      propertyStringValues.put(name, Arrays.asList(values));
@@ -120,8 +104,6 @@
  // The string encoded default managed object's properties.
  private final Map<String, List<String>> propertyStringValues;
  // Private constructor.
  private DefaultManagedObject(ManagedObjectDefinition<C, S> definition,
      Map<String, List<String>> propertyStringValues) {
@@ -129,39 +111,33 @@
    this.propertyStringValues = propertyStringValues;
  }
  /**
   * Gets the managed object definition associated with this default
   * managed object.
     * Gets the managed object definition associated with this default managed
     * object.
   *
   * @return Returns the managed object definition associated with
   *         this default managed object.
     * @return Returns the managed object definition associated with this
     *         default managed object.
   */
  public ManagedObjectDefinition<C, S> getManagedObjectDefinition() {
    return definition;
  }
  /**
   * Gets a mutable copy of the set of property values for the
   * specified property.
     * Gets a mutable copy of the set of property values for the specified
     * property.
   *
   * @param <T>
   *          The type of the property to be retrieved.
   * @param pd
   *          The property to be retrieved.
   * @return Returns a newly allocated set containing a copy of the
   *         property's values. An empty set indicates that the
   *         property has no values defined and any default behavior
   *         is applicable.
     * @return Returns a newly allocated set containing a copy of the property's
     *         values. An empty set indicates that the property has no values
     *         defined and any default behavior is applicable.
   * @throws IllegalArgumentException
   *           If the property definition is not associated with this
   *           managed object's definition.
   */
  public <T> SortedSet<T> getPropertyValues(PropertyDefinition<T> pd)
      throws IllegalArgumentException {
    public <T> SortedSet<T> getPropertyValues(PropertyDefinition<T> pd) {
    // Validate the property definition.
    definition.getPropertyDefinition(pd.getName());
@@ -176,14 +152,11 @@
    return values;
  }
  /**
   * Performs run-time initialization of properties.
   *
   * @throws Exception
   *           If this default managed object could not be
   *           initialized.
     *             If this default managed object could not be initialized.
   */
  void initialize() throws Exception {
    // FIXME: it would be nice if we could decode all property values
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DefinedDefaultBehaviorProvider.java
@@ -25,14 +25,10 @@
 */
package org.opends.server.admin;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
/**
 * A default behavior provider which represents a well-defined set of default
 * values. It should be used by properties which have default value(s) which are
@@ -41,14 +37,11 @@
 * @param <T>
 *          The type of values represented by this provider.
 */
public final class DefinedDefaultBehaviorProvider<T> extends
    DefaultBehaviorProvider<T> {
public final class DefinedDefaultBehaviorProvider<T> extends DefaultBehaviorProvider<T> {
  // The collection of default values.
  private final Collection<String> values;
  /**
   * Create a new defined default behavior provider associated with the
   * specified list of values.
@@ -59,17 +52,13 @@
   * @throws IllegalArgumentException
   *           If the list of values was <code>null</code> or empty.
   */
  public DefinedDefaultBehaviorProvider(String... values)
      throws IllegalArgumentException {
    public DefinedDefaultBehaviorProvider(String... values) {
    if (values == null || values.length == 0) {
      throw new IllegalArgumentException(
          "Null or empty list of default values");
            throw new IllegalArgumentException("Null or empty list of default values");
    }
    this.values = Arrays.asList(values);
  }
  /**
   * {@inheritDoc}
   */
@@ -77,8 +66,6 @@
    return v.visitDefined(this, p);
  }
  /**
   * Get a copy of the default values.
   *
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DefinitionDecodingException.java
@@ -31,14 +31,13 @@
import org.forgerock.i18n.LocalizableMessage;
/**
 * The requested managed object was found but its type could not be
 * determined.
 * The requested managed object was found but its type could not be determined.
 */
public class DefinitionDecodingException extends DecodingException {
  /**
   * An enumeration defining the reasons why the definition could not
   * be resolved.
     * An enumeration defining the reasons why the definition could not be
     * resolved.
   */
  public static enum Reason {
    /**
@@ -54,9 +53,8 @@
    NO_TYPE_INFORMATION(),
    /**
     * The managed object could be found but did not contain the
     * expected type information (eg incorrect object classes in
     * LDAP).
         * The managed object could be found but did not contain the expected
         * type information (eg incorrect object classes in LDAP).
     */
    WRONG_TYPE_INFORMATION();
@@ -67,11 +65,8 @@
   */
  private static final long serialVersionUID = 3459033551415663416L;
  // Create the message.
  private static LocalizableMessage createLocalizableMessage(AbstractManagedObjectDefinition<?, ?> d,
      Reason reason) {
    private static LocalizableMessage createLocalizableMessage(AbstractManagedObjectDefinition<?, ?> d, Reason reason) {
    LocalizableMessage ufn = d.getUserFriendlyName();
    switch (reason) {
    case NO_TYPE_INFORMATION:
@@ -89,8 +84,6 @@
  // The reason why the definition could not be determined.
  private final Reason reason;
  /**
   * Create a new definition decoding exception.
   *
@@ -99,15 +92,12 @@
   * @param reason
   *          The reason why the definition could not be determined.
   */
  public DefinitionDecodingException(AbstractManagedObjectDefinition<?, ?> d,
      Reason reason) {
    public DefinitionDecodingException(AbstractManagedObjectDefinition<?, ?> d, Reason reason) {
    super(createLocalizableMessage(d, reason));
    this.d = d;
    this.reason = reason;
  }
  /**
   * Gets the expected managed object definition.
   *
@@ -117,13 +107,10 @@
    return d;
  }
  /**
   * Gets the reason why the definition could not be determined.
   *
   * @return Returns the reason why the definition could not be
   *         determined.
     * @return Returns the reason why the definition could not be determined.
   */
  public Reason getReason() {
    return reason;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DefinitionResolver.java
@@ -25,35 +25,30 @@
 */
package org.opends.server.admin;
/**
 * This interface is used to determine the "best match" managed object
 * definition in a definition hierarchy.
 * <p>
 * Managed object definitions, like Java classes, are arranged in an
 * inheritance hierarchy. When managed objects are decoded (e.g. from
 * LDAP entries), the driver implementation is provided with an
 * "expected managed object definition". However, the actual decoded
 * managed object is often an instance of a sub-type of this
 * definition. For example, when decoding a connection handler managed
 * object, the actual type can never be a connection handler because
 * it is an abstract managed object type. Instead, the decoded managed
 * object must be a "concrete" sub-type: an LDAP connection handler or
 * JMX connection handler.
 * Managed object definitions, like Java classes, are arranged in an inheritance
 * hierarchy. When managed objects are decoded (e.g. from LDAP entries), the
 * driver implementation is provided with an
 * "expected managed object definition". However, the actual decoded managed
 * object is often an instance of a sub-type of this definition. For example,
 * when decoding a connection handler managed object, the actual type can never
 * be a connection handler because it is an abstract managed object type.
 * Instead, the decoded managed object must be a "concrete" sub-type: an LDAP
 * connection handler or JMX connection handler.
 * <p>
 * This resolution process is coordinated by the
 * <code>resolveManagedObjectDefinition</code> method in managed
 * object definitions, where it is passed a
 * <code>DefinitionResolver</code> implementation. The
 * <code>resolveManagedObjectDefinition</code> method takes care of
 * recursively descending through the definition hierarchy and invokes
 * the {@link #matches(AbstractManagedObjectDefinition)} method
 * against each potential sub-type. It is the job of the resolver to
 * indicate whether the provided managed object definition is a
 * candidate definition. For example, the LDAP driver provides a
 * definition resolver which uses the decoded LDAP entry's object
 * classes to determine the final appropriate managed object
 * <code>resolveManagedObjectDefinition</code> method in managed object
 * definitions, where it is passed a <code>DefinitionResolver</code>
 * implementation. The <code>resolveManagedObjectDefinition</code> method takes
 * care of recursively descending through the definition hierarchy and invokes
 * the {@link #matches(AbstractManagedObjectDefinition)} method against each
 * potential sub-type. It is the job of the resolver to indicate whether the
 * provided managed object definition is a candidate definition. For example,
 * the LDAP driver provides a definition resolver which uses the decoded LDAP
 * entry's object classes to determine the final appropriate managed object
 * definition.
 */
public interface DefinitionResolver {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DurationPropertyDefinition.java
@@ -82,7 +82,7 @@
     * An interface for incrementally constructing duration property
     * definitions.
     */
    public static class Builder extends AbstractBuilder<Long, DurationPropertyDefinition> {
    public static final class Builder extends AbstractBuilder<Long, DurationPropertyDefinition> {
        // The base unit for this property definition.
        private DurationUnit baseUnit = DurationUnit.SECONDS;
@@ -120,7 +120,7 @@
         *             duration unit, or if the base unit is bigger than the
         *             maximum unit.
         */
        public final void setBaseUnit(String unit) throws IllegalArgumentException {
        public final void setBaseUnit(String unit) {
            Reject.ifNull(unit);
            setBaseUnit(DurationUnit.getUnit(unit));
@@ -137,7 +137,7 @@
         *             If the provided base unit is bigger than the maximum
         *             unit.
         */
        public final void setBaseUnit(DurationUnit unit) throws IllegalArgumentException {
        public final void setBaseUnit(DurationUnit unit) {
            Reject.ifNull(unit);
            // Make sure that the base unit is not bigger than the maximum
@@ -163,7 +163,7 @@
         *             duration unit, or if the maximum unit is smaller than the
         *             base unit.
         */
        public final void setMaximumUnit(String unit) throws IllegalArgumentException {
        public final void setMaximumUnit(String unit) {
            if (unit == null) {
                setMaximumUnit((DurationUnit) null);
            } else {
@@ -182,7 +182,7 @@
         *             If the provided maximum unit is smaller than the base
         *             unit.
         */
        public final void setMaximumUnit(DurationUnit unit) throws IllegalArgumentException {
        public final void setMaximumUnit(DurationUnit unit) {
            if (unit != null) {
                // Make sure that the maximum unit is not smaller than the
                // base unit.
@@ -203,7 +203,7 @@
         *             If a negative lower limit was specified, or the lower
         *             limit is greater than the upper limit.
         */
        public final void setLowerLimit(long lowerLimit) throws IllegalArgumentException {
        public final void setLowerLimit(long lowerLimit) {
            if (lowerLimit < 0) {
                throw new IllegalArgumentException("Negative lower limit");
            }
@@ -227,7 +227,7 @@
         *             lower limit was specified, or the lower limit is greater
         *             than the upper limit.
         */
        public final void setLowerLimit(String lowerLimit) throws IllegalArgumentException {
        public final void setLowerLimit(String lowerLimit) {
            setLowerLimit(DurationUnit.parseValue(lowerLimit, baseUnit));
        }
@@ -242,7 +242,7 @@
         *             limit is greater than the upper limit or unlimited
         *             durations are permitted.
         */
        public final void setUpperLimit(Long upperLimit) throws IllegalArgumentException {
        public final void setUpperLimit(Long upperLimit) {
            if (upperLimit != null) {
                if (upperLimit < 0) {
                    throw new IllegalArgumentException("Negative upper limit");
@@ -272,7 +272,7 @@
         *             If the upper limit could not be parsed, or if the lower
         *             limit is greater than the upper limit.
         */
        public final void setUpperLimit(String upperLimit) throws IllegalArgumentException {
        public final void setUpperLimit(String upperLimit) {
            if (upperLimit == null) {
                setUpperLimit((Long) null);
            } else {
@@ -291,7 +291,7 @@
         *             If unlimited values are to be permitted but there is an
         *             upper limit specified.
         */
        public final void setAllowUnlimited(boolean allowUnlimited) throws IllegalArgumentException {
        public final void setAllowUnlimited(boolean allowUnlimited) {
            if (allowUnlimited && upperLimit != null) {
                throw new IllegalArgumentException("Upper limit specified when unlimited durations are permitted");
            }
@@ -392,7 +392,7 @@
     * {@inheritDoc}
     */
    @Override
    public void validateValue(Long value) throws IllegalPropertyValueException {
    public void validateValue(Long value) {
        Reject.ifNull(value);
        long nvalue = baseUnit.toMilliSeconds(value);
@@ -413,7 +413,7 @@
     * {@inheritDoc}
     */
    @Override
    public String encodeValue(Long value) throws IllegalPropertyValueException {
    public String encodeValue(Long value) {
        Reject.ifNull(value);
        // Make sure that we correctly encode negative values as
@@ -436,7 +436,7 @@
     * {@inheritDoc}
     */
    @Override
    public Long decodeValue(String value) throws IllegalPropertyValueStringException {
    public Long decodeValue(String value) {
        Reject.ifNull(value);
        // First check for the special "unlimited" value when necessary.
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/DurationUnit.java
@@ -25,15 +25,11 @@
 */
package org.opends.server.admin;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
 * This enumeration defines various duration units.
 */
@@ -70,47 +66,41 @@
  WEEKS((long) 7 * 24 * 60 * 60 * 1000, "w", "weeks");
  // A lookup table for resolving a unit from its name.
  private static final Map<String, DurationUnit> nameToUnit;
    private static final Map<String, DurationUnit> NAME_TO_UNIT;
  static {
    nameToUnit = new HashMap<String, DurationUnit>();
        NAME_TO_UNIT = new HashMap<String, DurationUnit>();
    for (DurationUnit unit : DurationUnit.values()) {
      nameToUnit.put(unit.shortName, unit);
      nameToUnit.put(unit.longName, unit);
            NAME_TO_UNIT.put(unit.shortName, unit);
            NAME_TO_UNIT.put(unit.longName, unit);
    }
  }
  /**
   * Get the unit corresponding to the provided unit name.
   *
   * @param s
   *          The name of the unit. Can be the abbreviated or long
   *          name and can contain white space and mixed case
   *          characters.
     *            The name of the unit. Can be the abbreviated or long name and
     *            can contain white space and mixed case characters.
   * @return Returns the unit corresponding to the provided unit name.
   * @throws IllegalArgumentException
   *           If the provided name did not correspond to a known
   *           duration unit.
     *             If the provided name did not correspond to a known duration
     *             unit.
   */
  public static DurationUnit getUnit(String s) throws IllegalArgumentException {
    DurationUnit unit = nameToUnit.get(s.trim().toLowerCase());
    public static DurationUnit getUnit(String s) {
        DurationUnit unit = NAME_TO_UNIT.get(s.trim().toLowerCase());
    if (unit == null) {
      throw new IllegalArgumentException("Illegal duration unit \"" + s + "\"");
    }
    return unit;
  }
  /**
   * Parse the provided duration string and return its equivalent
   * duration in milliseconds. The duration string must specify the
   * unit e.g. "10s". This method will parse duration string
   * representations produced from the {@link #toString(long)} method.
   * Therefore, a duration can comprise of multiple duration
   * specifiers, for example <code>1d15m25s</code>.
     * Parse the provided duration string and return its equivalent duration in
     * milliseconds. The duration string must specify the unit e.g. "10s". This
     * method will parse duration string representations produced from the
     * {@link #toString(long)} method. Therefore, a duration can comprise of
     * multiple duration specifiers, for example <code>1d15m25s</code>.
   *
   * @param s
   *          The duration string to be parsed.
@@ -119,40 +109,37 @@
   *           If the provided duration string could not be parsed.
   * @see #toString(long)
   */
  public static long parseValue(String s) throws NumberFormatException {
    public static long parseValue(String s) {
    return parseValue(s, null);
  }
  /**
   * Parse the provided duration string and return its equivalent
   * duration in milliseconds. This method will parse duration string
   * representations produced from the {@link #toString(long)} method.
   * Therefore, a duration can comprise of multiple duration
   * specifiers, for example <code>1d15m25s</code>.
     * Parse the provided duration string and return its equivalent duration in
     * milliseconds. This method will parse duration string representations
     * produced from the {@link #toString(long)} method. Therefore, a duration
     * can comprise of multiple duration specifiers, for example
     * <code>1d15m25s</code>.
   *
   * @param s
   *          The duration string to be parsed.
   * @param defaultUnit
   *          The default unit to use if there is no unit specified in
   *          the duration string, or <code>null</code> if the
   *          string must always contain a unit.
     *            The default unit to use if there is no unit specified in the
     *            duration string, or <code>null</code> if the string must
     *            always contain a unit.
   * @return Returns the parsed duration in milliseconds.
   * @throws NumberFormatException
   *           If the provided duration string could not be parsed.
   * @see #toString(long)
   */
  public static long parseValue(String s, DurationUnit defaultUnit)
      throws NumberFormatException {
    public static long parseValue(String s, DurationUnit defaultUnit) {
    String ns = s.trim();
    if (ns.length() == 0) {
      throw new NumberFormatException("Empty duration value \"" + s + "\"");
    }
    Pattern p1 = Pattern.compile("^\\s*((\\d+)\\s*w)?" + "\\s*((\\d+)\\s*d)?"
        + "\\s*((\\d+)\\s*h)?" + "\\s*((\\d+)\\s*m)?" + "\\s*((\\d+)\\s*s)?"
        + "\\s*((\\d+)\\s*ms)?\\s*$", Pattern.CASE_INSENSITIVE);
        Pattern p1 =
            Pattern.compile("^\\s*((\\d+)\\s*w)?" + "\\s*((\\d+)\\s*d)?" + "\\s*((\\d+)\\s*h)?"
                + "\\s*((\\d+)\\s*m)?" + "\\s*((\\d+)\\s*s)?" + "\\s*((\\d+)\\s*ms)?\\s*$", Pattern.CASE_INSENSITIVE);
    Matcher m1 = p1.matcher(ns);
    if (m1.matches()) {
      // Value must be of the form produced by toString(long).
@@ -216,8 +203,7 @@
      DurationUnit unit;
      if (unitString == null) {
        if (defaultUnit == null) {
          throw new NumberFormatException("Invalid duration value \"" + s
              + "\"");
                    throw new NumberFormatException("Invalid duration value \"" + s + "\"");
        } else {
          unit = defaultUnit;
        }
@@ -225,8 +211,7 @@
        try {
          unit = getUnit(unitString);
        } catch (IllegalArgumentException e) {
          throw new NumberFormatException("Invalid duration value \"" + s
              + "\"");
                    throw new NumberFormatException("Invalid duration value \"" + s + "\"");
        }
      }
@@ -234,14 +219,12 @@
    }
  }
  /**
   * Returns a string representation of the provided duration. The
   * string representation can be parsed using the
   * {@link #parseValue(String)} method. The string representation is
   * comprised of one or more of the number of weeks, days, hours,
   * minutes, seconds, and milliseconds. Here are some examples:
     * Returns a string representation of the provided duration. The string
     * representation can be parsed using the {@link #parseValue(String)}
     * method. The string representation is comprised of one or more of the
     * number of weeks, days, hours, minutes, seconds, and milliseconds. Here
     * are some examples:
   *
   * <pre>
   * toString(0)       // 0 ms
@@ -260,7 +243,7 @@
   * @see #parseValue(String)
   * @see #parseValue(String, DurationUnit)
   */
  public static String toString(long duration) throws IllegalArgumentException {
    public static String toString(long duration) {
    if (duration < 0) {
      throw new IllegalArgumentException("Negative duration " + duration);
    }
@@ -269,8 +252,7 @@
      return "0 ms";
    }
    DurationUnit[] units = new DurationUnit[] { WEEKS, DAYS, HOURS, MINUTES,
        SECONDS, MILLI_SECONDS };
        DurationUnit[] units = new DurationUnit[] { WEEKS, DAYS, HOURS, MINUTES, SECONDS, MILLI_SECONDS };
    long remainder = duration;
    StringBuilder builder = new StringBuilder();
    boolean isFirst = true;
@@ -299,8 +281,6 @@
  // The size of the unit in milliseconds.
  private final long sz;
  // Private constructor.
  private DurationUnit(long sz, String shortName, String longName) {
    this.sz = sz;
@@ -308,8 +288,6 @@
    this.longName = longName;
  }
  /**
   * Converts the specified duration in milliseconds to this unit.
   *
@@ -321,20 +299,15 @@
    return ((double) duration / sz);
  }
  /**
   * Get the number of milliseconds that this unit represents.
   *
   * @return Returns the number of milliseconds that this unit
   *         represents.
     * @return Returns the number of milliseconds that this unit represents.
   */
  public long getDuration() {
    return sz;
  }
  /**
   * Get the long name of this unit.
   *
@@ -344,8 +317,6 @@
    return longName;
  }
  /**
   * Get the abbreviated name of this unit.
   *
@@ -355,27 +326,21 @@
    return shortName;
  }
  /**
   * Converts the specified duration in this unit to milliseconds.
   *
   * @param duration
   *          The duration as a quantity of this unit.
   * @return Returns the number of milliseconds that the duration
   *         represents.
     * @return Returns the number of milliseconds that the duration represents.
   */
  public long toMilliSeconds(double duration) {
    return (long) (sz * duration);
  }
  /**
   * {@inheritDoc}
   * <p>
   * This implementation returns the abbreviated name of this duration
   * unit.
     * This implementation returns the abbreviated name of this duration unit.
   */
  @Override
  public String toString() {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/EnumPropertyDefinition.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
import org.forgerock.util.Reject;
@@ -53,7 +52,7 @@
     *            The enumeration that should be used for values of this
     *            property definition.
     */
    public static class Builder<E extends Enum<E>> extends AbstractBuilder<E, EnumPropertyDefinition<E>> {
    public final static class Builder<E extends Enum<E>> extends AbstractBuilder<E, EnumPropertyDefinition<E>> {
        // The enumeration class.
        private Class<E> enumClass;
@@ -80,8 +79,8 @@
         * {@inheritDoc}
         */
        @Override
        protected EnumPropertyDefinition<E> buildInstance(AbstractManagedObjectDefinition<?, ?> d, String propertyName,
                EnumSet<PropertyOption> options, AdministratorAction adminAction,
        protected EnumPropertyDefinition<E> buildInstance(AbstractManagedObjectDefinition<?, ?> d,
            String propertyName, EnumSet<PropertyOption> options, AdministratorAction adminAction,
                DefaultBehaviorProvider<E> defaultBehavior) {
            // Make sure that the enumeration class has been defined.
            if (enumClass == null) {
@@ -118,8 +117,8 @@
    // Private constructor.
    private EnumPropertyDefinition(AbstractManagedObjectDefinition<?, ?> d, String propertyName,
            EnumSet<PropertyOption> options, AdministratorAction adminAction,
            DefaultBehaviorProvider<E> defaultBehavior, Class<E> enumClass) {
        EnumSet<PropertyOption> options, AdministratorAction adminAction, DefaultBehaviorProvider<E> defaultBehavior,
        Class<E> enumClass) {
        super(d, enumClass, propertyName, options, adminAction, defaultBehavior);
        this.enumClass = enumClass;
@@ -151,7 +150,7 @@
     * {@inheritDoc}
     */
    @Override
    public E decodeValue(String value) throws IllegalPropertyValueStringException {
    public E decodeValue(String value) {
        Reject.ifNull(value);
        String nvalue = value.trim().toLowerCase();
@@ -210,7 +209,7 @@
     * {@inheritDoc}
     */
    @Override
    public String normalizeValue(E value) throws IllegalPropertyValueException {
    public String normalizeValue(E value) {
        Reject.ifNull(value);
        return value.toString().trim().toLowerCase();
@@ -220,7 +219,7 @@
     * {@inheritDoc}
     */
    @Override
    public void validateValue(E value) throws IllegalPropertyValueException {
    public void validateValue(E value) {
        Reject.ifNull(value);
        // No additional validation required.
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/GenericConstraint.java
@@ -49,7 +49,7 @@
    /**
     * The client-side constraint handler.
     */
    private class ClientHandler extends ClientConstraintHandler {
    private final class ClientHandler extends ClientConstraintHandler {
        // Private constructor.
        private ClientHandler() {
@@ -89,7 +89,7 @@
    /**
     * The server-side constraint handler.
     */
    private class ServerHandler extends ServerConstraintHandler {
    private final class ServerHandler extends ServerConstraintHandler {
        // Private constructor.
        private ServerHandler() {
@@ -100,8 +100,8 @@
         * {@inheritDoc}
         */
        @Override
        public boolean isUsable(ServerManagedObject<?> managedObject, Collection<LocalizableMessage> unacceptableReasons)
                throws ConfigException {
        public boolean isUsable(ServerManagedObject<?> managedObject,
            Collection<LocalizableMessage> unacceptableReasons) throws ConfigException {
            if (!condition.evaluate(managedObject)) {
                unacceptableReasons.add(getSynopsis());
                return false;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/IPAddressMaskPropertyDefinition.java
@@ -42,7 +42,7 @@
     * An interface for incrementally constructing IP address mask property
     * definitions.
     */
    public static class Builder extends AbstractBuilder<AddressMask, IPAddressMaskPropertyDefinition> {
    public static final class Builder extends AbstractBuilder<AddressMask, IPAddressMaskPropertyDefinition> {
        // Private constructor
        private Builder(AbstractManagedObjectDefinition<?, ?> d, String propertyName) {
@@ -86,7 +86,7 @@
     * {@inheritDoc}
     */
    @Override
    public void validateValue(AddressMask value) throws IllegalPropertyValueException {
    public void validateValue(AddressMask value) {
        Reject.ifNull(value);
        // No additional validation required.
@@ -96,7 +96,7 @@
     * {@inheritDoc}
     */
    @Override
    public AddressMask decodeValue(String value) throws IllegalPropertyValueStringException {
    public AddressMask decodeValue(String value) {
        Reject.ifNull(value);
        try {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/IPAddressPropertyDefinition.java
@@ -41,7 +41,7 @@
     * An interface for incrementally constructing IP address property
     * definitions.
     */
    public static class Builder extends AbstractBuilder<InetAddress, IPAddressPropertyDefinition> {
    public static final class Builder extends AbstractBuilder<InetAddress, IPAddressPropertyDefinition> {
        // Private constructor
        private Builder(AbstractManagedObjectDefinition<?, ?> d, String propertyName) {
@@ -85,7 +85,7 @@
     * {@inheritDoc}
     */
    @Override
    public void validateValue(InetAddress value) throws IllegalPropertyValueException {
    public void validateValue(InetAddress value) {
        Reject.ifNull(value);
        // No additional validation required.
@@ -95,7 +95,7 @@
     * {@inheritDoc}
     */
    @Override
    public InetAddress decodeValue(String value) throws IllegalPropertyValueStringException {
    public InetAddress decodeValue(String value) {
        Reject.ifNull(value);
        try {
@@ -110,7 +110,7 @@
     * {@inheritDoc}
     */
    @Override
    public String encodeValue(InetAddress value) throws IllegalPropertyValueException {
    public String encodeValue(InetAddress value) {
        // We should return the host name if it is available, or the IP
        // address if not.
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/IllegalPropertyValueException.java
@@ -24,7 +24,6 @@
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions copyright 2013 ForgeRock AS.
 */
package org.opends.server.admin;
import static com.forgerock.opendj.ldap.AdminMessages.*;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/IllegalPropertyValueStringException.java
@@ -24,7 +24,6 @@
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions copyright 2013 ForgeRock AS.
 */
package org.opends.server.admin;
import org.forgerock.i18n.LocalizableMessage;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/InstantiableRelationDefinition.java
@@ -72,7 +72,8 @@
        // The optional default managed objects associated with this
        // instantiable relation definition.
        private final Map<String, DefaultManagedObject<? extends C, ? extends S>> defaultManagedObjects = new HashMap<String, DefaultManagedObject<? extends C, ? extends S>>();
        private final Map<String, DefaultManagedObject<? extends C, ? extends S>> defaultManagedObjects =
            new HashMap<String, DefaultManagedObject<? extends C, ? extends S>>();
        /**
         * Creates a new builder which can be used to incrementally build an
@@ -170,8 +171,7 @@
     *             If there is no default managed object associated with the
     *             provided name.
     */
    public DefaultManagedObject<? extends C, ? extends S> getDefaultManagedObject(String name)
            throws IllegalArgumentException {
    public DefaultManagedObject<? extends C, ? extends S> getDefaultManagedObject(String name) {
        if (!defaultManagedObjects.containsKey(name)) {
            throw new IllegalArgumentException("unrecognized default managed object \"" + name + "\"");
        }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/IntegerPropertyDefinition.java
@@ -59,7 +59,7 @@
    /**
     * An interface for incrementally constructing integer property definitions.
     */
    public static class Builder extends AbstractBuilder<Integer, IntegerPropertyDefinition> {
    public static final class Builder extends AbstractBuilder<Integer, IntegerPropertyDefinition> {
        // The lower limit of the property value.
        private int lowerLimit = 0;
@@ -86,7 +86,7 @@
         *             If a negative lower limit was specified or the lower
         *             limit is greater than the upper limit.
         */
        public final void setLowerLimit(int lowerLimit) throws IllegalArgumentException {
        public final void setLowerLimit(int lowerLimit) {
            if (lowerLimit < 0) {
                throw new IllegalArgumentException("Negative lower limit");
            }
@@ -131,8 +131,8 @@
         * {@inheritDoc}
         */
        @Override
        protected IntegerPropertyDefinition buildInstance(AbstractManagedObjectDefinition<?, ?> d, String propertyName,
                EnumSet<PropertyOption> options, AdministratorAction adminAction,
        protected IntegerPropertyDefinition buildInstance(AbstractManagedObjectDefinition<?, ?> d,
            String propertyName, EnumSet<PropertyOption> options, AdministratorAction adminAction,
                DefaultBehaviorProvider<Integer> defaultBehavior) {
            return new IntegerPropertyDefinition(d, propertyName, options, adminAction, defaultBehavior, lowerLimit,
                    upperLimit, allowUnlimited);
@@ -229,7 +229,7 @@
     * {@inheritDoc}
     */
    @Override
    public void validateValue(Integer value) throws IllegalPropertyValueException {
    public void validateValue(Integer value) {
        Reject.ifNull(value);
        if (!allowUnlimited && value < lowerLimit) {
@@ -249,7 +249,7 @@
     * {@inheritDoc}
     */
    @Override
    public String encodeValue(Integer value) throws IllegalPropertyValueException {
    public String encodeValue(Integer value) {
        Reject.ifNull(value);
        // Make sure that we correctly encode negative values as "unlimited".
@@ -266,7 +266,7 @@
     * {@inheritDoc}
     */
    @Override
    public Integer decodeValue(String value) throws IllegalPropertyValueStringException {
    public Integer decodeValue(String value) {
        Reject.ifNull(value);
        if (allowUnlimited) {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/LDAPProfile.java
@@ -184,8 +184,7 @@
     *             If the LDAP profile properties file associated with the
     *             provided managed object definition could not be loaded.
     */
    public String getAttributeName(AbstractManagedObjectDefinition<?, ?> d, PropertyDefinition<?> pd)
            throws MissingResourceException {
    public String getAttributeName(AbstractManagedObjectDefinition<?, ?> d, PropertyDefinition<?> pd) {
        for (Wrapper profile : profiles) {
            String attributeName = profile.getAttributeName(d, pd);
            if (attributeName != null) {
@@ -207,7 +206,7 @@
     *             If the LDAP profile properties file associated with the
     *             provided managed object definition could not be loaded.
     */
    public String getRelationChildRDNType(InstantiableRelationDefinition<?, ?> r) throws MissingResourceException {
    public String getRelationChildRDNType(InstantiableRelationDefinition<?, ?> r) {
        if (r.getNamingPropertyDefinition() != null) {
            // Use the attribute associated with the naming property.
            return getAttributeName(r.getChildDefinition(), r.getNamingPropertyDefinition());
@@ -246,7 +245,7 @@
     *             If the LDAP profile properties file associated with the
     *             provided managed object definition could not be loaded.
     */
    public String getRelationChildRDNType(SetRelationDefinition<?, ?> r) throws MissingResourceException {
    public String getRelationChildRDNType(SetRelationDefinition<?, ?> r) {
        for (Wrapper profile : profiles) {
            String rdnType = profile.getRelationChildRDNType(r);
            if (rdnType != null) {
@@ -267,7 +266,7 @@
     *             If the LDAP profile properties file associated with the
     *             provided managed object definition could not be loaded.
     */
    public String getObjectClass(AbstractManagedObjectDefinition<?, ?> d) throws MissingResourceException {
    public String getObjectClass(AbstractManagedObjectDefinition<?, ?> d) {
        if (d.isTop()) {
            return "top";
        }
@@ -295,7 +294,7 @@
     *             If the LDAP profile properties file associated with the
     *             provided managed object definition could not be loaded.
     */
    public List<String> getObjectClasses(AbstractManagedObjectDefinition<?, ?> d) throws MissingResourceException {
    public List<String> getObjectClasses(AbstractManagedObjectDefinition<?, ?> d) {
        LinkedList<String> objectClasses = new LinkedList<String>();
        Set<String> s = new HashSet<String>();
@@ -326,7 +325,7 @@
     *             If the LDAP profile properties file associated with the
     *             provided managed object definition could not be loaded.
     */
    public String getRelationRDNSequence(RelationDefinition<?, ?> r) throws MissingResourceException {
    public String getRelationRDNSequence(RelationDefinition<?, ?> r) {
        for (Wrapper profile : profiles) {
            String rdnSequence = profile.getRelationRDNSequence(r);
            if (rdnSequence != null) {
@@ -343,7 +342,7 @@
     * @throws NoSuchElementException
     *             If there are no LDAP profile wrappers.
     */
    public void popWrapper() throws NoSuchElementException {
    public void popWrapper() {
        profiles.removeFirst();
    }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectAlreadyExistsException.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
import static com.forgerock.opendj.ldap.AdminMessages.*;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectDefinition.java
@@ -23,19 +23,13 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
import org.opends.server.admin.client.ManagedObject;
import org.opends.server.admin.server.ServerManagedObject;
/**
 * Defines the structure of a managed object which can be
 * instantiated.
 * Defines the structure of a managed object which can be instantiated.
 *
 * @param <C>
 *          The type of client managed object configuration that this
@@ -44,9 +38,8 @@
 *          The type of server managed object configuration that this
 *          definition represents.
 */
public abstract class ManagedObjectDefinition
    <C extends ConfigurationClient, S extends Configuration>
    extends AbstractManagedObjectDefinition<C, S> {
public abstract class ManagedObjectDefinition<C extends ConfigurationClient, S extends Configuration> extends
    AbstractManagedObjectDefinition<C, S> {
  /**
   * Create a new managed object definition.
@@ -54,51 +47,42 @@
   * @param name
   *          The name of the definition.
   * @param parent
   *          The parent definition, or <code>null</code> if there
   *          is no parent.
     *            The parent definition, or <code>null</code> if there is no
     *            parent.
   */
  protected ManagedObjectDefinition(String name,
      AbstractManagedObjectDefinition<? super C, ? super S> parent) {
    protected ManagedObjectDefinition(String name, AbstractManagedObjectDefinition<? super C, ? super S> parent) {
    super(name, parent);
  }
  /**
   * Creates a client configuration view of the provided managed
   * object. Modifications made to the underlying managed object will
   * be reflected in the client configuration view and vice versa.
     * Creates a client configuration view of the provided managed object.
     * Modifications made to the underlying managed object will be reflected in
     * the client configuration view and vice versa.
   *
   * @param managedObject
   *          The managed object.
   * @return Returns a client configuration view of the provided
   *         managed object.
     * @return Returns a client configuration view of the provided managed
     *         object.
   */
  public abstract C createClientConfiguration(
      ManagedObject<? extends C> managedObject);
    public abstract C createClientConfiguration(ManagedObject<? extends C> managedObject);
  /**
   * Creates a server configuration view of the provided server
   * managed object.
     * Creates a server configuration view of the provided server managed
     * object.
   *
   * @param managedObject
   *          The server managed object.
   * @return Returns a server configuration view of the provided
   *         server managed object.
     * @return Returns a server configuration view of the provided server
     *         managed object.
   */
  public abstract S createServerConfiguration(
      ServerManagedObject<? extends S> managedObject);
    public abstract S createServerConfiguration(ServerManagedObject<? extends S> managedObject);
  /**
   * Gets the server configuration class instance associated with this
   * managed object definition.
     * Gets the server configuration class instance associated with this managed
     * object definition.
   *
   * @return Returns the server configuration class instance
   *         associated with this managed object definition.
     * @return Returns the server configuration class instance associated with
     *         this managed object definition.
   */
  public abstract Class<S> getServerConfigurationClass();
}
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectDefinitionI18NResource.java
@@ -107,8 +107,7 @@
     *             If the provided managed object definition was the
     *             {@link TopCfgDefn}.
     */
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key)
            throws MissingResourceException, UnsupportedOperationException {
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key) {
        return getMessage(d, key, Locale.getDefault(), (String[]) null);
    }
@@ -130,8 +129,7 @@
     *             If the provided managed object definition was the
     *             {@link TopCfgDefn}.
     */
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key, Locale locale)
            throws MissingResourceException, UnsupportedOperationException {
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key, Locale locale) {
        return getMessage(d, key, locale, (String[]) null);
    }
@@ -156,7 +154,7 @@
     *             {@link TopCfgDefn}.
     */
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key, Locale locale,
            String... args) throws MissingResourceException, UnsupportedOperationException {
        String... args) {
        ResourceBundle resource = getResourceBundle(d, locale);
        // TODO: use message framework directly
@@ -185,8 +183,7 @@
     *             If the provided managed object definition was the
     *             {@link TopCfgDefn}.
     */
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key, String... args)
            throws MissingResourceException, UnsupportedOperationException {
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key, String... args) {
        return getMessage(d, key, Locale.getDefault(), args);
    }
@@ -265,8 +262,7 @@
    // Retrieve the resource bundle associated with a managed object and
    // locale, lazily loading it if necessary.
    private synchronized ResourceBundle getResourceBundle(AbstractManagedObjectDefinition<?, ?> d, Locale locale)
            throws MissingResourceException, UnsupportedOperationException {
    private synchronized ResourceBundle getResourceBundle(AbstractManagedObjectDefinition<?, ?> d, Locale locale) {
        if (d.isTop()) {
            throw new UnsupportedOperationException("I18n resources are not available for the "
                    + "Top configuration definition");
@@ -285,8 +281,8 @@
        ResourceBundle resourceBundle = map.get(locale);
        if (resourceBundle == null) {
            String baseName = prefix + "." + d.getClass().getName();
            resourceBundle = ResourceBundle.getBundle(baseName, locale, ClassLoaderProvider.getInstance()
                    .getClassLoader());
            resourceBundle =
                ResourceBundle.getBundle(baseName, locale, ClassLoaderProvider.getInstance().getClassLoader());
            map.put(locale, resourceBundle);
        }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectDefinitionResource.java
@@ -26,8 +26,6 @@
package org.opends.server.admin;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -36,25 +34,20 @@
import java.util.MissingResourceException;
import java.util.Properties;
/**
 * A class for retrieving non-internationalized resource properties
 * associated with a managed object definition.
 * A class for retrieving non-internationalized resource properties associated
 * with a managed object definition.
 * <p>
 * Resource properties are not available for the {@link TopCfgDefn}.
 */
public final class ManagedObjectDefinitionResource {
  // Mapping from definition to property tables.
  private final Map<AbstractManagedObjectDefinition<?, ?>,
      Properties> properties;
    private final Map<AbstractManagedObjectDefinition<?, ?>, Properties> properties;
  // The resource name prefix.
  private final String prefix;
  /**
   * Creates a new resource instance for the named profile.
   *
@@ -62,23 +55,16 @@
   *          The name of the profile.
   * @return Returns the resource instance for the named profile.
   */
  public static ManagedObjectDefinitionResource createForProfile(
      String profile) {
    return new ManagedObjectDefinitionResource("admin.profiles."
        + profile);
    public static ManagedObjectDefinitionResource createForProfile(String profile) {
        return new ManagedObjectDefinitionResource("admin.profiles." + profile);
  }
  // Private constructor.
  private ManagedObjectDefinitionResource(String prefix) {
    this.properties =
      new HashMap<AbstractManagedObjectDefinition<?, ?>, Properties>();
        this.properties = new HashMap<AbstractManagedObjectDefinition<?, ?>, Properties>();
    this.prefix = prefix;
  }
  /**
   * Get the resource value associated with the specified key.
   *
@@ -86,19 +72,16 @@
   *          The managed object definition.
   * @param key
   *          The resource key.
   * @return Returns the resource value associated with the specified
   *         key.
     * @return Returns the resource value associated with the specified key.
   * @throws MissingResourceException
   *           If the key was not found.
   * @throws UnsupportedOperationException
   *           If the provided managed object definition was the
   *           {@link TopCfgDefn}.
   */
  public String getString(AbstractManagedObjectDefinition<?, ?> d, String key)
      throws MissingResourceException, UnsupportedOperationException {
    public String getString(AbstractManagedObjectDefinition<?, ?> d, String key) {
    if (d.isTop()) {
      throw new UnsupportedOperationException(
          "Profile resources are not available for the "
            throw new UnsupportedOperationException("Profile resources are not available for the "
              + "Top configuration definition");
    }
@@ -109,41 +92,33 @@
      String baseName = prefix + "." + d.getClass().getName();
      String path = baseName.replace('.', '/') + ".properties";
      throw new MissingResourceException("Can't find resource "
          + path + ", key " + key, baseName, key);
            throw new MissingResourceException("Can't find resource " + path + ", key " + key, baseName, key);
    }
    return result;
  }
  // Retrieve the properties table associated with a managed object,
  // lazily loading it if necessary.
  private synchronized Properties getProperties(
      AbstractManagedObjectDefinition<?, ?> d)
      throws MissingResourceException {
    private synchronized Properties getProperties(AbstractManagedObjectDefinition<?, ?> d) {
    Properties p = properties.get(d);
    if (p == null) {
      // Load the resource file.
      String baseName = prefix + "." + d.getClass().getName();
      String path = baseName.replace('.', '/') + ".properties";
      InputStream stream = ClassLoaderProvider.getInstance()
          .getClassLoader().getResourceAsStream(path);
            InputStream stream = ClassLoaderProvider.getInstance().getClassLoader().getResourceAsStream(path);
      if (stream == null) {
        throw new MissingResourceException("Can't find resource "
            + path, baseName, "");
                throw new MissingResourceException("Can't find resource " + path, baseName, "");
      }
      p = new Properties();
      try {
        p.load(new BufferedInputStream(stream));
      } catch (IOException e) {
        throw new MissingResourceException("Can't load resource "
            + path + " due to IO exception: " + e.getMessage(),
            baseName, "");
                throw new MissingResourceException("Can't load resource " + path + " due to IO exception: "
                    + e.getMessage(), baseName, "");
      }
      // Cache the resource.
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectNotFoundException.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
import static com.forgerock.opendj.ldap.AdminMessages.*;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectOption.java
@@ -26,23 +26,21 @@
package org.opends.server.admin;
/**
 * This enumeration contains various options that can be associated
 * with managed object definitions.
 * This enumeration contains various options that can be associated with managed
 * object definitions.
 */
public enum ManagedObjectOption {
  /**
   * Use this option to identify managed object types which should be
   * considered as advanced and should not be exposed by default in
   * client applications.
     * considered as advanced and should not be exposed by default in client
     * applications.
   */
  ADVANCED,
  /**
   * Use this option to identify managed object types which must not
   * be directly exposed in client applications.
     * Use this option to identify managed object types which must not be
     * directly exposed in client applications.
   */
  HIDDEN;
}
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectPath.java
@@ -336,7 +336,8 @@
    /**
     * A path element representing an set managed object.
     */
    private static final class SetElement<C extends ConfigurationClient, S extends Configuration> extends Element<C, S> {
    private static final class SetElement<C extends ConfigurationClient, S extends Configuration> extends
        Element<C, S> {
        // Factory method.
        private static final <C extends ConfigurationClient, S extends Configuration> SetElement<C, S> create(
@@ -475,8 +476,9 @@
    }
    // Single instance of a root path.
    private static final ManagedObjectPath<RootCfgClient, RootCfg> EMPTY_PATH = new ManagedObjectPath<RootCfgClient, RootCfg>(
            new LinkedList<Element<?, ?>>(), null, RootCfgDefn.getInstance());
    private static final ManagedObjectPath<RootCfgClient, RootCfg> EMPTY_PATH =
        new ManagedObjectPath<RootCfgClient, RootCfg>(new LinkedList<Element<?, ?>>(), null,
            RootCfgDefn.getInstance());
    // A regular expression used to parse path elements.
    private static final Pattern PE_REGEXP = Pattern.compile("^\\s*relation=\\s*([^+]+)\\s*"
@@ -502,7 +504,7 @@
     * @throws IllegalArgumentException
     *             If the string could not be parsed.
     */
    public static ManagedObjectPath<?, ?> valueOf(String s) throws IllegalArgumentException {
    public static ManagedObjectPath<?, ?> valueOf(String s) {
        String ns = s.trim();
        // Check for root special case.
@@ -595,6 +597,7 @@
    }
    // Decode an element.
    // @Checkstyle:ignore
    private static <C extends ConfigurationClient, S extends Configuration> Element<? extends C, ? extends S> createElement(
            RelationDefinition<C, S> r, String path, String element, String type, String name) {
        // First determine the managed object definition.
@@ -681,10 +684,10 @@
     * path except that the final path element is associated with the specified
     * managed object definition.
     *
     * @param <CC>
     * @param <C1>
     *            The type of client managed object configuration that this path
     *            will reference.
     * @param <SS>
     * @param <S1>
     *            The type of server managed object configuration that this path
     *            will reference.
     * @param nd
@@ -693,10 +696,11 @@
     *         this path except that the final path element is associated with
     *         the specified managed object definition.
     */
    @SuppressWarnings("unchecked")
    public <CC extends C, SS extends S> ManagedObjectPath<CC, SS> asSubType(AbstractManagedObjectDefinition<CC, SS> nd) {
    // @Checkstyle:ignore
    public <C1 extends C, S1 extends S> ManagedObjectPath<C1, S1> asSubType(AbstractManagedObjectDefinition<C1, S1> nd) {
        if (r instanceof InstantiableRelationDefinition) {
            InstantiableRelationDefinition<? super C, ? super S> ir = (InstantiableRelationDefinition<? super C, ? super S>) r;
            InstantiableRelationDefinition<? super C, ? super S> ir =
                (InstantiableRelationDefinition<? super C, ? super S>) r;
            if (elements.size() == 0) {
                return parent().child(ir, nd, "null");
            } else {
@@ -706,10 +710,12 @@
            SetRelationDefinition<? super C, ? super S> sr = (SetRelationDefinition<? super C, ? super S>) r;
            return parent().child(sr, nd);
        } else if (r instanceof OptionalRelationDefinition) {
            OptionalRelationDefinition<? super C, ? super S> or = (OptionalRelationDefinition<? super C, ? super S>) r;
            OptionalRelationDefinition<? super C, ? super S> or =
                (OptionalRelationDefinition<? super C, ? super S>) r;
            return parent().child(or, nd);
        } else {
            SingletonRelationDefinition<? super C, ? super S> sr = (SingletonRelationDefinition<? super C, ? super S>) r;
            SingletonRelationDefinition<? super C, ? super S> sr =
                (SingletonRelationDefinition<? super C, ? super S>) r;
            return parent().child(sr, nd);
        }
    }
@@ -737,8 +743,7 @@
     *             If the provided name is empty or blank.
     */
    public <M extends ConfigurationClient, N extends Configuration> ManagedObjectPath<M, N> child(
            InstantiableRelationDefinition<? super M, ? super N> r, AbstractManagedObjectDefinition<M, N> d, String name)
            throws IllegalArgumentException {
        InstantiableRelationDefinition<? super M, ? super N> r, AbstractManagedObjectDefinition<M, N> d, String name) {
        if (name.trim().length() == 0) {
            throw new IllegalArgumentException("Empty or blank managed object names are not allowed");
        }
@@ -767,7 +772,7 @@
     *             If the provided name is empty or blank.
     */
    public <M extends ConfigurationClient, N extends Configuration> ManagedObjectPath<M, N> child(
            InstantiableRelationDefinition<M, N> r, String name) throws IllegalArgumentException {
        InstantiableRelationDefinition<M, N> r, String name) {
        return child(r, r.getChildDefinition(), name);
    }
@@ -882,8 +887,7 @@
     *             If the provided name is empty or blank.
     */
    public <M extends ConfigurationClient, N extends Configuration> ManagedObjectPath<M, N> child(
            SetRelationDefinition<? super M, ? super N> r, AbstractManagedObjectDefinition<M, N> d)
            throws IllegalArgumentException {
        SetRelationDefinition<? super M, ? super N> r, AbstractManagedObjectDefinition<M, N> d) {
        LinkedList<Element<?, ?>> celements = new LinkedList<Element<?, ?>>(elements);
        celements.add(new SetElement<M, N>(r, d));
        return new ManagedObjectPath<M, N>(celements, r, d);
@@ -912,7 +916,7 @@
     *             child definition.
     */
    public <M extends ConfigurationClient, N extends Configuration> ManagedObjectPath<? extends M, ? extends N> child(
            SetRelationDefinition<M, N> r, String name) throws IllegalArgumentException {
        SetRelationDefinition<M, N> r, String name) {
        AbstractManagedObjectDefinition<M, N> d = r.getChildDefinition();
        return child(r, d.getChild(name));
    }
@@ -935,7 +939,7 @@
     *             If the provided name is empty or blank.
     */
    public <M extends ConfigurationClient, N extends Configuration> ManagedObjectPath<M, N> child(
            SetRelationDefinition<M, N> r) throws IllegalArgumentException {
        SetRelationDefinition<M, N> r) {
        return child(r, r.getChildDefinition());
    }
@@ -1044,7 +1048,7 @@
     *             If this path does not have a parent (i.e. it is the empty
     *             path).
     */
    public ManagedObjectPath<?, ?> parent() throws IllegalArgumentException {
    public ManagedObjectPath<?, ?> parent() {
        return parent(1);
    }
@@ -1061,7 +1065,7 @@
     *             If the offset is less than 0, or greater than the number of
     *             path elements in this path.
     */
    public ManagedObjectPath<?, ?> parent(int offset) throws IllegalArgumentException {
    public ManagedObjectPath<?, ?> parent(int offset) {
        if (offset < 0) {
            throw new IllegalArgumentException("Negative offset");
        }
@@ -1080,8 +1084,8 @@
            return emptyPath();
        }
        LinkedList<Element<?, ?>> celements = new LinkedList<Element<?, ?>>(elements.subList(0, elements.size()
                - offset));
        LinkedList<Element<?, ?>> celements =
            new LinkedList<Element<?, ?>>(elements.subList(0, elements.size() - offset));
        return create(celements, celements.getLast());
    }
@@ -1098,14 +1102,14 @@
     *             If this managed object path is empty or if its final path
     *             element does not comprise of an instantiable relation.
     */
    @SuppressWarnings("unchecked")
    public ManagedObjectPath<C, S> rename(String newName) throws IllegalStateException {
    public ManagedObjectPath<C, S> rename(String newName) {
        if (elements.size() == 0) {
            throw new IllegalStateException("Cannot rename an empty path");
        }
        if (r instanceof InstantiableRelationDefinition) {
            InstantiableRelationDefinition<? super C, ? super S> ir = (InstantiableRelationDefinition<? super C, ? super S>) r;
            InstantiableRelationDefinition<? super C, ? super S> ir =
                (InstantiableRelationDefinition<? super C, ? super S>) r;
            return parent().child(ir, d, newName);
        } else {
            throw new IllegalStateException("Not an instantiable relation");
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectPathSerializer.java
@@ -25,34 +25,31 @@
 */
package org.opends.server.admin;
/**
 * A strategy for serializing managed object paths.
 * <p>
 * This interface provides a generic means for serializing managed
 * object paths into application specific forms. For example, a JNDI
 * client would use this interface to construct <code>LdapName</code>
 * objects from a path. Similarly, on the server side, a serialization
 * strategy is used to construct <code>DN</code> instances from a
 * path.
 * This interface provides a generic means for serializing managed object paths
 * into application specific forms. For example, a JNDI client would use this
 * interface to construct <code>LdapName</code> objects from a path. Similarly,
 * on the server side, a serialization strategy is used to construct
 * <code>DN</code> instances from a path.
 * <p>
 * During serialization the serializer is invoked for each element in
 * the managed object path in big-endian order, starting from the root
 * and proceeding down to the leaf element.
 * During serialization the serializer is invoked for each element in the
 * managed object path in big-endian order, starting from the root and
 * proceeding down to the leaf element.
 */
public interface ManagedObjectPathSerializer {
  /**
   * Append a managed object path element identified by an
   * instantiable relation and an instance name.
     * Append a managed object path element identified by an instantiable
     * relation and an instance name.
   *
   * @param <C>
   *          The type of client managed object configuration that
   *          this path element references.
     *            The type of client managed object configuration that this path
     *            element references.
   * @param <S>
   *          The type of server managed object configuration that
   *          this path element references.
     *            The type of server managed object configuration that this path
     *            element references.
   * @param r
   *          The instantiable relation.
   * @param d
@@ -60,75 +57,58 @@
   * @param name
   *          The instance name.
   */
  <C extends ConfigurationClient, S extends Configuration>
      void appendManagedObjectPathElement(
      InstantiableRelationDefinition<? super C, ? super S> r,
      AbstractManagedObjectDefinition<C, S> d, String name);
    <C extends ConfigurationClient, S extends Configuration> void appendManagedObjectPathElement(
        InstantiableRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d, String name);
  /**
   * Append a managed object path element identified by an optional
   * relation.
     * Append a managed object path element identified by an optional relation.
   *
   * @param <C>
   *          The type of client managed object configuration that
   *          this path element references.
     *            The type of client managed object configuration that this path
     *            element references.
   * @param <S>
   *          The type of server managed object configuration that
   *          this path element references.
     *            The type of server managed object configuration that this path
     *            element references.
   * @param r
   *          The optional relation.
   * @param d
   *          The managed object definition.
   */
  <C extends ConfigurationClient, S extends Configuration>
      void appendManagedObjectPathElement(
      OptionalRelationDefinition<? super C, ? super S> r,
      AbstractManagedObjectDefinition<C, S> d);
    <C extends ConfigurationClient, S extends Configuration> void appendManagedObjectPathElement(
        OptionalRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d);
  /**
   * Append a managed object path element identified by a singleton
   * relation.
     * Append a managed object path element identified by a singleton relation.
   *
   * @param <C>
   *          The type of client managed object configuration that
   *          this path element references.
     *            The type of client managed object configuration that this path
     *            element references.
   * @param <S>
   *          The type of server managed object configuration that
   *          this path element references.
     *            The type of server managed object configuration that this path
     *            element references.
   * @param r
   *          The singleton relation.
   * @param d
   *          The managed object definition.
   */
  <C extends ConfigurationClient, S extends Configuration>
      void appendManagedObjectPathElement(
      SingletonRelationDefinition<? super C, ? super S> r,
      AbstractManagedObjectDefinition<C, S> d);
    <C extends ConfigurationClient, S extends Configuration> void appendManagedObjectPathElement(
        SingletonRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d);
  /**
   * Append a managed object path element identified by a
   * set relation.
     * Append a managed object path element identified by a set relation.
   *
   * @param <C>
   *          The type of client managed object configuration that
   *          this path element references.
     *            The type of client managed object configuration that this path
     *            element references.
   * @param <S>
   *          The type of server managed object configuration that
   *          this path element references.
     *            The type of server managed object configuration that this path
     *            element references.
   * @param r
   *          The set relation.
   * @param d
   *          The managed object definition.
   */
  <C extends ConfigurationClient, S extends Configuration>
      void appendManagedObjectPathElement(
      SetRelationDefinition<? super C, ? super S> r,
      AbstractManagedObjectDefinition<C, S> d);
    <C extends ConfigurationClient, S extends Configuration> void appendManagedObjectPathElement(
        SetRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d);
}
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/OptionalRelationDefinition.java
@@ -26,12 +26,24 @@
package org.opends.server.admin;
/**
 * A managed object composite relationship definition which represents a
 * composition of an optional single managed object (i.e. the referenced managed
 * object may or may not be present).
 *
 * @param <C>
 *            The type of client managed object configuration that this relation
 *            definition refers to.
 * @param <S>
 *            The type of server managed object configuration that this relation
 *            definition refers to.
 */
public final class OptionalRelationDefinition<C extends ConfigurationClient, S extends Configuration> extends
    RelationDefinition<C, S> {
/**
 * A managed object composite relationship definition which represents
 * a composition of an optional single managed object (i.e. the
 * referenced managed object may or may not be present).
     * An interface for incrementally constructing optional relation
     * definitions.
 *
 * @param <C>
 *          The type of client managed object configuration that this
@@ -40,35 +52,16 @@
 *          The type of server managed object configuration that this
 *          relation definition refers to.
 */
public final class OptionalRelationDefinition
    <C extends ConfigurationClient, S extends Configuration>
    extends RelationDefinition<C, S> {
  /**
   * An interface for incrementally constructing optional relation
   * definitions.
   *
   * @param <C>
   *          The type of client managed object configuration that
   *          this relation definition refers to.
   * @param <S>
   *          The type of server managed object configuration that
   *          this relation definition refers to.
   */
  public static final class Builder
      <C extends ConfigurationClient, S extends Configuration>
      extends AbstractBuilder<C, S, OptionalRelationDefinition<C, S>> {
    public static final class Builder<C extends ConfigurationClient, S extends Configuration> extends
        AbstractBuilder<C, S, OptionalRelationDefinition<C, S>> {
    // The optional default managed object associated with this
    // optional relation.
    private DefaultManagedObject<? extends C, ? extends S>
      defaultManagedObject = null;
        private DefaultManagedObject<? extends C, ? extends S> defaultManagedObject = null;
    /**
     * Creates a new builder which can be used to incrementally build
     * an optional relation definition.
         * Creates a new builder which can be used to incrementally build an
         * optional relation definition.
     *
     * @param pd
     *          The parent managed object definition.
@@ -77,48 +70,37 @@
     * @param cd
     *          The child managed object definition.
     */
    public Builder(AbstractManagedObjectDefinition<?, ?> pd, String name,
        AbstractManagedObjectDefinition<C, S> cd) {
        // @Checkstyle:ignore
        public Builder(AbstractManagedObjectDefinition<?, ?> pd, String name, AbstractManagedObjectDefinition<C, S> cd) {
      super(pd, name, cd);
    }
    /**
     * Sets the optional default managed object associated with this
     * optional relation definition.
     *
     * @param defaultManagedObject
     *          The default managed object or <code>null</code> if
     *          there is no default managed object defined for this
     *          relation definition.
         *            The default managed object or <code>null</code> if there
         *            is no default managed object defined for this relation
         *            definition.
     */
    public void setDefaultManagedObject(
        DefaultManagedObject<? extends C, ? extends S> defaultManagedObject) {
        public void setDefaultManagedObject(DefaultManagedObject<? extends C, ? extends S> defaultManagedObject) {
      this.defaultManagedObject = defaultManagedObject;
    }
    /**
     * {@inheritDoc}
     */
    @Override
    protected OptionalRelationDefinition<C, S> buildInstance(
        Common<C, S> common) {
        protected OptionalRelationDefinition<C, S> buildInstance(Common<C, S> common) {
      return new OptionalRelationDefinition<C, S>(common, defaultManagedObject);
    }
  }
  // The optional default managed object associated with this
  // optional relation.
  private final DefaultManagedObject<? extends C, ? extends S>
    defaultManagedObject;
    private final DefaultManagedObject<? extends C, ? extends S> defaultManagedObject;
  // Private constructor.
  private OptionalRelationDefinition(Common<C, S> common,
@@ -127,8 +109,6 @@
    this.defaultManagedObject = defaultManagedObject;
  }
  /**
   * {@inheritDoc}
   */
@@ -137,23 +117,18 @@
    return v.visitOptional(this, p);
  }
  /**
   * Gets the optional default managed object associated with this
   * optional relation definition.
   *
   * @return Returns the default managed object or <code>null</code>
   *         if there is no default managed object defined for this
     * Gets the optional default managed object associated with this optional
   *         relation definition.
     *
     * @return Returns the default managed object or <code>null</code> if there
     *         is no default managed object defined for this relation
     *         definition.
   */
  public DefaultManagedObject<? extends C, ? extends S>
      getDefaultManagedObject() {
    public DefaultManagedObject<? extends C, ? extends S> getDefaultManagedObject() {
    return defaultManagedObject;
  }
  /**
   * {@inheritDoc}
   */
@@ -167,8 +142,6 @@
    builder.append(getChildDefinition().getName());
  }
  /**
   * {@inheritDoc}
   */
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyDefinition.java
@@ -260,7 +260,7 @@
     * @throws ClassCastException
     *             If the provided property value did not have the correct type.
     */
    public final T castValue(Object object) throws ClassCastException {
    public final T castValue(Object object) {
        return theClass.cast(object);
    }
@@ -322,7 +322,7 @@
     * @throws IllegalPropertyValueStringException
     *             If the property value string is invalid.
     */
    public abstract T decodeValue(String value) throws IllegalPropertyValueStringException;
    public abstract T decodeValue(String value);
    /**
     * Encode the provided property value into its string representation.
@@ -336,7 +336,7 @@
     * @throws IllegalPropertyValueException
     *             If the property value is invalid.
     */
    public String encodeValue(T value) throws IllegalPropertyValueException {
    public String encodeValue(T value) {
        Reject.ifNull(value);
        return value.toString();
@@ -521,7 +521,7 @@
     * @throws IllegalPropertyValueException
     *             If the property value is invalid.
     */
    public String normalizeValue(T value) throws IllegalPropertyValueException {
    public String normalizeValue(T value) {
        Reject.ifNull(value);
        return encodeValue(value);
@@ -565,7 +565,7 @@
     * @throws IllegalPropertyValueException
     *             If the property value is invalid.
     */
    public abstract void validateValue(T value) throws IllegalPropertyValueException;
    public abstract void validateValue(T value);
    /**
     * Performs any run-time initialization required by this property
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyDefinitionUsageBuilder.java
@@ -42,7 +42,7 @@
    /**
     * Underlying implementation.
     */
    private class MyPropertyDefinitionVisitor extends PropertyDefinitionVisitor<LocalizableMessage, Void> {
    private final class MyPropertyDefinitionVisitor extends PropertyDefinitionVisitor<LocalizableMessage, Void> {
        // Flag indicating whether detailed syntax information will be
        // generated.
@@ -307,8 +307,7 @@
         * {@inheritDoc}
         */
        @Override
        public <T> LocalizableMessage visitUnknown(PropertyDefinition<T> d, Void p)
                throws UnknownPropertyDefinitionException {
        public <T> LocalizableMessage visitUnknown(PropertyDefinition<T> d, Void p) {
            return LocalizableMessage.raw("?");
        }
    }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyDefinitionVisitor.java
@@ -26,31 +26,27 @@
package org.opends.server.admin;
/**
 * A visitor of property definitions, in the style of the visitor
 * design pattern. Classes implementing this interface can query
 * property definitions in a type-safe manner when the kind of
 * property definition is unknown at compile time. When a visitor is
 * passed to a property definition's accept method, the corresponding
 * visit method most applicable to that property definition is
 * invoked.
 * A visitor of property definitions, in the style of the visitor design
 * pattern. Classes implementing this interface can query property definitions
 * in a type-safe manner when the kind of property definition is unknown at
 * compile time. When a visitor is passed to a property definition's accept
 * method, the corresponding visit method most applicable to that property
 * definition is invoked.
 * <p>
 * Each <code>visitXXX</code> method is provided with a default
 * implementation which calls
 * {@link #visitUnknown(PropertyDefinition, Object)}. Sub-classes can
 * override any or all of the methods to provide their own
 * type-specific behavior.
 * Each <code>visitXXX</code> method is provided with a default implementation
 * which calls {@link #visitUnknown(PropertyDefinition, Object)}. Sub-classes
 * can override any or all of the methods to provide their own type-specific
 * behavior.
 *
 * @param <R>
 *          The return type of this visitor's methods. Use
 *          {@link java.lang.Void} for visitors that do not need to
 *          return results.
 *            {@link java.lang.Void} for visitors that do not need to return
 *            results.
 * @param <P>
 *          The type of the additional parameter to this visitor's
 *          methods. Use {@link java.lang.Void} for visitors that do
 *          not need an additional parameter.
 *            The type of the additional parameter to this visitor's methods.
 *            Use {@link java.lang.Void} for visitors that do not need an
 *            additional parameter.
 */
public abstract class PropertyDefinitionVisitor<R, P> {
@@ -61,8 +57,6 @@
    // No implementation required.
  }
  /**
   * Visit a dseecompat Global ACI property definition.
   *
@@ -76,30 +70,26 @@
    return visitUnknown(pd, p);
  }
  /**
   * Visit an aggregation property definition.
   *
   * @param <C>
   *          The type of client managed object configuration that
   *          this aggregation property definition refers to.
     *            The type of client managed object configuration that this
     *            aggregation property definition refers to.
   * @param <S>
   *          The type of server managed object configuration that
   *          this aggregation property definition refers to.
     *            The type of server managed object configuration that this
     *            aggregation property definition refers to.
   * @param pd
   *          The aggregation property definition to visit.
   * @param p
   *          A visitor specified parameter.
   * @return Returns a visitor specified result.
   */
  public <C extends ConfigurationClient, S extends Configuration>
  R visitAggregation(AggregationPropertyDefinition<C, S> pd, P p) {
    public <C extends ConfigurationClient, S extends Configuration> R visitAggregation(
        AggregationPropertyDefinition<C, S> pd, P p) {
    return visitUnknown(pd, p);
  }
  /**
   * Visit an attribute type property definition.
   *
@@ -113,8 +103,6 @@
    return visitUnknown(pd, p);
  }
  /**
   * Visit a boolean property definition.
   *
@@ -128,8 +116,6 @@
    return visitUnknown(pd, p);
  }
  /**
   * Visit a class property definition.
   *
@@ -143,8 +129,6 @@
    return visitUnknown(pd, p);
  }
  /**
   * Visit a DN property definition.
   *
@@ -158,8 +142,6 @@
    return visitUnknown(pd, p);
  }
  /**
   * Visit a duration property definition.
   *
@@ -173,14 +155,12 @@
    return visitUnknown(pd, p);
  }
  /**
   * Visit an enumeration property definition.
   *
   * @param <E>
   *          The enumeration that should be used for values of the
   *          property definition.
     *            The enumeration that should be used for values of the property
     *            definition.
   * @param pd
   *          The enumeration property definition to visit.
   * @param p
@@ -191,8 +171,6 @@
    return visitUnknown(pd, p);
  }
  /**
   * Visit an integer property definition.
   *
@@ -206,8 +184,6 @@
    return visitUnknown(pd, p);
  }
  /**
   * Visit a IP address property definition.
   *
@@ -221,8 +197,6 @@
    return visitUnknown(pd, p);
  }
  /**
   * Visit a IP address mask property definition.
   *
@@ -236,7 +210,6 @@
    return visitUnknown(pd, p);
  }
  /**
   * Visit a size property definition.
   *
@@ -250,8 +223,6 @@
    return visitUnknown(pd, p);
  }
  /**
   * Visit a string property definition.
   *
@@ -265,17 +236,14 @@
    return visitUnknown(pd, p);
  }
  /**
   * Visit an unknown type of property definition. Implementations of
   * this method can provide default behavior for unknown property
   * definition types.
     * Visit an unknown type of property definition. Implementations of this
     * method can provide default behavior for unknown property definition
     * types.
   * <p>
   * The default implementation of this method throws an
   * {@link UnknownPropertyDefinitionException}. Sub-classes can
   * override this method with their own default behavior.
     * {@link UnknownPropertyDefinitionException}. Sub-classes can override this
     * method with their own default behavior.
   *
   * @param <T>
   *          The type of the underlying property.
@@ -285,11 +253,9 @@
   *          A visitor specified parameter.
   * @return Returns a visitor specified result.
   * @throws UnknownPropertyDefinitionException
   *           Visitor implementations may optionally throw this
   *           exception.
     *             Visitor implementations may optionally throw this exception.
   */
  public <T> R visitUnknown(PropertyDefinition<T> pd, P p)
      throws UnknownPropertyDefinitionException {
    public <T> R visitUnknown(PropertyDefinition<T> pd, P p) {
    throw new UnknownPropertyDefinitionException(pd, p);
  }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyIsMandatoryException.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
import static com.forgerock.opendj.ldap.AdminMessages.*;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyIsReadOnlyException.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
import static com.forgerock.opendj.ldap.AdminMessages.*;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyIsSingleValuedException.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
import static com.forgerock.opendj.ldap.AdminMessages.*;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyNotFoundException.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
import static com.forgerock.opendj.ldap.AdminMessages.*;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyOption.java
@@ -26,23 +26,20 @@
package org.opends.server.admin;
/**
 * This enumeration contains various options that can be associated
 * with property definitions.
 * This enumeration contains various options that can be associated with
 * property definitions.
 */
public enum PropertyOption {
  /**
   * Use this option to identify properties which should be considered
   * as advanced and should not be exposed by default in client
   * applications.
     * Use this option to identify properties which should be considered as
     * advanced and should not be exposed by default in client applications.
   */
  ADVANCED,
  /**
   * Use this option to identify properties which must not be directly
   * exposed in client applications.
     * Use this option to identify properties which must not be directly exposed
     * in client applications.
   */
  HIDDEN,
@@ -57,14 +54,14 @@
  MULTI_VALUED,
  /**
   * Use this option to identify properties which can be initialized
   * once only and are read-only thereafter.
     * Use this option to identify properties which can be initialized once only
     * and are read-only thereafter.
   */
  READ_ONLY,
  /**
   * Use this option to identify properties which are for monitoring
   * purposes only and are generated automatically by the server..
     * Use this option to identify properties which are for monitoring purposes
     * only and are generated automatically by the server..
   */
  MONITORING;
}
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyProvider.java
@@ -26,13 +26,9 @@
package org.opends.server.admin;
import java.util.Collection;
import java.util.Collections;
/**
 * An interface which can be used to initialize the contents of a managed
 * object.
@@ -40,35 +36,32 @@
public interface PropertyProvider {
  /**
   * A property provider which always returns empty property values, indicating
   * default behavior.
     * A property provider which always returns empty property values,
     * indicating default behavior.
   */
  public static final PropertyProvider DEFAULT_PROVIDER =
    new PropertyProvider() {
    public static final PropertyProvider DEFAULT_PROVIDER = new PropertyProvider() {
    /**
     * {@inheritDoc}
     */
    public <T> Collection<T> getPropertyValues(PropertyDefinition<T> d)
        throws IllegalArgumentException {
        public <T> Collection<T> getPropertyValues(PropertyDefinition<T> d) {
      return Collections.<T> emptySet();
    }
  };
  /**
   * Get the property values associated with the specified property definition.
     * Get the property values associated with the specified property
     * definition.
   * <p>
   * Implementations are not required to validate the values that they provide.
   * Specifically:
     * Implementations are not required to validate the values that they
     * provide. Specifically:
   * <ul>
   * <li>they do not need to guarantee that the provided values are valid
   * according to the property's syntax
   * <li>they do not need to provide values for mandatory properties
   * <li>they do not need to ensure that single-valued properties do contain at
   * most one value.
     * <li>they do not need to ensure that single-valued properties do contain
     * at most one value.
   * </ul>
   * The returned set of values is allowed to contain duplicates.
   *
@@ -83,6 +76,5 @@
   *           If this property provider does not recognise the requested
   *           property definition.
   */
  <T> Collection<T> getPropertyValues(PropertyDefinition<T> d)
      throws IllegalArgumentException;
    <T> Collection<T> getPropertyValues(PropertyDefinition<T> d);
}
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/PropertyValueVisitor.java
@@ -26,8 +26,6 @@
package org.opends.server.admin;
import java.net.InetAddress;
import org.forgerock.opendj.ldap.DN;
@@ -35,30 +33,27 @@
import org.opends.server.authorization.dseecompat.Aci;
import org.opends.server.types.AddressMask;
/**
 * A visitor of property values, in the style of the visitor design
 * pattern. Classes implementing this interface can query a property a
 * value and its associated property definition in a type-safe manner
 * when the kind of property value is unknown at compile time. When a
 * visitor is passed to a property definition's accept method, the
 * corresponding visit method most applicable to that property
 * definition is invoked.
 * A visitor of property values, in the style of the visitor design pattern.
 * Classes implementing this interface can query a property a value and its
 * associated property definition in a type-safe manner when the kind of
 * property value is unknown at compile time. When a visitor is passed to a
 * property definition's accept method, the corresponding visit method most
 * applicable to that property definition is invoked.
 * <p>
 * Each <code>visitXXX</code> method is provided with a default
 * implementation which calls
 * {@link #visitUnknown(PropertyDefinition, Object, Object)}.
 * Sub-classes can override any or all of the methods to provide their
 * own type-specific behavior.
 * Each <code>visitXXX</code> method is provided with a default implementation
 * which calls {@link #visitUnknown(PropertyDefinition, Object, Object)}.
 * Sub-classes can override any or all of the methods to provide their own
 * type-specific behavior.
 *
 * @param <R>
 *          The return type of this visitor's methods. Use
 *          {@link java.lang.Void} for visitors that do not need to
 *          return results.
 *            {@link java.lang.Void} for visitors that do not need to return
 *            results.
 * @param <P>
 *          The type of the additional parameter to this visitor's
 *          methods. Use {@link java.lang.Void} for visitors that do
 *          not need an additional parameter.
 *            The type of the additional parameter to this visitor's methods.
 *            Use {@link java.lang.Void} for visitors that do not need an
 *            additional parameter.
 */
public abstract class PropertyValueVisitor<R, P> {
@@ -69,8 +64,6 @@
    // No implementation required.
  }
  /**
   * Visit a dseecompat ACI.
   *
@@ -82,22 +75,19 @@
   *          A visitor specified parameter.
   * @return Returns a visitor specified result.
   */
  public R visitACI(ACIPropertyDefinition pd, Aci v,
      P p) {
    public R visitACI(ACIPropertyDefinition pd, Aci v, P p) {
    return visitUnknown(pd, v, p);
  }
  /**
   * Visit an aggregation property value.
   *
   * @param <C>
   *          The type of client managed object configuration that
   *          this aggregation property definition refers to.
     *            The type of client managed object configuration that this
     *            aggregation property definition refers to.
   * @param <S>
   *          The type of server managed object configuration that
   *          this aggregation property definition refers to.
     *            The type of server managed object configuration that this
     *            aggregation property definition refers to.
   * @param pd
   *          The aggregation property definition to visit.
   * @param v
@@ -106,14 +96,11 @@
   *          A visitor specified parameter.
   * @return Returns a visitor specified result.
   */
  public <C extends ConfigurationClient, S extends Configuration>
  R visitAggregation(
    public <C extends ConfigurationClient, S extends Configuration> R visitAggregation(
      AggregationPropertyDefinition<C, S> pd, String v, P p) {
    return visitUnknown(pd, v, p);
  }
  /**
   * Visit an attribute type.
   *
@@ -125,13 +112,10 @@
   *          A visitor specified parameter.
   * @return Returns a visitor specified result.
   */
  public R visitAttributeType(AttributeTypePropertyDefinition pd,
      AttributeType v, P p) {
    public R visitAttributeType(AttributeTypePropertyDefinition pd, AttributeType v, P p) {
    return visitUnknown(pd, v, p);
  }
  /**
   * Visit a boolean.
   *
@@ -147,8 +131,6 @@
    return visitUnknown(pd, v, p);
  }
  /**
   * Visit a class.
   *
@@ -164,8 +146,6 @@
    return visitUnknown(pd, v, p);
  }
  /**
   * Visit a DN.
   *
@@ -181,8 +161,6 @@
    return visitUnknown(pd, v, p);
  }
  /**
   * Visit a duration.
   *
@@ -198,14 +176,12 @@
    return visitUnknown(pd, v, p);
  }
  /**
   * Visit an enumeration.
   *
   * @param <E>
   *          The enumeration that should be used for values of the
   *          property definition.
     *            The enumeration that should be used for values of the property
     *            definition.
   * @param pd
   *          The enumeration property definition.
   * @param v
@@ -214,13 +190,10 @@
   *          A visitor specified parameter.
   * @return Returns a visitor specified result.
   */
  public <E extends Enum<E>>
  R visitEnum(EnumPropertyDefinition<E> pd, E v, P p) {
    public <E extends Enum<E>> R visitEnum(EnumPropertyDefinition<E> pd, E v, P p) {
    return visitUnknown(pd, v, p);
  }
  /**
   * Visit an integer.
   *
@@ -236,8 +209,6 @@
    return visitUnknown(pd, v, p);
  }
  /**
   * Visit a IP address.
   *
@@ -253,8 +224,6 @@
    return visitUnknown(pd, v, p);
  }
  /**
   * Visit a IP address mask.
   *
@@ -266,12 +235,10 @@
   *          A visitor specified parameter.
   * @return Returns a visitor specified result.
   */
  public R visitIPAddressMask(IPAddressMaskPropertyDefinition pd, AddressMask v,
      P p) {
    public R visitIPAddressMask(IPAddressMaskPropertyDefinition pd, AddressMask v, P p) {
    return visitUnknown(pd, v, p);
  }
  /**
   * Visit a size.
   *
@@ -287,8 +254,6 @@
    return visitUnknown(pd, v, p);
  }
  /**
   * Visit a string.
   *
@@ -304,16 +269,13 @@
    return visitUnknown(pd, v, p);
  }
  /**
   * Visit an unknown type of property value. Implementations of this
   * method can provide default behavior for unknown types of
   * property.
     * Visit an unknown type of property value. Implementations of this method
     * can provide default behavior for unknown types of property.
   * <p>
   * The default implementation of this method throws an
   * {@link UnknownPropertyDefinitionException}. Sub-classes can
   * override this method with their own default behavior.
     * {@link UnknownPropertyDefinitionException}. Sub-classes can override this
     * method with their own default behavior.
   *
   * @param <T>
   *          The type of property value to visit.
@@ -325,11 +287,9 @@
   *          A visitor specified parameter.
   * @return Returns a visitor specified result.
   * @throws UnknownPropertyDefinitionException
   *           Visitor implementations may optionally throw this
   *           exception.
     *             Visitor implementations may optionally throw this exception.
   */
  public <T> R visitUnknown(PropertyDefinition<T> pd, T v, P p)
      throws UnknownPropertyDefinitionException {
    public <T> R visitUnknown(PropertyDefinition<T> pd, T v, P p) {
    throw new UnknownPropertyDefinitionException(pd, p);
  }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/Reference.java
@@ -66,8 +66,7 @@
     *             relation.
     */
    public static <C extends ConfigurationClient, S extends Configuration> Reference<C, S> parseDN(
            ManagedObjectPath<?, ?> path, InstantiableRelationDefinition<C, S> relationDef, String dnAsString)
            throws IllegalArgumentException {
        ManagedObjectPath<?, ?> path, InstantiableRelationDefinition<C, S> relationDef, String dnAsString) {
        AbstractManagedObjectDefinition<?, ?> definition = path.getManagedObjectDefinition();
        RelationDefinition<?, ?> tmp = definition.getRelationDefinition(relationDef.getName());
        if (tmp != relationDef) {
@@ -117,8 +116,7 @@
     *             definition, or if the provided name is empty.
     */
    public static <C extends ConfigurationClient, S extends Configuration> Reference<C, S> parseName(
            ManagedObjectPath<?, ?> p, InstantiableRelationDefinition<C, S> rd, String s)
            throws IllegalArgumentException {
        ManagedObjectPath<?, ?> p, InstantiableRelationDefinition<C, S> rd, String s) {
        // Sanity checks.
        AbstractManagedObjectDefinition<?, ?> d = p.getManagedObjectDefinition();
        RelationDefinition<?, ?> tmp = d.getRelationDefinition(rd.getName());
@@ -145,8 +143,7 @@
    private final InstantiableRelationDefinition<C, S> relation;
    // Private constructor.
    private Reference(ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> relation, String name)
            throws IllegalArgumentException {
    private Reference(ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> relation, String name) {
        this.relation = relation;
        this.name = name;
        this.path = parent.child(relation, name);
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/RelationDefinition.java
@@ -92,7 +92,8 @@
     * @param <D>
     *            The type of relation definition constructed by this builder.
     */
    protected abstract static class AbstractBuilder<C extends ConfigurationClient, S extends Configuration, D extends RelationDefinition<C, S>> {
    protected abstract static class AbstractBuilder<C extends ConfigurationClient, S extends Configuration,
        D extends RelationDefinition<C, S>> {
        // Common fields.
        private final Common<C, S> common;
@@ -169,7 +170,8 @@
        private final AbstractManagedObjectDefinition<?, ?> pd;
        // Private constructor.
        private Common(AbstractManagedObjectDefinition<?, ?> pd, String name, AbstractManagedObjectDefinition<C, S> cd) {
        private Common(AbstractManagedObjectDefinition<?, ?> pd, String name,
            AbstractManagedObjectDefinition<C, S> cd) {
            this.name = name;
            this.pd = pd;
            this.cd = cd;
@@ -240,8 +242,8 @@
    public final LocalizableMessage getDescription(Locale locale) {
        try {
            String property = "relation." + common.name + ".description";
            return ManagedObjectDefinitionI18NResource.getInstance()
                    .getMessage(getParentDefinition(), property, locale);
            return ManagedObjectDefinitionI18NResource.getInstance().getMessage(getParentDefinition(), property,
                locale);
        } catch (MissingResourceException e) {
            return null;
        }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/RelationDefinitionVisitor.java
@@ -26,25 +26,22 @@
package org.opends.server.admin;
/**
 * A visitor of relation definitions, in the style of the visitor
 * design pattern. Classes implementing this interface can query
 * relation definitions in a type-safe manner when the kind of
 * relation definition is unknown at compile time. When a visitor is
 * passed to a relation definition's accept method, the corresponding
 * visit method most applicable to that relation definition is
 * invoked.
 * A visitor of relation definitions, in the style of the visitor design
 * pattern. Classes implementing this interface can query relation definitions
 * in a type-safe manner when the kind of relation definition is unknown at
 * compile time. When a visitor is passed to a relation definition's accept
 * method, the corresponding visit method most applicable to that relation
 * definition is invoked.
 *
 * @param <R>
 *          The return type of this visitor's methods. Use
 *          {@link java.lang.Void} for visitors that do not need to
 *          return results.
 *            {@link java.lang.Void} for visitors that do not need to return
 *            results.
 * @param <P>
 *          The type of the additional parameter to this visitor's
 *          methods. Use {@link java.lang.Void} for visitors that do
 *          not need an additional parameter.
 *            The type of the additional parameter to this visitor's methods.
 *            Use {@link java.lang.Void} for visitors that do not need an
 *            additional parameter.
 */
public interface RelationDefinitionVisitor<R, P> {
@@ -66,8 +63,6 @@
  <C extends ConfigurationClient, S extends Configuration> R visitInstantiable(
      InstantiableRelationDefinition<C, S> rd, P p);
  /**
   * Visit a set relation definition.
   *
@@ -83,10 +78,7 @@
   *          A visitor specified parameter.
   * @return Returns a visitor specified result.
   */
  <C extends ConfigurationClient, S extends Configuration> R visitSet(
      SetRelationDefinition<C, S> rd, P p);
    <C extends ConfigurationClient, S extends Configuration> R visitSet(SetRelationDefinition<C, S> rd, P p);
  /**
   * Visit an optional relation definition.
@@ -103,10 +95,7 @@
   *          A visitor specified parameter.
   * @return Returns a visitor specified result.
   */
  <C extends ConfigurationClient, S extends Configuration> R visitOptional(
      OptionalRelationDefinition<C, S> rd, P p);
    <C extends ConfigurationClient, S extends Configuration> R visitOptional(OptionalRelationDefinition<C, S> rd, P p);
  /**
   * Visit a singleton relation definition.
@@ -123,7 +112,7 @@
   *          A visitor specified parameter.
   * @return Returns a visitor specified result.
   */
  <C extends ConfigurationClient, S extends Configuration> R visitSingleton(
      SingletonRelationDefinition<C, S> rd, P p);
    <C extends ConfigurationClient, S extends Configuration> R visitSingleton(SingletonRelationDefinition<C, S> rd,
        P p);
}
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/RelationOption.java
@@ -26,23 +26,20 @@
package org.opends.server.admin;
/**
 * This enumeration contains various options that can be associated
 * with relation definitions.
 * This enumeration contains various options that can be associated with
 * relation definitions.
 */
public enum RelationOption {
  /**
   * Use this option to identify relations which should be considered
   * as advanced and should not be exposed by default in client
   * applications.
     * Use this option to identify relations which should be considered as
     * advanced and should not be exposed by default in client applications.
   */
  ADVANCED,
  /**
   * Use this option to identify relations which must not be directly
   * exposed in client applications.
     * Use this option to identify relations which must not be directly exposed
     * in client applications.
   */
  HIDDEN;
}
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/RelativeInheritedDefaultBehaviorProvider.java
@@ -25,19 +25,15 @@
 */
package org.opends.server.admin;
/**
 * A default behavior provider which retrieves default values from a
 * parent managed object. 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 parent
 * managed object. 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 RelativeInheritedDefaultBehaviorProvider<T> extends
    DefaultBehaviorProvider<T> {
public final class RelativeInheritedDefaultBehaviorProvider<T> extends DefaultBehaviorProvider<T> {
  // The type of managed object expected at the relative offset.
  private final AbstractManagedObjectDefinition<?, ?> d;
@@ -49,28 +45,25 @@
  // The name of the property containing the inherited default values.
  private final String propertyName;
  /**
   * Create a relative inherited default behavior provider associated
   * with a parent managed object.
     * Create a relative inherited default behavior provider associated with a
     * parent managed object.
   *
   * @param d
   *          The type of parent managed object expected at the
   *          relative location.
     *            The type of parent managed object expected at the relative
     *            location.
   * @param propertyName
   *          The name of the property containing the inherited
   *          default values.
     *            The name of the property containing the inherited default
     *            values.
   * @param offset
   *          The relative location of the parent managed object
   *          (where 0 is the managed object itself, 1 is the parent,
   *          and 2 is the grand-parent).
     *            The relative location of the parent managed object (where 0 is
     *            the managed object itself, 1 is the parent, and 2 is the
     *            grand-parent).
   * @throws IllegalArgumentException
   *           If the offset is less than 0.
   */
  public RelativeInheritedDefaultBehaviorProvider(
      AbstractManagedObjectDefinition<?, ?> d, String propertyName, int offset)
      throws IllegalArgumentException {
    public RelativeInheritedDefaultBehaviorProvider(AbstractManagedObjectDefinition<?, ?> d, String propertyName,
        int offset) {
    // We do not decode the property name now because the property
    // might not have been constructed at this point (e.g. when the
    // offset is 0).
@@ -82,8 +75,6 @@
    this.offset = offset;
  }
  /**
   * {@inheritDoc}
   */
@@ -91,57 +82,47 @@
    return v.visitRelativeInherited(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 d;
  }
  /**
   * 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.
   *
   * @param path
   *          The path of the current managed object from which the
   *          relative path should be determined.
   * @return Returns the absolute path of the managed object
   *         containing the property which has the default values.
     *            The path of the current managed object from which the relative
     *            path should be determined.
     * @return Returns the absolute path of the managed object containing the
     *         property which has the default values.
   */
  public ManagedObjectPath<?, ?> getManagedObjectPath(
      ManagedObjectPath<?, ?> path) {
    public ManagedObjectPath<?, ?> getManagedObjectPath(ManagedObjectPath<?, ?> path) {
    return path.parent(offset);
  }
  /**
   * 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;
  }
  /**
   * Get the relative location of the parent managed object.
   *
   * @return Returns the relative location of the parent managed
   *         object (where 0 is the managed object itself, 1 is the
   *         parent, and 2 is the grand-parent).
     * @return Returns the relative location of the parent managed object (where
     *         0 is the managed object itself, 1 is the parent, and 2 is the
     *         grand-parent).
   */
  public int getRelativeOffset() {
    return offset;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/SetRelationDefinition.java
@@ -67,7 +67,8 @@
        // The optional default managed objects associated with this
        // set relation definition.
        private final Map<String, DefaultManagedObject<? extends C, ? extends S>> defaultManagedObjects = new HashMap<String, DefaultManagedObject<? extends C, ? extends S>>();
        private final Map<String, DefaultManagedObject<? extends C, ? extends S>> defaultManagedObjects =
            new HashMap<String, DefaultManagedObject<? extends C, ? extends S>>();
        /**
         * Creates a new builder which can be used to incrementally build a set
@@ -144,8 +145,7 @@
     *             If there is no default managed object associated with the
     *             provided name.
     */
    public DefaultManagedObject<? extends C, ? extends S> getDefaultManagedObject(String name)
            throws IllegalArgumentException {
    public DefaultManagedObject<? extends C, ? extends S> getDefaultManagedObject(String name) {
        if (!defaultManagedObjects.containsKey(name)) {
            throw new IllegalArgumentException("unrecognized default managed object \"" + name + "\"");
        }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/SingletonRelationDefinition.java
@@ -26,12 +26,24 @@
package org.opends.server.admin;
/**
 * A managed object composite relationship definition which represents a
 * composition of a single managed object (i.e. the managed object must be
 * present).
 *
 * @param <C>
 *            The type of client managed object configuration that this relation
 *            definition refers to.
 * @param <S>
 *            The type of server managed object configuration that this relation
 *            definition refers to.
 */
public final class SingletonRelationDefinition<C extends ConfigurationClient, S extends Configuration> extends
    RelationDefinition<C, S> {
/**
 * A managed object composite relationship definition which represents
 * a composition of a single managed object (i.e. the managed object
 * must be present).
     * An interface for incrementally constructing singleton relation
     * definitions.
 *
 * @param <C>
 *          The type of client managed object configuration that this
@@ -40,35 +52,16 @@
 *          The type of server managed object configuration that this
 *          relation definition refers to.
 */
public final class SingletonRelationDefinition
    <C extends ConfigurationClient, S extends Configuration>
    extends RelationDefinition<C, S> {
  /**
   * An interface for incrementally constructing singleton relation
   * definitions.
   *
   * @param <C>
   *          The type of client managed object configuration that
   *          this relation definition refers to.
   * @param <S>
   *          The type of server managed object configuration that
   *          this relation definition refers to.
   */
  public static final class Builder
      <C extends ConfigurationClient, S extends Configuration>
      extends AbstractBuilder<C, S, SingletonRelationDefinition<C, S>> {
    public static final class Builder<C extends ConfigurationClient, S extends Configuration> extends
        AbstractBuilder<C, S, SingletonRelationDefinition<C, S>> {
    // The optional default managed object associated with this
    // singleton relation.
    private DefaultManagedObject<? extends C, ? extends S>
      defaultManagedObject = null;
        private DefaultManagedObject<? extends C, ? extends S> defaultManagedObject = null;
    /**
     * Creates a new builder which can be used to incrementally build
     * an singleton relation definition.
         * Creates a new builder which can be used to incrementally build an
         * singleton relation definition.
     *
     * @param pd
     *          The parent managed object definition.
@@ -77,49 +70,37 @@
     * @param cd
     *          The child managed object definition.
     */
    public Builder(AbstractManagedObjectDefinition<?, ?> pd, String name,
        AbstractManagedObjectDefinition<C, S> cd) {
        // @Checkstyle:ignore
        public Builder(AbstractManagedObjectDefinition<?, ?> pd, String name, AbstractManagedObjectDefinition<C, S> cd) {
      super(pd, name, cd);
    }
    /**
     * Sets the optional default managed object associated with this
     * singleton relation definition.
     *
     * @param defaultManagedObject
     *          The default managed object or <code>null</code> if
     *          there is no default managed object defined for this
     *          relation definition.
         *            The default managed object or <code>null</code> if there
         *            is no default managed object defined for this relation
         *            definition.
     */
    public void setDefaultManagedObject(
        DefaultManagedObject<? extends C, ? extends S> defaultManagedObject) {
        public void setDefaultManagedObject(DefaultManagedObject<? extends C, ? extends S> defaultManagedObject) {
      this.defaultManagedObject = defaultManagedObject;
    }
    /**
     * {@inheritDoc}
     */
    @Override
    protected SingletonRelationDefinition<C, S> buildInstance(
        Common<C, S> common) {
      return new SingletonRelationDefinition<C, S>(common,
          defaultManagedObject);
        protected SingletonRelationDefinition<C, S> buildInstance(Common<C, S> common) {
            return new SingletonRelationDefinition<C, S>(common, defaultManagedObject);
    }
  }
  // The optional default managed object associated with this
  // singleton relation.
  private final DefaultManagedObject<? extends C, ? extends S>
    defaultManagedObject;
    private final DefaultManagedObject<? extends C, ? extends S> defaultManagedObject;
  // Private constructor.
  private SingletonRelationDefinition(Common<C, S> common,
@@ -128,8 +109,6 @@
    this.defaultManagedObject = defaultManagedObject;
  }
  /**
   * {@inheritDoc}
   */
@@ -138,23 +117,18 @@
    return v.visitSingleton(this, p);
  }
  /**
   * Gets the optional default managed object associated with this
   * singleton relation definition.
   *
   * @return Returns the default managed object or <code>null</code>
   *         if there is no default managed object defined for this
     * Gets the optional default managed object associated with this singleton
   *         relation definition.
     *
     * @return Returns the default managed object or <code>null</code> if there
     *         is no default managed object defined for this relation
     *         definition.
   */
  public DefaultManagedObject<? extends C, ? extends S>
      getDefaultManagedObject() {
    public DefaultManagedObject<? extends C, ? extends S> getDefaultManagedObject() {
    return defaultManagedObject;
  }
  /**
   * {@inheritDoc}
   */
@@ -168,8 +142,6 @@
    builder.append(getChildDefinition().getName());
  }
  /**
   * {@inheritDoc}
   */
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/SizePropertyDefinition.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
import org.forgerock.util.Reject;
@@ -59,7 +58,7 @@
     * An interface for incrementally constructing memory size property
     * definitions.
     */
    public static class Builder extends AbstractBuilder<Long, SizePropertyDefinition> {
    public static final class Builder extends AbstractBuilder<Long, SizePropertyDefinition> {
        // The lower limit of the property value in bytes.
        private long lowerLimit = 0L;
@@ -86,7 +85,7 @@
         *             If a negative lower limit was specified, or if the lower
         *             limit is greater than the upper limit.
         */
        public final void setLowerLimit(long lowerLimit) throws IllegalArgumentException {
        public final void setLowerLimit(long lowerLimit) {
            if (lowerLimit < 0) {
                throw new IllegalArgumentException("Negative lower limit");
            }
@@ -106,7 +105,7 @@
         *             lower limit was specified, or the lower limit is greater
         *             than the upper limit.
         */
        public final void setLowerLimit(String lowerLimit) throws IllegalArgumentException {
        public final void setLowerLimit(String lowerLimit) {
            setLowerLimit(SizeUnit.parseValue(lowerLimit, SizeUnit.BYTES));
        }
@@ -119,7 +118,7 @@
         * @throws IllegalArgumentException
         *             If the lower limit is greater than the upper limit.
         */
        public final void setUpperLimit(Long upperLimit) throws IllegalArgumentException {
        public final void setUpperLimit(Long upperLimit) {
            if (upperLimit != null) {
                if (upperLimit < 0) {
                    throw new IllegalArgumentException("Negative upper limit");
@@ -141,7 +140,7 @@
         *             If the upper limit could not be parsed, or if the lower
         *             limit is greater than the upper limit.
         */
        public final void setUpperLimit(String upperLimit) throws IllegalArgumentException {
        public final void setUpperLimit(String upperLimit) {
            if (upperLimit == null) {
                setUpperLimit((Long) null);
            } else {
@@ -231,7 +230,7 @@
     * {@inheritDoc}
     */
    @Override
    public void validateValue(Long value) throws IllegalPropertyValueException {
    public void validateValue(Long value) {
        Reject.ifNull(value);
        if (!allowUnlimited && value < lowerLimit) {
@@ -251,7 +250,7 @@
     * {@inheritDoc}
     */
    @Override
    public String encodeValue(Long value) throws IllegalPropertyValueException {
    public String encodeValue(Long value) {
        Reject.ifNull(value);
        // Make sure that we correctly encode negative values as "unlimited".
@@ -277,7 +276,7 @@
     * {@inheritDoc}
     */
    @Override
    public Long decodeValue(String value) throws IllegalPropertyValueStringException {
    public Long decodeValue(String value) {
        Reject.ifNull(value);
        // First check for the special "unlimited" value when necessary.
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/SizeUnit.java
@@ -25,15 +25,11 @@
 */
package org.opends.server.admin;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
 * This enumeration defines various memory size units.
 */
@@ -85,26 +81,23 @@
  TERA_BYTES((long) 1000 * 1000 * 1000 * 1000, "tb", "terabytes");
  // A lookup table for resolving a unit from its name.
  private static final Map<String, SizeUnit> nameToUnit;
    private static final Map<String, SizeUnit> NAME_TO_UNIT;
  static {
    nameToUnit = new HashMap<String, SizeUnit>();
        NAME_TO_UNIT = new HashMap<String, SizeUnit>();
    for (SizeUnit unit : SizeUnit.values()) {
      nameToUnit.put(unit.shortName, unit);
      nameToUnit.put(unit.longName, unit);
            NAME_TO_UNIT.put(unit.shortName, unit);
            NAME_TO_UNIT.put(unit.longName, unit);
    }
  }
  /**
   * Gets the best-fit unit for the specified number of bytes. The
   * returned unit will be able to represent the number of bytes using
   * a decimal number comprising of an integer part which is greater
   * than zero. Bigger units are chosen in preference to smaller units
   * and binary units are only returned if they are an exact fit. If
   * the number of bytes is zero then the {@link #BYTES} unit is
   * always returned. For example:
     * Gets the best-fit unit for the specified number of bytes. The returned
     * unit will be able to represent the number of bytes using a decimal number
     * comprising of an integer part which is greater than zero. Bigger units
     * are chosen in preference to smaller units and binary units are only
     * returned if they are an exact fit. If the number of bytes is zero then
     * the {@link #BYTES} unit is always returned. For example:
   *
   * <pre>
   * getBestFitUnit(0)       // BYTES
@@ -123,8 +116,7 @@
   *           If <code>bytes</code> is negative.
   * @see #getBestFitUnitExact(long)
   */
  public static SizeUnit getBestFitUnit(long bytes)
      throws IllegalArgumentException {
    public static SizeUnit getBestFitUnit(long bytes) {
    if (bytes < 0) {
      throw new IllegalArgumentException("negative number of bytes: " + bytes);
    } else if (bytes == 0) {
@@ -133,10 +125,8 @@
    } else {
      // Determine best fit: prefer non-binary units unless binary
      // fits exactly.
      SizeUnit[] nonBinary = new SizeUnit[] { TERA_BYTES, GIGA_BYTES,
          MEGA_BYTES, KILO_BYTES };
      SizeUnit[] binary = new SizeUnit[] { TEBI_BYTES, GIBI_BYTES, MEBI_BYTES,
          KIBI_BYTES };
            SizeUnit[] nonBinary = new SizeUnit[] { TERA_BYTES, GIGA_BYTES, MEGA_BYTES, KILO_BYTES };
            SizeUnit[] binary = new SizeUnit[] { TEBI_BYTES, GIBI_BYTES, MEBI_BYTES, KIBI_BYTES };
      for (int i = 0; i < nonBinary.length; i++) {
        if ((bytes % binary[i].getSize()) == 0) {
@@ -150,14 +140,11 @@
    }
  }
  /**
   * Gets the best-fit unit for the specified number of bytes which
   * can represent the provided value using an integral value. Bigger
   * units are chosen in preference to smaller units. If the number of
   * bytes is zero then the {@link #BYTES} unit is always returned.
   * For example:
     * Gets the best-fit unit for the specified number of bytes which can
     * represent the provided value using an integral value. Bigger units are
     * chosen in preference to smaller units. If the number of bytes is zero
     * then the {@link #BYTES} unit is always returned. For example:
   *
   * <pre>
   * getBestFitUnitExact(0)       // BYTES
@@ -171,14 +158,13 @@
   *
   * @param bytes
   *          The number of bytes.
   * @return Returns the best fit unit can represent the provided
   *         value using an integral value.
     * @return Returns the best fit unit can represent the provided value using
     *         an integral value.
   * @throws IllegalArgumentException
   *           If <code>bytes</code> is negative.
   * @see #getBestFitUnit(long)
   */
  public static SizeUnit getBestFitUnitExact(long bytes)
      throws IllegalArgumentException {
    public static SizeUnit getBestFitUnitExact(long bytes) {
    if (bytes < 0) {
      throw new IllegalArgumentException("negative number of bytes: " + bytes);
    } else if (bytes == 0) {
@@ -186,8 +172,9 @@
      return BYTES;
    } else {
      // Determine best fit.
      SizeUnit[] units = new SizeUnit[] { TEBI_BYTES, TERA_BYTES, GIBI_BYTES,
          GIGA_BYTES, MEBI_BYTES, MEGA_BYTES, KIBI_BYTES, KILO_BYTES };
            SizeUnit[] units =
                new SizeUnit[] { TEBI_BYTES, TERA_BYTES, GIBI_BYTES, GIGA_BYTES, MEBI_BYTES, MEGA_BYTES, KIBI_BYTES,
                    KILO_BYTES };
      for (SizeUnit unit : units) {
        if ((bytes % unit.getSize()) == 0) {
@@ -199,34 +186,28 @@
    }
  }
  /**
   * Get the unit corresponding to the provided unit name.
   *
   * @param s
   *          The name of the unit. Can be the abbreviated or long
   *          name and can contain white space and mixed case
   *          characters.
     *            The name of the unit. Can be the abbreviated or long name and
     *            can contain white space and mixed case characters.
   * @return Returns the unit corresponding to the provided unit name.
   * @throws IllegalArgumentException
   *           If the provided name did not correspond to a known
   *           memory size unit.
     *             If the provided name did not correspond to a known memory
     *             size unit.
   */
  public static SizeUnit getUnit(String s) throws IllegalArgumentException {
    SizeUnit unit = nameToUnit.get(s.trim().toLowerCase());
    public static SizeUnit getUnit(String s) {
        SizeUnit unit = NAME_TO_UNIT.get(s.trim().toLowerCase());
    if (unit == null) {
      throw new IllegalArgumentException("Illegal memory size unit \"" + s
          + "\"");
            throw new IllegalArgumentException("Illegal memory size unit \"" + s + "\"");
    }
    return unit;
  }
  /**
   * Parse the provided size string and return its equivalent size in
   * bytes. The size string must specify the unit e.g. "10kb".
     * Parse the provided size string and return its equivalent size in bytes.
     * The size string must specify the unit e.g. "10kb".
   *
   * @param s
   *          The size string to be parsed.
@@ -234,28 +215,24 @@
   * @throws NumberFormatException
   *           If the provided size string could not be parsed.
   */
  public static long parseValue(String s) throws NumberFormatException {
    public static long parseValue(String s) {
    return parseValue(s, null);
  }
  /**
   * Parse the provided size string and return its equivalent size in
   * bytes.
     * Parse the provided size string and return its equivalent size in bytes.
   *
   * @param s
   *          The size string to be parsed.
   * @param defaultUnit
   *          The default unit to use if there is no unit specified in
   *          the size string, or <code>null</code> if the string
   *          must always contain a unit.
     *            The default unit to use if there is no unit specified in the
     *            size string, or <code>null</code> if the string must always
     *            contain a unit.
   * @return Returns the parsed size in bytes.
   * @throws NumberFormatException
   *           If the provided size string could not be parsed.
   */
  public static long parseValue(String s, SizeUnit defaultUnit)
      throws NumberFormatException {
    public static long parseValue(String s, SizeUnit defaultUnit) {
    // Value must be a floating point number followed by a unit.
    Pattern p = Pattern.compile("^\\s*(\\d+(\\.\\d+)?)\\s*(\\w+)?\\s*$");
    Matcher m = p.matcher(s);
@@ -301,8 +278,6 @@
  // The size of the unit in bytes.
  private final long sz;
  // Private constructor.
  private SizeUnit(long sz, String shortName, String longName) {
    this.sz = sz;
@@ -310,8 +285,6 @@
    this.longName = longName;
  }
  /**
   * Converts the specified size in bytes to this unit.
   *
@@ -323,8 +296,6 @@
    return ((double) amount / sz);
  }
  /**
   * Get the long name of this unit.
   *
@@ -334,8 +305,6 @@
    return longName;
  }
  /**
   * Get the abbreviated name of this unit.
   *
@@ -345,8 +314,6 @@
    return shortName;
  }
  /**
   * Get the number of bytes that this unit represents.
   *
@@ -356,35 +323,27 @@
    return sz;
  }
  /**
   * Converts the specified size in this unit to bytes.
   *
   * @param amount
   *          The size as a quantity of this unit.
   * @return Returns the number of bytes that the size represents.
   *
   * @throws NumberFormatException
   *           If the provided size exceeded long.MAX_VALUE.
   */
  public long toBytes(double amount) throws NumberFormatException {
    public long toBytes(double amount) {
    double value =  sz * amount;
    if (value > Long.MAX_VALUE)
    {
      throw new NumberFormatException
        ("number too big (exceeded long.MAX_VALUE");
        if (value > Long.MAX_VALUE) {
            throw new NumberFormatException("number too big (exceeded long.MAX_VALUE");
    }
    return (long) (value);
  }
  /**
   * {@inheritDoc}
   * <p>
   * This implementation returns the abbreviated name of this size
   * unit.
     * This implementation returns the abbreviated name of this size unit.
   */
  @Override
  public String toString() {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/StringPropertyDefinition.java
@@ -45,7 +45,7 @@
    /**
     * An interface for incrementally constructing string property definitions.
     */
    public static class Builder extends AbstractBuilder<String, StringPropertyDefinition> {
    public static final class Builder extends AbstractBuilder<String, StringPropertyDefinition> {
        // Flag indicating whether values of this property are
        // case-insensitive.
@@ -91,7 +91,7 @@
         *             If the provided regular expression pattern has an invalid
         *             syntax.
         */
        public final void setPattern(String pattern, String patternUsage) throws PatternSyntaxException {
        public final void setPattern(String pattern, String patternUsage) {
            if (pattern == null) {
                this.pattern = null;
                this.patternUsage = null;
@@ -105,8 +105,8 @@
         * {@inheritDoc}
         */
        @Override
        protected StringPropertyDefinition buildInstance(AbstractManagedObjectDefinition<?, ?> d, String propertyName,
                EnumSet<PropertyOption> options, AdministratorAction adminAction,
        protected StringPropertyDefinition buildInstance(AbstractManagedObjectDefinition<?, ?> d,
            String propertyName, EnumSet<PropertyOption> options, AdministratorAction adminAction,
                DefaultBehaviorProvider<String> defaultBehavior) {
            return new StringPropertyDefinition(d, propertyName, options, adminAction, defaultBehavior,
                    isCaseInsensitive, pattern, patternUsage);
@@ -170,7 +170,7 @@
     * {@inheritDoc}
     */
    @Override
    public String decodeValue(String value) throws IllegalPropertyValueStringException {
    public String decodeValue(String value) {
        Reject.ifNull(value);
        try {
@@ -255,7 +255,7 @@
     * {@inheritDoc}
     */
    @Override
    public String normalizeValue(String value) throws IllegalPropertyValueException {
    public String normalizeValue(String value) {
        Reject.ifNull(value);
        if (isCaseInsensitive()) {
@@ -269,7 +269,7 @@
     * {@inheritDoc}
     */
    @Override
    public void validateValue(String value) throws IllegalPropertyValueException {
    public void validateValue(String value) {
        Reject.ifNull(value);
        if (pattern != null) {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/Tag.java
@@ -37,7 +37,6 @@
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.admin.meta.RootCfgDefn;
/**
 * An interface for querying the properties of a tag.
 * <p>
@@ -45,8 +44,8 @@
 */
public final class Tag implements Comparable<Tag> {
    // All the tags.
    private static final Map<String, Tag> tags = new HashMap<String, Tag>();
    /** All the tags. */
    private static final Map<String, Tag> TAGS = new HashMap<String, Tag>();
    /**
     * Defines a new tag with the specified name.
@@ -58,7 +57,7 @@
        Tag tag = new Tag(name);
        // Register the tag.
        tags.put(name, tag);
        TAGS.put(name, tag);
    }
    /**
@@ -70,13 +69,13 @@
     * @throws IllegalArgumentException
     *             If the tag name was not recognized.
     */
    public static Tag valueOf(String name) throws IllegalArgumentException {
    public static Tag valueOf(String name) {
        Reject.ifNull(name);
        // Hack to force initialization of the tag definitions.
        RootCfgDefn.getInstance();
        Tag tag = tags.get(name.toLowerCase());
        Tag tag = TAGS.get(name.toLowerCase());
        if (tag == null) {
            throw new IllegalArgumentException("Unknown tag \"" + name + "\"");
@@ -95,27 +94,23 @@
        // Hack to force initialization of the tag definitions.
        RootCfgDefn.getInstance();
        return Collections.unmodifiableCollection(tags.values());
        return Collections.unmodifiableCollection(TAGS.values());
    }
    // The name of the tag.
    /** The name of the tag. */
    private final String name;
    // Private constructor.
    /** Private constructor. */
    private Tag(String name) {
        this.name = name;
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public final int compareTo(Tag o) {
        return name.compareTo(o.name);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    @Override
    public final boolean equals(Object obj) {
        if (this == obj) {
@@ -165,17 +160,13 @@
        }
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    @Override
    public final int hashCode() {
        return name.hashCode();
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    @Override
    public final String toString() {
        return name;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/UndefinedDefaultBehaviorProvider.java
@@ -25,19 +25,16 @@
 */
package org.opends.server.admin;
/**
 * A default behavior provider which indicates undefined behavior. It should
 * be used by properties which have no default values or behavior as such. For
 * A default behavior provider which indicates undefined behavior. It should be
 * used by properties which have no default values or behavior as such. For
 * example, a description property, when left unset, has no default value and no
 * side-effects.
 *
 * @param <T>
 *          The type of values represented by this provider.
 */
public final class UndefinedDefaultBehaviorProvider<T> extends
    DefaultBehaviorProvider<T> {
public final class UndefinedDefaultBehaviorProvider<T> extends DefaultBehaviorProvider<T> {
  /**
   * Create an undefined default behavior provider.
@@ -46,8 +43,6 @@
    // No implementation required.
  }
  /**
   * {@inheritDoc}
   */
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/UnknownPropertyDefinitionException.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin;
import static com.forgerock.opendj.ldap.AdminMessages.*;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/AdminClientException.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin.client;
import org.forgerock.i18n.LocalizableMessage;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/AuthenticationException.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin.client;
import org.forgerock.i18n.LocalizableMessage;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/AuthenticationNotSupportedException.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin.client;
import org.forgerock.i18n.LocalizableMessage;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ClientConstraintHandler.java
@@ -70,12 +70,8 @@
     *            A list of messages to which error messages should be added.
     * @return Returns <code>true</code> if this constraint is satisfied, or
     *         <code>false</code> if it is not.
     * @throws AuthorizationException
     *             If an authorization failure prevented this constraint from
     *             being evaluated.
     * @throws CommunicationException
     *             If a communications problem prevented this constraint from
     *             being evaluated.
     * @throws ErrorResultException
     *             If an error occurs.
     */
    public boolean isAddAcceptable(ManagementContext context, ManagedObject<?> managedObject,
            Collection<LocalizableMessage> unacceptableReasons) throws ErrorResultException {
@@ -101,12 +97,8 @@
     *            A list of messages to which error messages should be added.
     * @return Returns <code>true</code> if this modify is satisfied, or
     *         <code>false</code> if it is not.
     * @throws AuthorizationException
     *             If an authorization failure prevented this constraint from
     *             being evaluated.
     * @throws CommunicationException
     *             If a communications problem prevented this constraint from
     *             being evaluated.
      * @throws ErrorResultException
     *             If an error occurs.
     */
    public boolean isModifyAcceptable(ManagementContext context, ManagedObject<?> managedObject,
            Collection<LocalizableMessage> unacceptableReasons) throws ErrorResultException {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ConcurrentModificationException.java
@@ -23,22 +23,17 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin.client;
import static com.forgerock.opendj.ldap.AdminMessages.*;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.admin.OperationsException;
/**
 * This exception is thrown when a critical concurrent modification is
 * detected by the client. This may be caused by another client
 * application removing a managed object whilst it is being managed.
 * This exception is thrown when a critical concurrent modification is detected
 * by the client. This may be caused by another client application removing a
 * managed object whilst it is being managed.
 */
public class ConcurrentModificationException extends OperationsException {
@@ -47,21 +42,16 @@
   */
  private static final long serialVersionUID = -1467024486347612820L;
  /**
   * Create a concurrent modification exception with a default
   * message.
     * Create a concurrent modification exception with a default message.
   */
  public ConcurrentModificationException() {
    super(ERR_CONCURRENT_MODIFICATION_EXCEPTION_DEFAULT.get());
  }
  /**
   * Create a concurrent modification exception with a cause and a
   * default message.
     * Create a concurrent modification exception with a cause and a default
     * message.
   *
   * @param cause
   *          The cause.
@@ -70,11 +60,8 @@
    super(ERR_CONCURRENT_MODIFICATION_EXCEPTION_DEFAULT.get(), cause);
  }
  /**
   * Create a concurrent modification exception with a message and
   * cause.
     * Create a concurrent modification exception with a message and cause.
   *
   * @param message
   *          The message.
@@ -85,8 +72,6 @@
    super(message, cause);
  }
  /**
   * Create a concurrent modification exception with a message.
   *
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/IllegalManagedObjectNameException.java
@@ -23,11 +23,8 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin.client;
import static com.forgerock.opendj.ldap.AdminMessages.*;
import org.forgerock.i18n.LocalizableMessage;
@@ -36,16 +33,14 @@
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyDefinitionUsageBuilder;
/**
 * Thrown when an attempt is made to create a new managed object with
 * an illegal name.
 * Thrown when an attempt is made to create a new managed object with an illegal
 * name.
 * <p>
 * This exception can occur when a new managed object is given a name
 * which is either an empty string, a string containing just
 * white-spaces, or a string which is invalid according to the managed
 * object's naming property (if it has one).
 * This exception can occur when a new managed object is given a name which is
 * either an empty string, a string containing just white-spaces, or a string
 * which is invalid according to the managed object's naming property (if it has
 * one).
 */
public class IllegalManagedObjectNameException extends OperationsException {
@@ -54,11 +49,9 @@
   */
  private static final long serialVersionUID = 7491748228684293291L;
  // Create the message
  private static LocalizableMessage createMessage(String illegalName,
      PropertyDefinition<?> namingPropertyDefinition) {
    /** Create the message. */
    // @Checkstyle:ignore
    private static LocalizableMessage createMessage(String illegalName, PropertyDefinition<?> namingPropertyDefinition) {
    if (illegalName.length() == 0) {
      return ERR_ILLEGAL_MANAGED_OBJECT_NAME_EXCEPTION_EMPTY.get();
    } else if (illegalName.trim().length() == 0) {
@@ -67,28 +60,23 @@
      try {
        namingPropertyDefinition.decodeValue(illegalName);
      } catch (IllegalPropertyValueStringException e) {
        PropertyDefinitionUsageBuilder builder =
          new PropertyDefinitionUsageBuilder(true);
        return ERR_ILLEGAL_MANAGED_OBJECT_NAME_EXCEPTION_SYNTAX.get(
            illegalName, namingPropertyDefinition.getName(), builder
                .getUsage(namingPropertyDefinition));
                PropertyDefinitionUsageBuilder builder = new PropertyDefinitionUsageBuilder(true);
                return ERR_ILLEGAL_MANAGED_OBJECT_NAME_EXCEPTION_SYNTAX.get(illegalName,
                    namingPropertyDefinition.getName(), builder.getUsage(namingPropertyDefinition));
      }
    }
    return ERR_ILLEGAL_MANAGED_OBJECT_NAME_EXCEPTION_OTHER.get(illegalName);
  }
  // The illegal name.
    /** The illegal name. */
  private final String illegalName;
  // The naming property definition if applicable.
    /** The naming property definition if applicable. */
  private final PropertyDefinition<?> namingPropertyDefinition;
  /**
   * Create a new illegal name exception and no naming property
   * definition.
     * Create a new illegal name exception and no naming property definition.
   *
   * @param illegalName
   *          The illegal managed object name.
@@ -97,27 +85,21 @@
    this(illegalName, null);
  }
  /**
   * Create a new illegal name exception and a naming property
   * definition.
     * Create a new illegal name exception and a naming property definition.
   *
   * @param illegalName
   *          The illegal managed object name.
   * @param namingPropertyDefinition
   *          The naming property definition.
   */
  public IllegalManagedObjectNameException(String illegalName,
      PropertyDefinition<?> namingPropertyDefinition) {
    public IllegalManagedObjectNameException(String illegalName, PropertyDefinition<?> namingPropertyDefinition) {
    super(createMessage(illegalName, namingPropertyDefinition));
    this.illegalName = illegalName;
    this.namingPropertyDefinition = namingPropertyDefinition;
  }
  /**
   * Get the illegal managed object name.
   *
@@ -127,13 +109,11 @@
    return illegalName;
  }
  /**
   * Get the naming property definition if applicable.
   *
   * @return Returns naming property definition, or <code>null</code>
   *         if none was specified.
     * @return Returns naming property definition, or <code>null</code> if none
     *         was specified.
   */
  public PropertyDefinition<?> getNamingPropertyDefinition() {
    return namingPropertyDefinition;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ManagedObject.java
@@ -34,7 +34,6 @@
import org.opends.server.admin.Configuration;
import org.opends.server.admin.DefaultBehaviorException;
import org.opends.server.admin.DefinitionDecodingException;
import org.opends.server.admin.IllegalPropertyValueException;
import org.opends.server.admin.InstantiableRelationDefinition;
import org.opends.server.admin.ManagedObjectAlreadyExistsException;
import org.opends.server.admin.ManagedObjectDefinition;
@@ -140,7 +139,7 @@
     * @param <S>
     *            The expected type of the child managed object server
     *            configuration.
     * @param <CC>
     * @param <C1>
     *            The actual type of the added managed object configuration
     *            client.
     * @param r
@@ -161,10 +160,9 @@
     *             If the relation definition is not associated with this
     *             managed object's definition.
     */
    <C extends ConfigurationClient, S extends Configuration, CC extends C> ManagedObject<CC> createChild(
            InstantiableRelationDefinition<C, S> r, ManagedObjectDefinition<CC, ? extends S> d, String name,
            Collection<DefaultBehaviorException> exceptions) throws IllegalManagedObjectNameException,
            IllegalArgumentException;
    <C extends ConfigurationClient, S extends Configuration, C1 extends C> ManagedObject<C1> createChild(
            InstantiableRelationDefinition<C, S> r, ManagedObjectDefinition<C1, ? extends S> d, String name,
            Collection<DefaultBehaviorException> exceptions) throws IllegalManagedObjectNameException;
    /**
     * Creates a new child managed object bound to the specified optional
@@ -179,7 +177,7 @@
     * @param <S>
     *            The expected type of the child managed object server
     *            configuration.
     * @param <CC>
     * @param <C1>
     *            The actual type of the added managed object configuration
     *            client.
     * @param r
@@ -196,9 +194,9 @@
     *             If the relation definition is not associated with this
     *             managed object's definition.
     */
    <C extends ConfigurationClient, S extends Configuration, CC extends C> ManagedObject<CC> createChild(
            OptionalRelationDefinition<C, S> r, ManagedObjectDefinition<CC, ? extends S> d,
            Collection<DefaultBehaviorException> exceptions) throws IllegalArgumentException;
    <C extends ConfigurationClient, S extends Configuration, C1 extends C> ManagedObject<C1> createChild(
            OptionalRelationDefinition<C, S> r, ManagedObjectDefinition<C1, ? extends S> d,
            Collection<DefaultBehaviorException> exceptions);
    /**
     * Creates a new child managed object bound to the specified set relation.
@@ -213,7 +211,7 @@
     * @param <S>
     *            The expected type of the child managed object server
     *            configuration.
     * @param <CC>
     * @param <C1>
     *            The actual type of the added managed object configuration
     *            client.
     * @param r
@@ -230,9 +228,9 @@
     *             If the relation definition is not associated with this
     *             managed object's definition.
     */
    <C extends ConfigurationClient, S extends Configuration, CC extends C> ManagedObject<CC> createChild(
            SetRelationDefinition<C, S> r, ManagedObjectDefinition<CC, ? extends S> d,
            Collection<DefaultBehaviorException> exceptions) throws IllegalArgumentException;
    <C extends ConfigurationClient, S extends Configuration, C1 extends C> ManagedObject<C1> createChild(
            SetRelationDefinition<C, S> r, ManagedObjectDefinition<C1, ? extends S> d,
            Collection<DefaultBehaviorException> exceptions);
    /**
     * Retrieves an instantiable child managed object.
@@ -267,7 +265,7 @@
     *             If any other error occurs.
     */
    <C extends ConfigurationClient, S extends Configuration> ManagedObject<? extends C> getChild(
            InstantiableRelationDefinition<C, S> r, String name) throws IllegalArgumentException,
            InstantiableRelationDefinition<C, S> r, String name) throws
            DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException,
            ConcurrentModificationException, ErrorResultException;
@@ -302,7 +300,7 @@
     *             If any other error occurs.
     */
    <C extends ConfigurationClient, S extends Configuration> ManagedObject<? extends C> getChild(
            OptionalRelationDefinition<C, S> r) throws IllegalArgumentException, DefinitionDecodingException,
            OptionalRelationDefinition<C, S> r) throws DefinitionDecodingException,
            ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException,
            ErrorResultException;
@@ -337,7 +335,7 @@
     *             If any other error occurs.
     */
    <C extends ConfigurationClient, S extends Configuration> ManagedObject<? extends C> getChild(
            SingletonRelationDefinition<C, S> r) throws IllegalArgumentException, DefinitionDecodingException,
            SingletonRelationDefinition<C, S> r) throws DefinitionDecodingException,
            ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException,
            ErrorResultException;
@@ -374,7 +372,7 @@
     *             If any other error occurs.
     */
    <C extends ConfigurationClient, S extends Configuration> ManagedObject<? extends C> getChild(
            SetRelationDefinition<C, S> r, String name) throws IllegalArgumentException, DefinitionDecodingException,
            SetRelationDefinition<C, S> r, String name) throws DefinitionDecodingException,
            ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException,
            ErrorResultException;
@@ -405,7 +403,7 @@
     * Gets a mutable copy of the set of default values for the specified
     * property.
     *
     * @param <PD>
     * @param <P>
     *            The type of the property to be retrieved.
     * @param pd
     *            The property to be retrieved.
@@ -415,7 +413,7 @@
     *             If the property definition is not associated with this
     *             managed object's definition.
     */
    <PD> SortedSet<PD> getPropertyDefaultValues(PropertyDefinition<PD> pd) throws IllegalArgumentException;
    <P> SortedSet<P> getPropertyDefaultValues(PropertyDefinition<P> pd);
    /**
     * Gets the effective value of the specified property.
@@ -423,7 +421,7 @@
     * See the class description for more information about how the effective
     * property value is derived.
     *
     * @param <PD>
     * @param <P>
     *            The type of the property to be retrieved.
     * @param pd
     *            The property to be retrieved.
@@ -433,7 +431,7 @@
     *             If the property definition is not associated with this
     *             managed object's definition.
     */
    <PD> PD getPropertyValue(PropertyDefinition<PD> pd) throws IllegalArgumentException;
    <P> P getPropertyValue(PropertyDefinition<P> pd);
    /**
     * Gets a mutable copy of the set of effective values for the specified
@@ -442,7 +440,7 @@
     * See the class description for more information about how the effective
     * property values are derived.
     *
     * @param <PD>
     * @param <P>
     *            The type of the property to be retrieved.
     * @param pd
     *            The property to be retrieved.
@@ -452,7 +450,8 @@
     *             If the property definition is not associated with this
     *             managed object's definition.
     */
    <PD> SortedSet<PD> getPropertyValues(PropertyDefinition<PD> pd) throws IllegalArgumentException;
    @Override
    <P> SortedSet<P> getPropertyValues(PropertyDefinition<P> pd);
    /**
     * Determines whether or not the specified property is set. If the property
@@ -467,7 +466,7 @@
     *             If the property definition is not associated with this
     *             managed object's definition.
     */
    boolean isPropertyPresent(PropertyDefinition<?> pd) throws IllegalArgumentException;
    boolean isPropertyPresent(PropertyDefinition<?> pd);
    /**
     * Determines whether or not the optional managed object associated with the
@@ -483,9 +482,6 @@
     *            The optional relation definition.
     * @return Returns <code>true</code> if the optional managed object exists,
     *         <code>false</code> otherwise.
     * @throws IllegalArgumentException
     *             If the relation definition is not associated with this
     *             managed object's definition.
     * @throws ConcurrentModificationException
     *             If this managed object has been removed from the server by
     *             another client.
@@ -493,7 +489,7 @@
     *             If there is any other error.
     */
    <C extends ConfigurationClient, S extends Configuration> boolean hasChild(OptionalRelationDefinition<C, S> r)
            throws IllegalArgumentException, ConcurrentModificationException, ErrorResultException;
            throws ConcurrentModificationException, ErrorResultException;
    /**
     * Lists the child managed objects associated with the specified
@@ -518,7 +514,7 @@
     *             If any other error occurs.
     */
    <C extends ConfigurationClient, S extends Configuration> String[] listChildren(
            InstantiableRelationDefinition<C, S> r) throws IllegalArgumentException, ConcurrentModificationException,
            InstantiableRelationDefinition<C, S> r) throws ConcurrentModificationException,
            ErrorResultException;
    /**
@@ -538,9 +534,6 @@
     *            The managed object definition.
     * @return Returns the names of the child managed objects which are a
     *         sub-type of the specified managed object definition.
     * @throws IllegalArgumentException
     *             If the relation definition is not associated with this
     *             managed object's definition.
     * @throws ConcurrentModificationException
     *             If this managed object has been removed from the server by
     *             another client.
@@ -549,7 +542,7 @@
     */
    <C extends ConfigurationClient, S extends Configuration> String[] listChildren(
            InstantiableRelationDefinition<C, S> r, AbstractManagedObjectDefinition<? extends C, ? extends S> d)
            throws IllegalArgumentException, ConcurrentModificationException, ErrorResultException;
            throws ConcurrentModificationException, ErrorResultException;
    /**
     * Lists the child managed objects associated with the specified set
@@ -565,9 +558,6 @@
     *            The set relation definition.
     * @return Returns the names of the child managed objects which for set
     *         relations are the definition names of each managed object.
     * @throws IllegalArgumentException
     *             If the relation definition is not associated with this
     *             managed object's definition.
     * @throws ConcurrentModificationException
     *             If this managed object has been removed from the server by
     *             another client.
@@ -575,7 +565,7 @@
     *             If any other error occurs.
     */
    <C extends ConfigurationClient, S extends Configuration> String[] listChildren(SetRelationDefinition<C, S> r)
            throws IllegalArgumentException, ConcurrentModificationException, ErrorResultException;
            throws ConcurrentModificationException, ErrorResultException;
    /**
     * Lists the child managed objects associated with the specified set
@@ -603,7 +593,7 @@
     *             If any other error occurs.
     */
    <C extends ConfigurationClient, S extends Configuration> String[] listChildren(SetRelationDefinition<C, S> r,
            AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws IllegalArgumentException,
            AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws
            ConcurrentModificationException, ErrorResultException;
    /**
@@ -637,7 +627,7 @@
     *             If any other error occurs.
     */
    <C extends ConfigurationClient, S extends Configuration> void removeChild(InstantiableRelationDefinition<C, S> r,
            String name) throws IllegalArgumentException, ManagedObjectNotFoundException, OperationRejectedException,
            String name) throws ManagedObjectNotFoundException, OperationRejectedException,
            ConcurrentModificationException, ErrorResultException;
    /**
@@ -651,9 +641,6 @@
     *            relation definition refers to.
     * @param r
     *            The optional relation definition.
     * @throws IllegalArgumentException
     *             If the relation definition is not associated with this
     *             managed object's definition.
     * @throws ManagedObjectNotFoundException
     *             If the managed object could not be removed because it could
     *             not found on the server.
@@ -669,7 +656,7 @@
     *             If any other error occurs.
     */
    <C extends ConfigurationClient, S extends Configuration> void removeChild(OptionalRelationDefinition<C, S> r)
            throws IllegalArgumentException, ManagedObjectNotFoundException, OperationRejectedException,
            throws ManagedObjectNotFoundException, OperationRejectedException,
            ConcurrentModificationException, ErrorResultException;
    /**
@@ -685,9 +672,6 @@
     *            The set relation definition.
     * @param name
     *            The name of the child managed object to be removed.
     * @throws IllegalArgumentException
     *             If the relation definition is not associated with this
     *             managed object's definition.
     * @throws ManagedObjectNotFoundException
     *             If the managed object could not be removed because it could
     *             not found on the server.
@@ -702,8 +686,8 @@
     * @throws ErrorResultException
     *             If any other error occurs.
     */
    <C extends ConfigurationClient, S extends Configuration> void removeChild(SetRelationDefinition<C, S> r, String name)
            throws IllegalArgumentException, ManagedObjectNotFoundException, OperationRejectedException,
    <C extends ConfigurationClient, S extends Configuration> void removeChild(SetRelationDefinition<C, S> r,
        String name) throws ManagedObjectNotFoundException, OperationRejectedException,
            ConcurrentModificationException, ErrorResultException;
    /**
@@ -711,34 +695,27 @@
     * <p>
     * See the class description for more information regarding pending values.
     *
     * @param <PD>
     * @param <P>
     *            The type of the property to be modified.
     * @param pd
     *            The property to be modified.
     * @param value
     *            The new pending value for the property, or <code>null</code>
     *            if the property should be reset to its default behavior.
     * @throws IllegalPropertyValueException
     *             If the new pending value is deemed to be invalid according to
     *             the property definition.
     * @throws PropertyIsReadOnlyException
     *             If this is not a new managed object and the property is
     *             read-only or for monitoring purposes.
     * @throws PropertyIsMandatoryException
     *             If an attempt was made to remove a mandatory property.
     * @throws IllegalArgumentException
     *             If the specified property definition is not associated with
     *             this managed object.
     */
    <PD> void setPropertyValue(PropertyDefinition<PD> pd, PD value) throws IllegalPropertyValueException,
            PropertyIsReadOnlyException, PropertyIsMandatoryException, IllegalArgumentException;
    <P> void setPropertyValue(PropertyDefinition<P> pd, P value);
    /**
     * Sets a new pending values for the specified property.
     * <p>
     * See the class description for more information regarding pending values.
     *
     * @param <PD>
     * @param <P>
     *            The type of the property to be modified.
     * @param pd
     *            The property to be modified.
@@ -747,9 +724,6 @@
     *            property (an empty set indicates that the property should be
     *            reset to its default behavior). The set will not be referenced
     *            by this managed object.
     * @throws IllegalPropertyValueException
     *             If a new pending value is deemed to be invalid according to
     *             the property definition.
     * @throws PropertyIsSingleValuedException
     *             If an attempt was made to add multiple pending values to a
     *             single-valued property.
@@ -758,12 +732,7 @@
     *             read-only or for monitoring purposes.
     * @throws PropertyIsMandatoryException
     *             If an attempt was made to remove a mandatory property.
     * @throws IllegalArgumentException
     *             If the specified property definition is not associated with
     *             this managed object.
     */
    <PD> void setPropertyValues(PropertyDefinition<PD> pd, Collection<PD> values) throws IllegalPropertyValueException,
            PropertyIsSingleValuedException, PropertyIsReadOnlyException, PropertyIsMandatoryException,
            IllegalArgumentException;
    <P> void setPropertyValues(PropertyDefinition<P> pd, Collection<P> values);
}
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ManagedObjectDecodingException.java
@@ -23,11 +23,8 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin.client;
import static com.forgerock.opendj.ldap.AdminMessages.*;
import java.util.Collection;
@@ -41,11 +38,9 @@
import org.opends.server.admin.ManagedObjectDefinition;
import org.opends.server.admin.PropertyException;
/**
 * The requested managed object was found but one or more of its
 * properties could not be decoded successfully.
 * The requested managed object was found but one or more of its properties
 * could not be decoded successfully.
 */
public class ManagedObjectDecodingException extends DecodingException {
@@ -54,19 +49,16 @@
   */
  private static final long serialVersionUID = -4268510652395945357L;
  // Create the message.
  private static LocalizableMessage createMessage(ManagedObject<?> partialManagedObject,
      Collection<PropertyException> causes) {
    Reject.ifNull(causes);
    Reject.ifFalse(!causes.isEmpty(), "causes should not be empty");
    ManagedObjectDefinition<?, ?> d = partialManagedObject
        .getManagedObjectDefinition();
        ManagedObjectDefinition<?, ?> d = partialManagedObject.getManagedObjectDefinition();
    if (causes.size() == 1) {
      return ERR_MANAGED_OBJECT_DECODING_EXCEPTION_SINGLE.get(d
          .getUserFriendlyName(), causes.iterator().next().getLocalizableMessageObject());
            return ERR_MANAGED_OBJECT_DECODING_EXCEPTION_SINGLE.get(d.getUserFriendlyName(), causes.iterator().next()
                .getLocalizableMessageObject());
    } else {
      LocalizableMessageBuilder builder = new LocalizableMessageBuilder();
@@ -79,8 +71,7 @@
        isFirst = false;
      }
      return ERR_MANAGED_OBJECT_DECODING_EXCEPTION_PLURAL.get(d
          .getUserFriendlyName(), builder.toMessage());
            return ERR_MANAGED_OBJECT_DECODING_EXCEPTION_PLURAL.get(d.getUserFriendlyName(), builder.toMessage());
    }
  }
@@ -90,52 +81,42 @@
  // The partially created managed object.
  private final ManagedObject<?> partialManagedObject;
  /**
   * Create a new property decoding exception.
   *
   * @param partialManagedObject
   *          The partially created managed object containing
   *          properties which were successfully decoded and empty
   *          properties for those which were not (this may include
   *          empty mandatory properties).
     *            The partially created managed object containing properties
     *            which were successfully decoded and empty properties for those
     *            which were not (this may include empty mandatory properties).
   * @param causes
   *          The exception(s) that caused this decoding exception.
   */
  public ManagedObjectDecodingException(ManagedObject<?> partialManagedObject,
      Collection<PropertyException> causes) {
    public ManagedObjectDecodingException(ManagedObject<?> partialManagedObject, Collection<PropertyException> causes) {
    super(createMessage(partialManagedObject, causes));
    this.partialManagedObject = partialManagedObject;
    this.causes = Collections
        .unmodifiableList(new LinkedList<PropertyException>(causes));
        this.causes = Collections.unmodifiableList(new LinkedList<PropertyException>(causes));
  }
  /**
   * Get an unmodifiable collection view of the causes of this
   * exception.
     * Get an unmodifiable collection view of the causes of this exception.
   *
   * @return Returns an unmodifiable collection view of the causes of
   *         this exception.
     * @return Returns an unmodifiable collection view of the causes of this
     *         exception.
   */
  public Collection<PropertyException> getCauses() {
    return causes;
  }
  /**
   * Get the partially created managed object containing properties
   * which were successfully decoded and empty properties for those
   * which were not (this may include empty mandatory properties).
     * Get the partially created managed object containing properties which were
     * successfully decoded and empty properties for those which were not (this
     * may include empty mandatory properties).
   *
   * @return Returns the partially created managed object containing
   *         properties which were successfully decoded and empty
   *         properties for those which were not (this may include
   *         empty mandatory properties).
     *         properties which were successfully decoded and empty properties
     *         for those which were not (this may include empty mandatory
     *         properties).
   */
  public ManagedObject<?> getPartialManagedObject() {
    return partialManagedObject;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ManagementContext.java
@@ -89,7 +89,7 @@
     */
    public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject(
            ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd, String name)
            throws IllegalArgumentException, ManagedObjectNotFoundException, OperationRejectedException,
            throws ManagedObjectNotFoundException, OperationRejectedException,
            ErrorResultException {
        return getDriver().deleteManagedObject(parent, rd, name);
    }
@@ -124,7 +124,7 @@
     *             If any other error occurs.
     */
    public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject(
            ManagedObjectPath<?, ?> parent, OptionalRelationDefinition<C, S> rd) throws IllegalArgumentException,
            ManagedObjectPath<?, ?> parent, OptionalRelationDefinition<C, S> rd) throws
            ManagedObjectNotFoundException, OperationRejectedException, ErrorResultException {
        return getDriver().deleteManagedObject(parent, rd);
    }
@@ -161,7 +161,7 @@
     */
    public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject(
            ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd, String name)
            throws IllegalArgumentException, ManagedObjectNotFoundException, OperationRejectedException,
            throws ManagedObjectNotFoundException, OperationRejectedException,
            ErrorResultException {
        return getDriver().deleteManagedObject(parent, rd, name);
    }
@@ -205,7 +205,7 @@
    /**
     * Gets the effective value of a property in the named managed object.
     *
     * @param <PD>
     * @param <P>
     *            The type of the property to be retrieved.
     * @param path
     *            The path of the managed object containing the property.
@@ -228,10 +228,9 @@
     * @throws ErrorResultException
     *             If any other error occurs.
     */
    public final <PD> PD getPropertyValue(ManagedObjectPath<?, ?> path, PropertyDefinition<PD> pd)
            throws IllegalArgumentException, DefinitionDecodingException, ErrorResultException,
            ManagedObjectNotFoundException, PropertyException {
        Set<PD> values = getPropertyValues(path, pd);
    public final <P> P getPropertyValue(ManagedObjectPath<?, ?> path, PropertyDefinition<P> pd)
            throws DefinitionDecodingException, ErrorResultException, ManagedObjectNotFoundException {
        Set<P> values = getPropertyValues(path, pd);
        if (values.isEmpty()) {
            return null;
        } else {
@@ -242,7 +241,7 @@
    /**
     * Gets the effective values of a property in the named managed object.
     *
     * @param <PD>
     * @param <P>
     *            The type of the property to be retrieved.
     * @param path
     *            The path of the managed object containing the property.
@@ -265,9 +264,8 @@
     * @throws ErrorResultException
     *             If any other error occurs.
     */
    public final <PD> SortedSet<PD> getPropertyValues(ManagedObjectPath<?, ?> path, PropertyDefinition<PD> pd)
            throws IllegalArgumentException, DefinitionDecodingException, ErrorResultException,
            ManagedObjectNotFoundException, PropertyException {
    public final <P> SortedSet<P> getPropertyValues(ManagedObjectPath<?, ?> path, PropertyDefinition<P> pd)
            throws DefinitionDecodingException, ErrorResultException, ManagedObjectNotFoundException {
        return getDriver().getPropertyValues(path, pd);
    }
@@ -316,7 +314,7 @@
     *             If any other error occurs.
     */
    public final <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects(
            ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd) throws IllegalArgumentException,
            ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd) throws
            ManagedObjectNotFoundException, ErrorResultException {
        return listManagedObjects(parent, rd, rd.getChildDefinition());
    }
@@ -349,7 +347,7 @@
     */
    public final <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects(
            ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd,
            AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws IllegalArgumentException,
            AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws
            ManagedObjectNotFoundException, ErrorResultException {
        return getDriver().listManagedObjects(parent, rd, d);
    }
@@ -377,7 +375,7 @@
     *             If any other error occurs.
     */
    public final <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects(
            ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd) throws IllegalArgumentException,
            ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd) throws
            ManagedObjectNotFoundException, ErrorResultException {
        return getDriver().listManagedObjects(parent, rd, rd.getChildDefinition());
    }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/MissingMandatoryPropertiesException.java
@@ -23,11 +23,8 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin.client;
import static com.forgerock.opendj.ldap.AdminMessages.*;
import java.util.ArrayList;
@@ -40,12 +37,9 @@
import org.opends.server.admin.OperationsException;
import org.opends.server.admin.PropertyIsMandatoryException;
/**
 * This exception is thrown when an attempt is made to add or modify a
 * managed object when one or more of its mandatory properties are
 * undefined.
 * This exception is thrown when an attempt is made to add or modify a managed
 * object when one or more of its mandatory properties are undefined.
 */
public class MissingMandatoryPropertiesException extends OperationsException {
@@ -54,17 +48,14 @@
   */
  private static final long serialVersionUID = 6342522125252055588L;
  // Create the message.
  private static LocalizableMessage createMessage(
      Collection<PropertyIsMandatoryException> causes) {
    private static LocalizableMessage createMessage(Collection<PropertyIsMandatoryException> causes) {
    Reject.ifNull(causes);
    Reject.ifFalse(!causes.isEmpty(), "causes should not be empty");
    if (causes.size() == 1) {
      return ERR_MISSING_MANDATORY_PROPERTIES_EXCEPTION_SINGLE.get(causes
          .iterator().next().getPropertyDefinition().getName());
            return ERR_MISSING_MANDATORY_PROPERTIES_EXCEPTION_SINGLE.get(causes.iterator().next()
                .getPropertyDefinition().getName());
    } else {
      LocalizableMessageBuilder builder = new LocalizableMessageBuilder();
@@ -77,8 +68,7 @@
        isFirst = false;
      }
      return ERR_MISSING_MANDATORY_PROPERTIES_EXCEPTION_PLURAL.get(builder
          .toMessage());
            return ERR_MISSING_MANDATORY_PROPERTIES_EXCEPTION_PLURAL.get(builder.toMessage());
    }
  }
@@ -93,11 +83,9 @@
  // exception.
  private final LocalizableMessage ufn;
  /**
   * Creates a new missing mandatory properties exception with the
   * provided causes.
     * Creates a new missing mandatory properties exception with the provided
     * causes.
   *
   * @param ufn
   *          The user friendly name of the component that caused this
@@ -106,8 +94,8 @@
   *          The causes of this exception (must be non-<code>null</code>
   *          and non-empty).
   * @param isCreate
   *          Indicates whether the exception occurred during managed
   *          object creation.
     *            Indicates whether the exception occurred during managed object
     *            creation.
   */
  public MissingMandatoryPropertiesException(LocalizableMessage ufn,
      Collection<PropertyIsMandatoryException> causes, boolean isCreate) {
@@ -118,8 +106,6 @@
    this.isCreate = isCreate;
  }
  /**
   * Gets the first exception that caused this exception.
   *
@@ -130,40 +116,32 @@
    return causes.iterator().next();
  }
  /**
   * Gets an unmodifiable collection view of the causes of this
   * exception.
     * Gets an unmodifiable collection view of the causes of this exception.
   *
   * @return Returns an unmodifiable collection view of the causes of
   *         this exception.
     * @return Returns an unmodifiable collection view of the causes of this
     *         exception.
   */
  public Collection<PropertyIsMandatoryException> getCauses() {
    return Collections.unmodifiableCollection(causes);
  }
  /**
   * Gets the user friendly name of the component that caused this
   * exception.
     * Gets the user friendly name of the component that caused this exception.
   *
   * @return Returns the user friendly name of the component that
   *         caused this exception.
     * @return Returns the user friendly name of the component that caused this
     *         exception.
   */
  public LocalizableMessage getUserFriendlyName() {
    return ufn;
  }
  /**
   * Indicates whether or not this exception was thrown during managed
   * object creation or during modification.
     * Indicates whether or not this exception was thrown during managed object
     * creation or during modification.
   *
   * @return Returns <code>true</code> if this exception was thrown
   *         during managed object creation.
     * @return Returns <code>true</code> if this exception was thrown during
     *         managed object creation.
   */
  public boolean isCreate() {
    return isCreate;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/OperationRejectedException.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin.client;
import static com.forgerock.opendj.ldap.AdminMessages.*;
@@ -141,7 +140,8 @@
     *            The messages describing the constraint violations that
     *            occurred (must be non-<code>null</code> and non-empty).
     */
    public OperationRejectedException(OperationType type, LocalizableMessage ufn, Collection<LocalizableMessage> messages) {
    public OperationRejectedException(OperationType type, LocalizableMessage ufn,
        Collection<LocalizableMessage> messages) {
        super(getDefaultMessage(messages));
        this.messages = new ArrayList<LocalizableMessage>(messages);
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ldap/LDAPDriver.java
@@ -67,7 +67,6 @@
import org.opends.server.admin.Reference;
import org.opends.server.admin.RelationDefinition;
import org.opends.server.admin.SetRelationDefinition;
import org.opends.server.admin.UnknownPropertyDefinitionException;
import org.opends.server.admin.DefinitionDecodingException.Reason;
import org.opends.server.admin.client.ManagedObject;
import org.opends.server.admin.client.ManagedObjectDecodingException;
@@ -89,7 +88,7 @@
        /**
         * Decodes the provided property LDAP value.
         *
         * @param <PD>
         * @param <P>
         *            The type of the property.
         * @param pd
         *            The property definition.
@@ -100,8 +99,7 @@
         *             If the property value could not be decoded because it was
         *             invalid.
         */
        public static <PD> PD decode(PropertyDefinition<PD> pd, Object value)
                throws IllegalPropertyValueStringException {
        public static <P> P decode(PropertyDefinition<P> pd, Object value) {
            String s = String.valueOf(value);
            return pd.castValue(pd.accept(new ValueDecoder(), s));
        }
@@ -131,7 +129,7 @@
         * {@inheritDoc}
         */
        @Override
        public <T> Object visitUnknown(PropertyDefinition<T> d, String p) throws UnknownPropertyDefinitionException {
        public <T> Object visitUnknown(PropertyDefinition<T> d, String p) {
            // By default the property definition's decoder will do.
            return d.decodeValue(p);
        }
@@ -231,9 +229,9 @@
     */
    @SuppressWarnings("unchecked")
    @Override
    public <C extends ConfigurationClient, S extends Configuration, PD> SortedSet<PD> getPropertyValues(
            ManagedObjectPath<C, S> path, PropertyDefinition<PD> propertyDef) throws IllegalArgumentException,
            DefinitionDecodingException, ManagedObjectNotFoundException, ErrorResultException, PropertyException {
    public <C extends ConfigurationClient, S extends Configuration, P> SortedSet<P> getPropertyValues(
        ManagedObjectPath<C, S> path, PropertyDefinition<P> propertyDef) throws DefinitionDecodingException,
        ManagedObjectNotFoundException, ErrorResultException {
        // Check that the requested property is from the definition
        // associated with the path.
        AbstractManagedObjectDefinition<C, S> d = path.getManagedObjectDefinition();
@@ -255,17 +253,17 @@
            // Make sure we use the correct property definition, the
            // provided one might have been overridden in the resolved
            // definition.
            propertyDef = (PropertyDefinition<PD>) objectDef.getPropertyDefinition(propertyDef.getName());
            propertyDef = (PropertyDefinition<P>) objectDef.getPropertyDefinition(propertyDef.getName());
            String attrID = profile.getAttributeName(objectDef, propertyDef);
            SearchResultEntry resultEntry = connection.readEntry(dn, Collections.singleton(attrID));
            Attribute attribute = resultEntry.getAttribute(attrID);
            // Decode the values.
            SortedSet<PD> values = new TreeSet<PD>(propertyDef);
            SortedSet<P> values = new TreeSet<P>(propertyDef);
            if (attribute != null) {
                for (ByteString byteValue : attribute) {
                    PD value = ValueDecoder.decode(propertyDef, byteValue);
                    P value = ValueDecoder.decode(propertyDef, byteValue);
                    values.add(value);
                }
            }
@@ -308,8 +306,8 @@
    @Override
    public <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects(
            ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd,
            AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws IllegalArgumentException,
            ManagedObjectNotFoundException, ErrorResultException {
        AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws ManagedObjectNotFoundException,
        ErrorResultException {
        validateRelationDefinition(parent, rd);
        if (!managedObjectExists(parent)) {
@@ -350,8 +348,8 @@
    @Override
    public <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects(
            ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd,
            AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws IllegalArgumentException,
            ManagedObjectNotFoundException, ErrorResultException {
        AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws ManagedObjectNotFoundException,
        ErrorResultException {
        validateRelationDefinition(parent, rd);
        if (!managedObjectExists(parent)) {
@@ -481,15 +479,15 @@
    }
    // Create a property using the provided string values.
    private <PD> void decodeProperty(PropertySet newProperties, ManagedObjectPath<?, ?> path,
            PropertyDefinition<PD> propertyDef, Attribute attribute) throws PropertyException {
    private <P> void decodeProperty(PropertySet newProperties, ManagedObjectPath<?, ?> path,
        PropertyDefinition<P> propertyDef, Attribute attribute) {
        PropertyException exception = null;
        // Get the property's active values.
        SortedSet<PD> activeValues = new TreeSet<PD>(propertyDef);
        SortedSet<P> activeValues = new TreeSet<P>(propertyDef);
        if (attribute != null) {
            for (ByteString byteValue : attribute) {
                PD value = ValueDecoder.decode(propertyDef, byteValue);
                P value = ValueDecoder.decode(propertyDef, byteValue);
                activeValues.add(value);
            }
        }
@@ -497,13 +495,13 @@
        if (activeValues.size() > 1 && !propertyDef.hasOption(PropertyOption.MULTI_VALUED)) {
            // This exception takes precedence over previous exceptions.
            exception = new PropertyIsSingleValuedException(propertyDef);
            PD value = activeValues.first();
            P value = activeValues.first();
            activeValues.clear();
            activeValues.add(value);
        }
        // Get the property's default values.
        Collection<PD> defaultValues;
        Collection<P> defaultValues;
        try {
            defaultValues = findDefaultValues(path, propertyDef, false);
        } catch (DefaultBehaviorException e) {
@@ -528,8 +526,11 @@
    // Determine the type of managed object associated with the named
    // entry.
    private <C extends ConfigurationClient, S extends Configuration> ManagedObjectDefinition<? extends C, ? extends S> getEntryDefinition(
            AbstractManagedObjectDefinition<C, S> d, DN dn) throws ErrorResultException, DefinitionDecodingException {
    // @Checkstyle:off
    private <C extends ConfigurationClient, S extends Configuration> ManagedObjectDefinition<? extends C, ? extends S>
        getEntryDefinition(AbstractManagedObjectDefinition<C, S> d, DN dn) throws ErrorResultException,
        DefinitionDecodingException {
        // @Checkstyle:on
        SearchResultEntry searchResultEntry = connection.readEntry(dn, Collections.singleton("objectclass"));
        Attribute objectClassAttr = searchResultEntry.getAttribute("objectclass");
@@ -550,6 +551,7 @@
        // Resolve the appropriate sub-type based on the object classes.
        DefinitionResolver resolver = new DefinitionResolver() {
            @Override
            public boolean matches(AbstractManagedObjectDefinition<?, ?> d) {
                String objectClass = profile.getObjectClass(d);
                return objectClasses.contains(objectClass);
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ldap/LDAPManagedObject.java
@@ -54,7 +54,6 @@
import org.opends.server.admin.Reference;
import org.opends.server.admin.RelationDefinition;
import org.opends.server.admin.SetRelationDefinition;
import org.opends.server.admin.UnknownPropertyDefinitionException;
import org.opends.server.admin.client.ConcurrentModificationException;
import org.opends.server.admin.client.ManagedObject;
import org.opends.server.admin.client.OperationRejectedException;
@@ -99,9 +98,8 @@
         * {@inheritDoc}
         */
        @Override
        public <PD> Object visitUnknown(PropertyDefinition<PD> pd, PD v, Void p)
                throws UnknownPropertyDefinitionException {
            return pd.encodeValue(v);
        public <P> Object visitUnknown(PropertyDefinition<P> propertyDef, P value, Void p) {
            return propertyDef.encodeValue(value);
        }
    }
@@ -295,18 +293,18 @@
    }
    // Encode a property into LDAP string values.
    private <PD> void encodeProperty(Attribute attribute, PropertyDefinition<PD> propertyDef) {
    private <P> void encodeProperty(Attribute attribute, PropertyDefinition<P> propertyDef) {
        PropertyValueVisitor<Object, Void> visitor = new ValueEncoder();
        Property<PD> property = getProperty(propertyDef);
        Property<P> property = getProperty(propertyDef);
        if (propertyDef.hasOption(PropertyOption.MANDATORY)) {
            // For mandatory properties we fall-back to the default values
            // if defined which can sometimes be the case e.g when a
            // mandatory property is overridden.
            for (PD value : property.getEffectiveValues()) {
            for (P value : property.getEffectiveValues()) {
                attribute.add(propertyDef.accept(visitor, value, null));
            }
        } else {
            for (PD value : property.getPendingValues()) {
            for (P value : property.getPendingValues()) {
                attribute.add(propertyDef.accept(visitor, value, null));
            }
        }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/ldap/LDAPNameBuilder.java
@@ -126,7 +126,8 @@
     * {@inheritDoc}
     */
    public <C extends ConfigurationClient, S extends Configuration> void appendManagedObjectPathElement(
            InstantiableRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d, String name) {
        InstantiableRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d,
        String name) {
        // Add the RDN sequence representing the relation.
        appendManagedObjectPathElement(r);
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/spi/AbstractManagedObject.java
@@ -42,7 +42,6 @@
import org.opends.server.admin.DefaultBehaviorException;
import org.opends.server.admin.DefaultManagedObject;
import org.opends.server.admin.DefinitionDecodingException;
import org.opends.server.admin.IllegalPropertyValueException;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.InstantiableRelationDefinition;
import org.opends.server.admin.ManagedObjectAlreadyExistsException;
@@ -53,7 +52,6 @@
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyIsMandatoryException;
import org.opends.server.admin.PropertyIsReadOnlyException;
import org.opends.server.admin.PropertyIsSingleValuedException;
import org.opends.server.admin.PropertyOption;
import org.opends.server.admin.RelationDefinition;
import org.opends.server.admin.RelationDefinitionVisitor;
@@ -99,6 +97,7 @@
        /**
         * {@inheritDoc}
         */
        @Override
        public <C extends ConfigurationClient, S extends Configuration> Void visitInstantiable(
                InstantiableRelationDefinition<C, S> rd, Void p) {
            for (String name : rd.getDefaultManagedObjectNames()) {
@@ -119,6 +118,7 @@
        /**
         * {@inheritDoc}
         */
        @Override
        public <C extends ConfigurationClient, S extends Configuration> Void visitOptional(
                OptionalRelationDefinition<C, S> rd, Void p) {
            if (rd.getDefaultManagedObject() != null) {
@@ -133,6 +133,7 @@
        /**
         * {@inheritDoc}
         */
        @Override
        public <C extends ConfigurationClient, S extends Configuration> Void visitSingleton(
                SingletonRelationDefinition<C, S> rd, Void p) {
            // Do nothing - not possible to create singletons
@@ -143,6 +144,7 @@
        /**
         * {@inheritDoc}
         */
        @Override
        public <C extends ConfigurationClient, S extends Configuration> Void visitSet(SetRelationDefinition<C, S> rd,
                Void p) {
            for (String name : rd.getDefaultManagedObjectNames()) {
@@ -202,7 +204,7 @@
        }
        // Set property values.
        private <PD> void setPropertyValues(ManagedObject<?> mo, PropertyDefinition<PD> pd,
        private <P> void setPropertyValues(ManagedObject<?> mo, PropertyDefinition<P> pd,
                DefaultManagedObject<?, ?> dmo) {
            mo.setPropertyValues(pd, dmo.getPropertyValues(pd));
        }
@@ -255,6 +257,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public final void commit() throws ManagedObjectAlreadyExistsException, MissingMandatoryPropertiesException,
            ConcurrentModificationException, OperationRejectedException, ErrorResultException {
        // First make sure all mandatory properties are defined.
@@ -268,7 +271,8 @@
        }
        if (!exceptions.isEmpty()) {
            throw new MissingMandatoryPropertiesException(definition.getUserFriendlyName(), exceptions, !existsOnServer);
            throw new MissingMandatoryPropertiesException(definition.getUserFriendlyName(), exceptions,
                !existsOnServer);
        }
        // Now enforce any constraints.
@@ -326,10 +330,10 @@
    /**
     * {@inheritDoc}
     */
    public final <C extends ConfigurationClient, S extends Configuration, CC extends C> ManagedObject<CC> createChild(
            InstantiableRelationDefinition<C, S> r, ManagedObjectDefinition<CC, ? extends S> d, String name,
            Collection<DefaultBehaviorException> exceptions) throws IllegalManagedObjectNameException,
            IllegalArgumentException {
    @Override
    public final <C extends ConfigurationClient, S extends Configuration, C1 extends C> ManagedObject<C1> createChild(
        InstantiableRelationDefinition<C, S> r, ManagedObjectDefinition<C1, ? extends S> d, String name,
        Collection<DefaultBehaviorException> exceptions) throws IllegalManagedObjectNameException {
        validateRelationDefinition(r);
        // Empty names are not allowed.
@@ -348,40 +352,43 @@
            }
        }
        ManagedObjectPath<CC, ? extends S> childPath = path.child(r, d, name);
        ManagedObjectPath<C1, ? extends S> childPath = path.child(r, d, name);
        return createNewManagedObject(d, childPath, pd, name, exceptions);
    }
    /**
     * {@inheritDoc}
     */
    public final <C extends ConfigurationClient, S extends Configuration, CC extends C> ManagedObject<CC> createChild(
            OptionalRelationDefinition<C, S> r, ManagedObjectDefinition<CC, ? extends S> d,
            Collection<DefaultBehaviorException> exceptions) throws IllegalArgumentException {
    @Override
    public final <C extends ConfigurationClient, S extends Configuration, C1 extends C> ManagedObject<C1> createChild(
        OptionalRelationDefinition<C, S> r, ManagedObjectDefinition<C1, ? extends S> d,
        Collection<DefaultBehaviorException> exceptions) {
        validateRelationDefinition(r);
        ManagedObjectPath<CC, ? extends S> childPath = path.child(r, d);
        ManagedObjectPath<C1, ? extends S> childPath = path.child(r, d);
        return createNewManagedObject(d, childPath, null, null, exceptions);
    }
    /**
     * {@inheritDoc}
     */
    public final <C extends ConfigurationClient, S extends Configuration, CC extends C> ManagedObject<CC> createChild(
            SetRelationDefinition<C, S> r, ManagedObjectDefinition<CC, ? extends S> d,
            Collection<DefaultBehaviorException> exceptions) throws IllegalArgumentException {
    @Override
    public final <C extends ConfigurationClient, S extends Configuration, C1 extends C> ManagedObject<C1> createChild(
        SetRelationDefinition<C, S> r, ManagedObjectDefinition<C1, ? extends S> d,
        Collection<DefaultBehaviorException> exceptions) {
        validateRelationDefinition(r);
        ManagedObjectPath<CC, ? extends S> childPath = path.child(r, d);
        ManagedObjectPath<C1, ? extends S> childPath = path.child(r, d);
        return createNewManagedObject(d, childPath, null, null, exceptions);
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public final <C extends ConfigurationClient, S extends Configuration> ManagedObject<? extends C> getChild(
            InstantiableRelationDefinition<C, S> r, String name) throws IllegalArgumentException,
            DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException,
            ConcurrentModificationException, ErrorResultException {
        InstantiableRelationDefinition<C, S> r, String name) throws DefinitionDecodingException,
        ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException,
        ErrorResultException {
        validateRelationDefinition(r);
        ensureThisManagedObjectExists();
        Driver ctx = getDriver();
@@ -391,10 +398,10 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public final <C extends ConfigurationClient, S extends Configuration> ManagedObject<? extends C> getChild(
            OptionalRelationDefinition<C, S> r) throws IllegalArgumentException, DefinitionDecodingException,
            ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException,
            ErrorResultException {
        OptionalRelationDefinition<C, S> r) throws DefinitionDecodingException, ManagedObjectDecodingException,
        ManagedObjectNotFoundException, ConcurrentModificationException, ErrorResultException {
        validateRelationDefinition(r);
        ensureThisManagedObjectExists();
        Driver ctx = getDriver();
@@ -404,10 +411,10 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public final <C extends ConfigurationClient, S extends Configuration> ManagedObject<? extends C> getChild(
            SingletonRelationDefinition<C, S> r) throws IllegalArgumentException, DefinitionDecodingException,
            ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException,
            ErrorResultException {
        SingletonRelationDefinition<C, S> r) throws DefinitionDecodingException, ManagedObjectDecodingException,
        ManagedObjectNotFoundException, ConcurrentModificationException, ErrorResultException {
        validateRelationDefinition(r);
        ensureThisManagedObjectExists();
        Driver ctx = getDriver();
@@ -417,8 +424,9 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public final <C extends ConfigurationClient, S extends Configuration> ManagedObject<? extends C> getChild(
            SetRelationDefinition<C, S> r, String name) throws IllegalArgumentException, DefinitionDecodingException,
        SetRelationDefinition<C, S> r, String name) throws DefinitionDecodingException,
            ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException,
            ErrorResultException {
        validateRelationDefinition(r);
@@ -442,6 +450,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public final T getConfiguration() {
        return definition.createClientConfiguration(this);
    }
@@ -449,6 +458,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public final ManagedObjectDefinition<T, ? extends Configuration> getManagedObjectDefinition() {
        return definition;
    }
@@ -456,6 +466,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public final ManagedObjectPath<T, ? extends Configuration> getManagedObjectPath() {
        return path;
    }
@@ -463,15 +474,17 @@
    /**
     * {@inheritDoc}
     */
    public final <PD> SortedSet<PD> getPropertyDefaultValues(PropertyDefinition<PD> pd) throws IllegalArgumentException {
        return new TreeSet<PD>(getProperty(pd).getDefaultValues());
    @Override
    public final <P> SortedSet<P> getPropertyDefaultValues(PropertyDefinition<P> pd) {
        return new TreeSet<P>(getProperty(pd).getDefaultValues());
    }
    /**
     * {@inheritDoc}
     */
    public final <PD> PD getPropertyValue(PropertyDefinition<PD> pd) throws IllegalArgumentException {
        Set<PD> values = getProperty(pd).getEffectiveValues();
    @Override
    public final <P> P getPropertyValue(PropertyDefinition<P> pd) {
        Set<P> values = getProperty(pd).getEffectiveValues();
        if (values.isEmpty()) {
            return null;
        } else {
@@ -482,16 +495,17 @@
    /**
     * {@inheritDoc}
     */
    public final <PD> SortedSet<PD> getPropertyValues(PropertyDefinition<PD> pd) throws IllegalArgumentException {
        return new TreeSet<PD>(getProperty(pd).getEffectiveValues());
    @Override
    public final <P> SortedSet<P> getPropertyValues(PropertyDefinition<P> pd) {
        return new TreeSet<P>(getProperty(pd).getEffectiveValues());
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public final <C extends ConfigurationClient, S extends Configuration> boolean hasChild(
            OptionalRelationDefinition<C, S> r) throws IllegalArgumentException, ConcurrentModificationException,
            ErrorResultException {
        OptionalRelationDefinition<C, S> r) throws ConcurrentModificationException, ErrorResultException {
        validateRelationDefinition(r);
        Driver ctx = getDriver();
        try {
@@ -504,25 +518,27 @@
    /**
     * {@inheritDoc}
     */
    public final boolean isPropertyPresent(PropertyDefinition<?> pd) throws IllegalArgumentException {
    @Override
    public final boolean isPropertyPresent(PropertyDefinition<?> pd) {
        return !getProperty(pd).isEmpty();
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public final <C extends ConfigurationClient, S extends Configuration> String[] listChildren(
            InstantiableRelationDefinition<C, S> r) throws IllegalArgumentException, ConcurrentModificationException,
            ErrorResultException {
        InstantiableRelationDefinition<C, S> r) throws ConcurrentModificationException, ErrorResultException {
        return listChildren(r, r.getChildDefinition());
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public final <C extends ConfigurationClient, S extends Configuration> String[] listChildren(
            InstantiableRelationDefinition<C, S> r, AbstractManagedObjectDefinition<? extends C, ? extends S> d)
            throws IllegalArgumentException, ConcurrentModificationException, ErrorResultException {
            throws ConcurrentModificationException, ErrorResultException {
        validateRelationDefinition(r);
        Driver ctx = getDriver();
        try {
@@ -535,18 +551,19 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public final <C extends ConfigurationClient, S extends Configuration> String[] listChildren(
            SetRelationDefinition<C, S> r) throws IllegalArgumentException, ConcurrentModificationException,
            ErrorResultException {
        SetRelationDefinition<C, S> r) throws ConcurrentModificationException, ErrorResultException {
        return listChildren(r, r.getChildDefinition());
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public final <C extends ConfigurationClient, S extends Configuration> String[] listChildren(
            SetRelationDefinition<C, S> r, AbstractManagedObjectDefinition<? extends C, ? extends S> d)
            throws IllegalArgumentException, ConcurrentModificationException, ErrorResultException {
            throws ConcurrentModificationException, ErrorResultException {
        validateRelationDefinition(r);
        Driver ctx = getDriver();
        try {
@@ -559,10 +576,10 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public final <C extends ConfigurationClient, S extends Configuration> void removeChild(
            InstantiableRelationDefinition<C, S> r, String name) throws IllegalArgumentException,
            ManagedObjectNotFoundException, OperationRejectedException, ConcurrentModificationException,
            ErrorResultException {
        InstantiableRelationDefinition<C, S> r, String name) throws ManagedObjectNotFoundException,
        OperationRejectedException, ConcurrentModificationException, ErrorResultException {
        validateRelationDefinition(r);
        Driver ctx = getDriver();
        boolean found;
@@ -581,9 +598,10 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public final <C extends ConfigurationClient, S extends Configuration> void removeChild(
            OptionalRelationDefinition<C, S> r) throws IllegalArgumentException, ManagedObjectNotFoundException,
            OperationRejectedException, ConcurrentModificationException, ErrorResultException {
        OptionalRelationDefinition<C, S> r) throws ManagedObjectNotFoundException, OperationRejectedException,
        ConcurrentModificationException, ErrorResultException {
        validateRelationDefinition(r);
        Driver ctx = getDriver();
        boolean found;
@@ -602,10 +620,10 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public final <C extends ConfigurationClient, S extends Configuration> void removeChild(
            SetRelationDefinition<C, S> r, String name) throws IllegalArgumentException,
            ManagedObjectNotFoundException, OperationRejectedException, ConcurrentModificationException,
            ErrorResultException {
        SetRelationDefinition<C, S> r, String name) throws ManagedObjectNotFoundException,
        OperationRejectedException, ConcurrentModificationException, ErrorResultException {
        validateRelationDefinition(r);
        Driver ctx = getDriver();
        boolean found;
@@ -624,10 +642,10 @@
    /**
     * {@inheritDoc}
     */
    public final <PD> void setPropertyValue(PropertyDefinition<PD> pd, PD value) throws IllegalPropertyValueException,
            PropertyIsReadOnlyException, PropertyIsMandatoryException, IllegalArgumentException {
    @Override
    public final <P> void setPropertyValue(PropertyDefinition<P> pd, P value) {
        if (value == null) {
            setPropertyValues(pd, Collections.<PD> emptySet());
            setPropertyValues(pd, Collections.<P> emptySet());
        } else {
            setPropertyValues(pd, Collections.singleton(value));
        }
@@ -636,9 +654,8 @@
    /**
     * {@inheritDoc}
     */
    public final <PD> void setPropertyValues(PropertyDefinition<PD> pd, Collection<PD> values)
            throws IllegalPropertyValueException, PropertyIsSingleValuedException, PropertyIsReadOnlyException,
            PropertyIsMandatoryException, IllegalArgumentException {
    @Override
    public final <P> void setPropertyValues(PropertyDefinition<P> pd, Collection<P> values) {
        if (pd.hasOption(PropertyOption.MONITORING)) {
            throw new PropertyIsReadOnlyException(pd);
        }
@@ -695,8 +712,8 @@
     * @throws ErrorResultException
     *             If any other error occurs.
     */
    protected abstract void addNewManagedObject() throws ErrorResultException,
            OperationRejectedException, ConcurrentModificationException, ManagedObjectAlreadyExistsException;
    protected abstract void addNewManagedObject() throws ErrorResultException, OperationRejectedException,
        ConcurrentModificationException, ManagedObjectAlreadyExistsException;
    /**
     * Gets the management context driver associated with this managed object.
@@ -720,7 +737,7 @@
    /**
     * Gets the property associated with the specified property definition.
     *
     * @param <PD>
     * @param <P>
     *            The underlying type of the property.
     * @param pd
     *            The Property definition.
@@ -730,7 +747,7 @@
     *             If this property provider does not recognize the requested
     *             property definition.
     */
    protected final <PD> Property<PD> getProperty(PropertyDefinition<PD> pd) throws IllegalArgumentException {
    protected final <P> Property<P> getProperty(PropertyDefinition<P> pd) {
        return properties.getProperty(pd);
    }
@@ -743,12 +760,8 @@
     * @throws OperationRejectedException
     *             If the managed object cannot be added due to some client-side
     *             or server-side constraint which cannot be satisfied.
     * @throws AuthorizationException
     *             If the server refuses to modify this managed object because
     *             the client does not have the correct privileges.
     * @throws CommunicationException
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
     * @throws ErrorResultException
     *             If any other error occurs.
     */
    protected abstract void modifyExistingManagedObject() throws ConcurrentModificationException,
            OperationRejectedException, ErrorResultException;
@@ -779,10 +792,9 @@
    // Creates a new managed object with no active values, just default
    // values.
    private <M extends ConfigurationClient, PD> ManagedObject<M> createNewManagedObject(
            ManagedObjectDefinition<M, ?> d, ManagedObjectPath<M, ?> p,
            PropertyDefinition<PD> namingPropertyDefinition, String name,
            Collection<DefaultBehaviorException> exceptions) {
    private <M extends ConfigurationClient, P> ManagedObject<M> createNewManagedObject(
        ManagedObjectDefinition<M, ?> d, ManagedObjectPath<M, ?> p, PropertyDefinition<P> namingPropertyDefinition,
        String name, Collection<DefaultBehaviorException> exceptions) {
        PropertySet childProperties = new PropertySet();
        for (PropertyDefinition<?> pd : d.getAllPropertyDefinitions()) {
            try {
@@ -797,7 +809,7 @@
        // Set the naming property if there is one.
        if (namingPropertyDefinition != null) {
            PD value = namingPropertyDefinition.decodeValue(name);
            P value = namingPropertyDefinition.decodeValue(name);
            childProperties.setPropertyValues(namingPropertyDefinition, Collections.singleton(value));
        }
@@ -805,15 +817,14 @@
    }
    // Create an empty property.
    private <PD> void createProperty(PropertySet properties, ManagedObjectPath<?, ?> p, PropertyDefinition<PD> pd)
            throws DefaultBehaviorException {
    private <P> void createProperty(PropertySet properties, ManagedObjectPath<?, ?> p, PropertyDefinition<P> pd) {
        try {
            Driver context = getDriver();
            Collection<PD> defaultValues = context.findDefaultValues(p, pd, true);
            properties.addProperty(pd, defaultValues, Collections.<PD> emptySet());
            Collection<P> defaultValues = context.findDefaultValues(p, pd, true);
            properties.addProperty(pd, defaultValues, Collections.<P> emptySet());
        } catch (DefaultBehaviorException e) {
            // Make sure that we have still created the property.
            properties.addProperty(pd, Collections.<PD> emptySet(), Collections.<PD> emptySet());
            properties.addProperty(pd, Collections.<P> emptySet(), Collections.<P> emptySet());
            throw e;
        }
    }
@@ -835,7 +846,7 @@
    // Validate that a relation definition belongs to this managed
    // object.
    private void validateRelationDefinition(RelationDefinition<?, ?> rd) throws IllegalArgumentException {
    private void validateRelationDefinition(RelationDefinition<?, ?> rd) {
        ManagedObjectDefinition<T, ?> d = getManagedObjectDefinition();
        RelationDefinition<?, ?> tmp = d.getRelationDefinition(rd.getName());
        if (tmp != rd) {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/spi/Driver.java
@@ -23,7 +23,6 @@
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 */
package org.opends.server.admin.client.spi;
import java.util.ArrayList;
@@ -81,7 +80,7 @@
     * @param <T>
     *            The type of the property.
     */
    private class DefaultValueFinder<T> implements DefaultBehaviorProviderVisitor<T, Collection<T>, Void> {
    private final class DefaultValueFinder<T> implements DefaultBehaviorProviderVisitor<T, Collection<T>, Void> {
        // Any exception that occurred whilst retrieving inherited default
        // values.
@@ -108,6 +107,7 @@
        /**
         * {@inheritDoc}
         */
        @Override
        public Collection<T> visitAbsoluteInherited(AbsoluteInheritedDefaultBehaviorProvider<T> d, Void p) {
            try {
                return getInheritedProperty(d.getManagedObjectPath(), d.getManagedObjectDefinition(),
@@ -121,6 +121,7 @@
        /**
         * {@inheritDoc}
         */
        @Override
        public Collection<T> visitAlias(AliasDefaultBehaviorProvider<T> d, Void p) {
            return Collections.emptySet();
        }
@@ -128,6 +129,7 @@
        /**
         * {@inheritDoc}
         */
        @Override
        public Collection<T> visitDefined(DefinedDefaultBehaviorProvider<T> d, Void p) {
            Collection<String> stringValues = d.getDefaultValues();
            List<T> values = new ArrayList<T>(stringValues.size());
@@ -147,6 +149,7 @@
        /**
         * {@inheritDoc}
         */
        @Override
        public Collection<T> visitRelativeInherited(RelativeInheritedDefaultBehaviorProvider<T> d, Void p) {
            try {
                return getInheritedProperty(d.getManagedObjectPath(nextPath), d.getManagedObjectDefinition(),
@@ -160,12 +163,13 @@
        /**
         * {@inheritDoc}
         */
        @Override
        public Collection<T> visitUndefined(UndefinedDefaultBehaviorProvider<T> d, Void p) {
            return Collections.emptySet();
        }
        // Find the default values for the next path/property.
        private Collection<T> find(ManagedObjectPath<?, ?> p, PropertyDefinition<T> pd) throws DefaultBehaviorException {
        private Collection<T> find(ManagedObjectPath<?, ?> p, PropertyDefinition<T> pd) {
            this.nextPath = p;
            this.nextProperty = pd;
@@ -185,7 +189,7 @@
        // Get an inherited property value.
        @SuppressWarnings("unchecked")
        private Collection<T> getInheritedProperty(ManagedObjectPath target, AbstractManagedObjectDefinition<?, ?> d,
                String propertyName) throws DefaultBehaviorException {
            String propertyName) {
            // First check that the requested type of managed object
            // corresponds to the path.
            AbstractManagedObjectDefinition<?, ?> supr = target.getManagedObjectDefinition();
@@ -297,8 +301,7 @@
     */
    public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject(
            ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd, String name)
            throws IllegalArgumentException, ManagedObjectNotFoundException, OperationRejectedException,
            ErrorResultException {
            throws ManagedObjectNotFoundException, OperationRejectedException, ErrorResultException {
        validateRelationDefinition(parent, rd);
        ManagedObjectPath<?, ?> child = parent.child(rd, name);
        return doDeleteManagedObject(child);
@@ -334,8 +337,8 @@
     *             If any other error occurs.
     */
    public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject(
            ManagedObjectPath<?, ?> parent, OptionalRelationDefinition<C, S> rd) throws IllegalArgumentException,
            ManagedObjectNotFoundException, OperationRejectedException, ErrorResultException {
        ManagedObjectPath<?, ?> parent, OptionalRelationDefinition<C, S> rd) throws ManagedObjectNotFoundException,
        OperationRejectedException, ErrorResultException {
        validateRelationDefinition(parent, rd);
        ManagedObjectPath<?, ?> child = parent.child(rd);
        return doDeleteManagedObject(child);
@@ -374,8 +377,7 @@
     */
    public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject(
            ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd, String name)
            throws IllegalArgumentException, ManagedObjectNotFoundException, OperationRejectedException,
            ErrorResultException {
            throws ManagedObjectNotFoundException, OperationRejectedException, ErrorResultException {
        validateRelationDefinition(parent, rd);
        ManagedObjectPath<?, ?> child = parent.child(rd, name);
        return doDeleteManagedObject(child);
@@ -406,6 +408,7 @@
     * @throws ErrorResultException
     *             If any other error occurs.
     */
    // @Checkstyle:ignore
    public abstract <C extends ConfigurationClient, S extends Configuration> ManagedObject<? extends C> getManagedObject(
            ManagedObjectPath<C, S> path) throws DefinitionDecodingException, ManagedObjectDecodingException,
            ManagedObjectNotFoundException, ErrorResultException;
@@ -427,7 +430,7 @@
     * @param <S>
     *            The type of server managed object configuration that the path
     *            definition refers to.
     * @param <PD>
     * @param <P>
     *            The type of the property to be retrieved.
     * @param path
     *            The path of the managed object containing the property.
@@ -450,9 +453,9 @@
     * @throws ErrorResultException
     *             If any other error occurs.
     */
    public abstract <C extends ConfigurationClient, S extends Configuration, PD> SortedSet<PD> getPropertyValues(
            ManagedObjectPath<C, S> path, PropertyDefinition<PD> pd) throws IllegalArgumentException,
            DefinitionDecodingException, ManagedObjectNotFoundException, ErrorResultException, PropertyException;
    public abstract <C extends ConfigurationClient, S extends Configuration, P> SortedSet<P> getPropertyValues(
        ManagedObjectPath<C, S> path, PropertyDefinition<P> pd) throws DefinitionDecodingException,
        ManagedObjectNotFoundException, ErrorResultException;
    /**
     * Gets the root configuration managed object associated with this
@@ -491,8 +494,8 @@
     */
    public abstract <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects(
            ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd,
            AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws IllegalArgumentException,
            ManagedObjectNotFoundException, ErrorResultException;
        AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws ManagedObjectNotFoundException,
        ErrorResultException;
    /**
     * Lists the child managed objects of the named parent managed object which
@@ -522,8 +525,8 @@
     */
    public abstract <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects(
            ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd,
            AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws IllegalArgumentException,
            ManagedObjectNotFoundException, ErrorResultException;
        AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws ManagedObjectNotFoundException,
        ErrorResultException;
    /**
     * Determines whether or not the named managed object exists.
@@ -570,7 +573,7 @@
    /**
     * Gets the default values for the specified property.
     *
     * @param <PD>
     * @param <P>
     *            The type of the property.
     * @param p
     *            The managed object path of the current managed object.
@@ -583,9 +586,9 @@
     *             If the default values could not be retrieved or decoded
     *             properly.
     */
    protected final <PD> Collection<PD> findDefaultValues(ManagedObjectPath<?, ?> p, PropertyDefinition<PD> pd,
            boolean isCreate) throws DefaultBehaviorException {
        DefaultValueFinder<PD> v = new DefaultValueFinder<PD>(p, isCreate);
    protected final <P> Collection<P> findDefaultValues(ManagedObjectPath<?, ?> p, PropertyDefinition<P> pd,
        boolean isCreate) {
        DefaultValueFinder<P> v = new DefaultValueFinder<P>(p, isCreate);
        return v.find(p, pd);
    }
@@ -608,8 +611,7 @@
     *             If the relation definition does not belong to the managed
     *             object definition.
     */
    protected final void validateRelationDefinition(ManagedObjectPath<?, ?> path, RelationDefinition<?, ?> rd)
            throws IllegalArgumentException {
    protected final void validateRelationDefinition(ManagedObjectPath<?, ?> path, RelationDefinition<?, ?> rd) {
        AbstractManagedObjectDefinition<?, ?> d = path.getManagedObjectDefinition();
        RelationDefinition<?, ?> tmp = d.getRelationDefinition(rd.getName());
        if (tmp != rd) {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/spi/Property.java
@@ -26,23 +26,19 @@
package org.opends.server.admin.client.spi;
import java.util.SortedSet;
import org.opends.server.admin.PropertyDefinition;
/**
 * A managed object property comprising of the property's definition
 * and its set of values.
 * A managed object property comprising of the property's definition and its set
 * of values.
 * <p>
 * The property stores the values in a sorted set in which values are
 * compared using the comparator defined by the property definition.
 * The property stores the values in a sorted set in which values are compared
 * using the comparator defined by the property definition.
 * <p>
 * The property keeps track of whether or not its pending set of
 * values differs from its active values.
 * The property keeps track of whether or not its pending set of values differs
 * from its active values.
 *
 * @param <T>
 *          The type of the property.
@@ -52,88 +48,70 @@
  /**
   * Get an immutable set view of this property's active values.
   *
   * @return Returns an immutable set view of this property's active
   *         values. An empty set indicates that there are no active
   *         values, and any default values are applicable.
     * @return Returns an immutable set view of this property's active values.
     *         An empty set indicates that there are no active values, and any
     *         default values are applicable.
   */
  SortedSet<T> getActiveValues();
  /**
   * Get an immutable set view of this property's default values.
   *
   * @return Returns an immutable set view of this property's default
   *         values. An empty set indicates that there are no default
   *         values.
     * @return Returns an immutable set view of this property's default values.
     *         An empty set indicates that there are no default values.
   */
  SortedSet<T> getDefaultValues();
  /**
   * Get an immutable set view of this property's effective values.
   *
   * @return Returns an immutable set view of this property's
   *         effective values.
     * @return Returns an immutable set view of this property's effective
     *         values.
   */
  SortedSet<T> getEffectiveValues();
  /**
   * Get an immutable set view of this property's pending values.
   * <p>
   * Immediately after construction, the pending values matches the
   * active values.
     * Immediately after construction, the pending values matches the active
     * values.
   *
   * @return Returns an immutable set view of this property's pending
   *         values. An empty set indicates that there are no pending
   *         values, and any default values are applicable.
     * @return Returns an immutable set view of this property's pending values.
     *         An empty set indicates that there are no pending values, and any
     *         default values are applicable.
   */
  SortedSet<T> getPendingValues();
  /**
   * Get the property definition associated with this property.
   *
   * @return Returns the property definition associated with this
   *         property.
     * @return Returns the property definition associated with this property.
   */
  PropertyDefinition<T> getPropertyDefinition();
  /**
   * Determines whether or not this property contains any pending
   * values.
     * Determines whether or not this property contains any pending values.
   *
   * @return Returns <code>true</code> if this property does not
   *         contain any pending values.
     * @return Returns <code>true</code> if this property does not contain any
     *         pending values.
   */
  boolean isEmpty();
  /**
   * Determines whether or not this property has been modified since
   * it was constructed. In other words, whether or not the set of
   * pending values differs from the set of active values.
     * Determines whether or not this property has been modified since it was
     * constructed. In other words, whether or not the set of pending values
     * differs from the set of active values.
   *
   * @return Returns <code>true</code> if this property has been
   *         modified since it was constructed.
     * @return Returns <code>true</code> if this property has been modified
     *         since it was constructed.
   */
  boolean isModified();
  /**
   * Determines whether or not this property contains any active
   * values.
     * Determines whether or not this property contains any active values.
   *
   * @return Returns <code>true</code> if this property does not
   *         contain any active values.
     * @return Returns <code>true</code> if this property does not contain any
     *         active values.
   */
  boolean wasEmpty();
}
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/spi/PropertySet.java
@@ -26,8 +26,6 @@
package org.opends.server.admin.client.spi;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -41,11 +39,9 @@
import org.opends.server.admin.PropertyIsSingleValuedException;
import org.opends.server.admin.PropertyOption;
/**
 * A set of properties. Instances of this class can be used as the
 * core of a managed object implementation.
 * A set of properties. Instances of this class can be used as the core of a
 * managed object implementation.
 */
public final class PropertySet {
@@ -69,11 +65,9 @@
    // The pending set of values.
    private final SortedSet<T> pendingValues;
    /**
     * Create a property with the provided sets of pre-validated
     * default and active values.
         * Create a property with the provided sets of pre-validated default and
         * active values.
     *
     * @param pd
     *          The property definition.
@@ -82,14 +76,12 @@
     * @param activeValues
     *          The set of active values for the property.
     */
    public MyProperty(PropertyDefinition<T> pd, Collection<T> defaultValues,
        Collection<T> activeValues) {
        public MyProperty(PropertyDefinition<T> pd, Collection<T> defaultValues, Collection<T> activeValues) {
      this.d = pd;
      SortedSet<T> sortedDefaultValues = new TreeSet<T>(pd);
      sortedDefaultValues.addAll(defaultValues);
      this.defaultValues = Collections
          .unmodifiableSortedSet(sortedDefaultValues);
            this.defaultValues = Collections.unmodifiableSortedSet(sortedDefaultValues);
      this.activeValues = new TreeSet<T>(pd);
      this.activeValues.addAll(activeValues);
@@ -99,8 +91,6 @@
      this.pendingValues = new TreeSet<T>(this.activeValues);
    }
    /**
     * Makes the pending values active.
     */
@@ -109,29 +99,26 @@
      activeValues.addAll(pendingValues);
    }
    /**
     * {@inheritDoc}
     */
        @Override
    public SortedSet<T> getActiveValues() {
      return Collections.unmodifiableSortedSet(activeValues);
    }
    /**
     * {@inheritDoc}
     */
        @Override
    public SortedSet<T> getDefaultValues() {
      return defaultValues;
    }
    /**
     * {@inheritDoc}
     */
        @Override
    public SortedSet<T> getEffectiveValues() {
      SortedSet<T> values = getPendingValues();
@@ -142,51 +129,43 @@
      return values;
    }
    /**
     * {@inheritDoc}
     */
        @Override
    public SortedSet<T> getPendingValues() {
      return Collections.unmodifiableSortedSet(pendingValues);
    }
    /**
     * {@inheritDoc}
     */
        @Override
    public PropertyDefinition<T> getPropertyDefinition() {
      return d;
    }
    /**
     * {@inheritDoc}
     */
        @Override
    public boolean isEmpty() {
      return pendingValues.isEmpty();
    }
    /**
     * {@inheritDoc}
     */
        @Override
    public boolean isModified() {
      if (activeValues.size() == pendingValues.size()
          && activeValues.containsAll(pendingValues)) {
            if (activeValues.size() == pendingValues.size() && activeValues.containsAll(pendingValues)) {
        return false;
      }
      return true;
    }
    /**
     * Replace all pending values of this property with the provided
     * values.
         * Replace all pending values of this property with the provided values.
     *
     * @param c
     *          The new set of pending property values.
@@ -196,8 +175,6 @@
      pendingValues.addAll(c);
    }
    /**
     * {@inheritDoc}
     */
@@ -206,11 +183,10 @@
      return getEffectiveValues().toString();
    }
    /**
     * {@inheritDoc}
     */
        @Override
    public boolean wasEmpty() {
      return activeValues.isEmpty();
    }
@@ -219,8 +195,6 @@
  // The properties.
  private final Map<PropertyDefinition<?>, MyProperty<?>> properties;
  /**
   * Creates a new empty property set.
   */
@@ -228,11 +202,9 @@
    this.properties = new HashMap<PropertyDefinition<?>, MyProperty<?>>();
  }
  /**
   * Creates a property with the provided sets of pre-validated
   * default and active values.
     * Creates a property with the provided sets of pre-validated default and
     * active values.
   *
   * @param <T>
   *          The type of the property.
@@ -243,31 +215,26 @@
   * @param activeValues
   *          The set of active values for the property.
   */
  public <T> void addProperty(PropertyDefinition<T> pd,
      Collection<T> defaultValues, Collection<T> activeValues) {
    public <T> void addProperty(PropertyDefinition<T> pd, Collection<T> defaultValues, Collection<T> activeValues) {
    MyProperty<T> p = new MyProperty<T>(pd, defaultValues, activeValues);
    properties.put(pd, p);
  }
  /**
   * Get the property associated with the specified property
   * definition.
     * Get the property associated with the specified property definition.
   *
   * @param <T>
   *          The underlying type of the property.
   * @param d
   *          The Property definition.
   * @return Returns the property associated with the specified
   *         property definition.
     * @return Returns the property associated with the specified property
     *         definition.
   * @throws IllegalArgumentException
   *           If this property provider does not recognise the
   *           requested property definition.
     *             If this property provider does not recognise the requested
     *             property definition.
   */
  @SuppressWarnings("unchecked")
  public <T> Property<T> getProperty(PropertyDefinition<T> d)
      throws IllegalArgumentException {
    public <T> Property<T> getProperty(PropertyDefinition<T> d) {
    if (!properties.containsKey(d)) {
      throw new IllegalArgumentException("Unknown property " + d.getName());
    }
@@ -275,8 +242,6 @@
    return (Property<T>) properties.get(d);
  }
  /**
   * {@inheritDoc}
   */
@@ -284,8 +249,7 @@
  public String toString() {
    StringBuilder builder = new StringBuilder();
    builder.append('{');
    for (Map.Entry<PropertyDefinition<?>, MyProperty<?>> entry : properties
        .entrySet()) {
        for (Map.Entry<PropertyDefinition<?>, MyProperty<?>> entry : properties.entrySet()) {
      builder.append(entry.getKey().getName());
      builder.append('=');
      builder.append(entry.getValue().toString());
@@ -295,11 +259,6 @@
    return builder.toString();
  }
  /**
   * Makes all pending values active.
   */
@@ -309,39 +268,33 @@
    }
  }
  /**
   * Set a new pending values for the specified property.
   * <p>
   * See the class description for more information regarding pending
   * values.
     * See the class description for more information regarding pending values.
   *
   * @param <T>
   *          The type of the property to be modified.
   * @param d
   *          The property to be modified.
   * @param values
   *          A non-<code>null</code> set of new pending values for
   *          the property (an empty set indicates that the property
   *          should be reset to its default behavior). The set will
   *          not be referenced by this managed object.
     *            A non-<code>null</code> set of new pending values for the
     *            property (an empty set indicates that the property should be
     *            reset to its default behavior). The set will not be referenced
     *            by this managed object.
   * @throws IllegalPropertyValueException
   *           If a new pending value is deemed to be invalid
   *           according to the property definition.
     *             If a new pending value is deemed to be invalid according to
     *             the property definition.
   * @throws PropertyIsSingleValuedException
   *           If an attempt was made to add multiple pending values
   *           to a single-valued property.
     *             If an attempt was made to add multiple pending values to a
     *             single-valued property.
   * @throws PropertyIsMandatoryException
   *           If an attempt was made to remove a mandatory property.
   * @throws IllegalArgumentException
   *           If the specified property definition is not associated
   *           with this managed object.
     *             If the specified property definition is not associated with
     *             this managed object.
   */
  <T> void setPropertyValues(PropertyDefinition<T> d,
      Collection<T> values) throws IllegalPropertyValueException,
      PropertyIsSingleValuedException, PropertyIsMandatoryException,
      IllegalArgumentException {
    <T> void setPropertyValues(PropertyDefinition<T> d, Collection<T> values) {
    MyProperty<T> property = (MyProperty<T>) getProperty(d);
    if (values.size() > 1 && !d.hasOption(PropertyOption.MULTI_VALUED)) {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/client/spi/package-info.java
@@ -24,8 +24,6 @@
 *      Copyright 2008 Sun Microsystems, Inc.
 */
/**
 * Client side driver implementation interfaces.
 * <p>
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/condition/ContainsCondition.java
@@ -30,7 +30,6 @@
import org.forgerock.opendj.ldap.ErrorResultException;
import org.forgerock.util.Reject;
import org.opends.server.admin.AbstractManagedObjectDefinition;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.client.ManagedObject;
import org.opends.server.admin.client.ManagementContext;
@@ -58,7 +57,7 @@
        final T value;
        // Private constructor.
        private Impl(PropertyDefinition<T> pd, T value) throws IllegalPropertyValueStringException {
        private Impl(PropertyDefinition<T> pd, T value) {
            this.pd = pd;
            this.value = value;
        }
@@ -150,7 +149,7 @@
    }
    // Creates the new private implementation.
    private <T> void buildImpl(PropertyDefinition<T> pd) throws IllegalPropertyValueStringException {
    private <T> void buildImpl(PropertyDefinition<T> pd) {
        T value = pd.decodeValue(propertyStringValue);
        this.impl = new Impl<T>(pd, value);
    }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/doc/ConfigGuideGeneration.java
@@ -77,27 +77,31 @@
 * It is based on the Admin Framework Introspection API
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public class ConfigGuideGeneration {
public final 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 String CSS_FILE = "opendj-config.css";
    private static 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 RELATION_TREE_FILE = "ManagedObjectRelationTree.html";
    private final String MO_LIST_FILE = "ManagedObjectList.html";
    private final String PROPERTIES_INDEX_FILE = "PropertiesIndex.html";
    private final String WELCOME_FILE = "welcome.html";
    private final String MAINTOP_FILE = "maintop.html";
    private final String INDEX_FILE = "index.html";
    private final String FAVICON = "http://forgerock.org/favicon.ico";
    private static final String MAIN_FILE = "index.html";
    private static final String INHERITANCE_TREE_FILE = "ManagedObjectInheritanceTree.html";
    private static final String RELATION_TREE_FILE = "ManagedObjectRelationTree.html";
    private static final String MO_LIST_FILE = "ManagedObjectList.html";
    private static final String PROPERTIES_INDEX_FILE = "PropertiesIndex.html";
    private static final String WELCOME_FILE = "welcome.html";
    private static final String MAINTOP_FILE = "maintop.html";
    private static final String INDEX_FILE = "index.html";
    private static final String FAVICON = "http://forgerock.org/favicon.ico";
    private static final String CONFIG_GUIDE_DIR = "opendj_config_guide";
    private final String MAIN_FRAME = "mainFrame";
    private static final String MAIN_FRAME = "mainFrame";
    private ConfigGuideGeneration() {
        // no implementation required.
    }
    /**
     * Entry point for documentation generation. Properties: GenerationDir - The
@@ -133,19 +137,19 @@
            ldapMapping = true;
        }
        OpenDJWiki = properties.getProperty("OpenDJWiki");
        if (OpenDJWiki == null) {
        openDJWiki = properties.getProperty("OpenDJWiki");
        if (openDJWiki == null) {
            // Default is current wiki
            OpenDJWiki = "http://wikis.forgerock.org/confluence/display/OPENDJ";
            openDJWiki = "http://wikis.forgerock.org/confluence/display/OPENDJ";
        }
        OpenDJHome = properties.getProperty("OpenDJHome");
        if (OpenDJHome == null) {
        openDJHome = properties.getProperty("OpenDJHome");
        if (openDJHome == null) {
            // Default is current OpenDJ project home
            OpenDJHome = "http://opendj.forgerock.org";
            openDJHome = "http://opendj.forgerock.org";
        }
        aciSyntaxPage = OpenDJHome + ACI_SYNTAX_REL_URL;
        aciSyntaxPage = openDJHome + ACI_SYNTAX_REL_URL;
        durationSyntaxPage = DURATION_SYNTAX_REL_URL;
        ConfigGuideGeneration myGen = new ConfigGuideGeneration();
@@ -338,11 +342,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 "
                fromStr =
                    " (from "
                        + getLink(parentMo.getUserFriendlyName().toString(), parentMo.getName() + ".html", MAIN_FRAME)
                        + ")";
            }
@@ -593,7 +598,8 @@
        if (!aggregProps.isEmpty()) {
            paragraph("The following components have a direct AGGREGATION relation FROM "
                    + mo.getUserFriendlyPluralName() + " :");
            TreeMap<String, AbstractManagedObjectDefinition> componentList = new TreeMap<String, AbstractManagedObjectDefinition>();
            TreeMap<String, AbstractManagedObjectDefinition> componentList =
                new TreeMap<String, AbstractManagedObjectDefinition>();
            for (AggregationPropertyDefinition agg : aggregProps) {
                RelationDefinition rel = agg.getRelationDefinition();
                AbstractManagedObjectDefinition childRel = rel.getChildDefinition();
@@ -629,7 +635,8 @@
        if (!isReverseAggregPropsEmpty) {
            paragraph("The following components have a direct AGGREGATION relation TO "
                    + mo.getUserFriendlyPluralName() + " :");
            TreeMap<String, AbstractManagedObjectDefinition> componentList = new TreeMap<String, AbstractManagedObjectDefinition>();
            TreeMap<String, AbstractManagedObjectDefinition> componentList =
                new TreeMap<String, AbstractManagedObjectDefinition>();
            for (AggregationPropertyDefinition agg : reverseAggregProps) {
                AbstractManagedObjectDefinition fromMo = agg.getManagedObjectDefinition();
                componentList.put(fromMo.getName(), fromMo);
@@ -675,7 +682,8 @@
            Type actionType = prop.getAdministratorAction().getType();
            String actionStr = "";
            if (actionType == Type.COMPONENT_RESTART) {
                actionStr = "The " + mo.getUserFriendlyName()
                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";
@@ -717,8 +725,8 @@
            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) {
@@ -728,8 +736,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";
            }
@@ -847,8 +855,7 @@
        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.");
            + "in alphabetical order, and indicates the configuration component to " + "which each property applies.");
        newline();
        paragraph(lettersPointers);
@@ -903,13 +910,13 @@
    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("<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
        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");
@@ -927,7 +934,8 @@
                + "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("  <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\" "
@@ -979,8 +987,8 @@
                return "The DN of any "
                        + linkStr
                        + ". "
                        + ((prop.getSourceConstraintSynopsis() != null) ? prop.getSourceConstraintSynopsis()
                                .toString() : "");
                    + ((prop.getSourceConstraintSynopsis() != null) ? prop.getSourceConstraintSynopsis().toString()
                        : "");
            }
            @Override
@@ -1022,12 +1030,12 @@
                if (prop.getMaximumUnit() != null) {
                    durationStr += "Maximum unit is \"" + prop.getMaximumUnit().getLongName() + "\". ";
                }
                long lowerLimitStr = new Double(prop.getBaseUnit().fromMilliSeconds(prop.getLowerLimit()))
                        .longValue();
                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();
                    long upperLimitStr =
                        new Double(prop.getBaseUnit().fromMilliSeconds(prop.getUpperLimit())).longValue();
                    durationStr += "Upper limit is " + upperLimitStr + " " + prop.getBaseUnit().getLongName() + ". ";
                }
@@ -1126,12 +1134,16 @@
            AliasDefaultBehaviorProvider aliasBehav = (AliasDefaultBehaviorProvider) defaultBehav;
            defValueStr = aliasBehav.getSynopsis().toString();
        } else if (defaultBehav instanceof RelativeInheritedDefaultBehaviorProvider) {
            RelativeInheritedDefaultBehaviorProvider relativBehav = (RelativeInheritedDefaultBehaviorProvider) defaultBehav;
            defValueStr = getDefaultBehaviorString(relativBehav.getManagedObjectDefinition().getPropertyDefinition(
            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(
            AbsoluteInheritedDefaultBehaviorProvider absoluteBehav =
                (AbsoluteInheritedDefaultBehaviorProvider) defaultBehav;
            defValueStr =
                getDefaultBehaviorString(absoluteBehav.getManagedObjectDefinition().getPropertyDefinition(
                    absoluteBehav.getPropertyName()));
        }
        return defValueStr;
@@ -1224,18 +1236,19 @@
    }
    private final String Now = new Date().toString();
    private static 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");
            + "<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) {
        // @Checkstyle:off
        htmlBuff.append("<div class=\"tabmenu\"> " +
        "<span><a " + (activeTab.equals(INHERITANCE_TREE_FILE) ? "class=\"activetab\" " : "") + "href=\""
@@ -1244,14 +1257,14 @@
                "<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>"
                +
            + PROPERTIES_INDEX_FILE + "\"" + " title=\"Alphabetical Index of Properties\" >Properties</a></span>" +
                "</div>" + "\n");
        // @Checkstyle:on
    }
    private String getLink(String str, String link) {
@@ -1407,8 +1420,8 @@
    private void generateFile(String fileName) {
        // Write the html buffer in a file
        try {
            PrintWriter file = new java.io.PrintWriter(new java.io.FileWriter(generationDir + File.separator
                    + fileName));
            PrintWriter file =
                new java.io.PrintWriter(new java.io.FileWriter(generationDir + File.separator + fileName));
            file.write(htmlBuff.toString());
            file.close();
        } catch (Exception e) {
@@ -1422,17 +1435,21 @@
    // 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, 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;
    private static boolean ldapMapping = false;
    private static String OpenDJWiki;
    private static String OpenDJHome;
    private static String openDJWiki;
    private static String openDJHome;
    private static String aciSyntaxPage;
    private static String durationSyntaxPage;
    private boolean inList = false;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/package-info.java
@@ -24,8 +24,6 @@
 *      Copyright 2008 Sun Microsystems, Inc.
 */
/**
 * Common administration classes.
 * <p>
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ConfigChangeListenerAdaptor.java
@@ -195,7 +195,7 @@
    /** The managed object path. */
    private final ManagedObjectPath<?, S> path;
    /** Repository of configuration entries */
    /** Repository of configuration entries. */
    private final ConfigurationRepository configRepository;
    private final ServerManagementContext serverContext;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ConfigurationAddListener.java
@@ -24,25 +24,22 @@
 *      Copyright 2007-2008 Sun Microsystems, Inc.
 */
package org.opends.server.admin.server;
import org.forgerock.i18n.LocalizableMessage;
import java.util.List;
import org.opends.server.admin.Configuration;
import org.opends.server.types.ConfigChangeResult;
/**
 * This interface defines the methods that a Directory Server
 * configurable component should implement if it wishes to be able to
 * receive notifications when a new configuration is added.
 * This interface defines the methods that a Directory Server configurable
 * component should implement if it wishes to be able to receive notifications
 * when a new configuration is added.
 *
 * @param <T>
 *          The type of configuration that this listener should be
 *          notified about.
 *            The type of configuration that this listener should be notified
 *            about.
 */
public interface ConfigurationAddListener<T extends Configuration> {
@@ -55,21 +52,17 @@
   * @param unacceptableReasons
   *          A list that can be used to hold messages about why the
   *          provided configuration is not acceptable.
   * @return Returns <code>true</code> if the proposed addition is
   *         acceptable, or <code>false</code> if it is not.
     * @return Returns <code>true</code> if the proposed addition is acceptable,
     *         or <code>false</code> if it is not.
   */
  public boolean isConfigurationAddAcceptable(T configuration,
      List<LocalizableMessage> unacceptableReasons);
    public boolean isConfigurationAddAcceptable(T configuration, List<LocalizableMessage> unacceptableReasons);
  /**
   * Adds a new configuration to this add listener.
   *
   * @param configuration
   *          The configuration that will be added.
   * @return Returns information about the result of adding the
   *         configuration.
     * @return Returns information about the result of adding the configuration.
   */
  public ConfigChangeResult applyConfigurationAdd(T configuration);
}
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/DelayedConfigAddListener.java
@@ -74,7 +74,8 @@
     * @param addListener
     *            The add listener to be added to the subordinate entry when it
     *            is added.
     * @param configRepository TODO
     * @param configRepository
     *            Repository of config entries.
     */
    public DelayedConfigAddListener(DN child, ConfigAddListener addListener, ConfigurationRepository configRepository) {
        this.parent = child.parent();
@@ -94,9 +95,11 @@
     * @param deleteListener
     *            The delete listener to be added to the subordinate entry when
     *            it is added.
     * @param configRepository TODO
     * @param configRepository
     *            Repository of config entries.
     */
    public DelayedConfigAddListener(DN child, ConfigDeleteListener deleteListener, ConfigurationRepository configRepository) {
    public DelayedConfigAddListener(DN child, ConfigDeleteListener deleteListener,
        ConfigurationRepository configRepository) {
        this.parent = child.parent();
        this.child = child;
        this.delayedAddListener = null;
@@ -107,6 +110,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public ConfigChangeResult applyConfigurationAdd(Entry configEntry) {
        if (configEntry.getName().equals(child)) {
            // The subordinate entry matched our criteria so register the
@@ -137,6 +141,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public boolean configAddIsAcceptable(Entry configEntry, LocalizableMessageBuilder unacceptableReason) {
        // Always acceptable.
        return true;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObject.java
@@ -82,7 +82,7 @@
    private final ManagedObjectDefinition<?, S> definition;
    /** The managed object path identifying this managed object's location */
    /** The managed object path identifying this managed object's location. */
    private final ManagedObjectPath<?, S> path;
    private final Map<PropertyDefinition<?>, SortedSet<?>> properties;
@@ -126,7 +126,7 @@
     *             with this managed object's definition.
     */
    public <M extends Configuration> void deregisterAddListener(InstantiableRelationDefinition<?, M> d,
            ConfigurationAddListener<M> listener) throws IllegalArgumentException {
            ConfigurationAddListener<M> listener) {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
        deregisterAddListener(baseDN, listener);
@@ -146,7 +146,7 @@
     *             with this managed object's definition.
     */
    public <M extends Configuration> void deregisterAddListener(InstantiableRelationDefinition<?, M> d,
            ServerManagedObjectAddListener<M> listener) throws IllegalArgumentException {
            ServerManagedObjectAddListener<M> listener) {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
        deregisterAddListener(baseDN, listener);
@@ -166,7 +166,7 @@
     *             this managed object's definition.
     */
    public <M extends Configuration> void deregisterAddListener(OptionalRelationDefinition<?, M> d,
            ConfigurationAddListener<M> listener) throws IllegalArgumentException {
            ConfigurationAddListener<M> listener) {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d).parent();
        deregisterAddListener(baseDN, listener);
@@ -186,7 +186,7 @@
     *             this managed object's definition.
     */
    public <M extends Configuration> void deregisterAddListener(OptionalRelationDefinition<?, M> d,
            ServerManagedObjectAddListener<M> listener) throws IllegalArgumentException {
            ServerManagedObjectAddListener<M> listener) {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d).parent();
        deregisterAddListener(baseDN, listener);
@@ -206,7 +206,7 @@
     *             managed object's definition.
     */
    public <M extends Configuration> void deregisterAddListener(SetRelationDefinition<?, M> d,
            ConfigurationAddListener<M> listener) throws IllegalArgumentException {
            ConfigurationAddListener<M> listener) {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
        deregisterAddListener(baseDN, listener);
@@ -226,7 +226,7 @@
     *             managed object's definition.
     */
    public <M extends Configuration> void deregisterAddListener(SetRelationDefinition<?, M> d,
            ServerManagedObjectAddListener<M> listener) throws IllegalArgumentException {
            ServerManagedObjectAddListener<M> listener) {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
        deregisterAddListener(baseDN, listener);
@@ -244,7 +244,8 @@
                ConfigChangeListenerAdaptor<?> adaptor = (ConfigChangeListenerAdaptor<?>) l;
                ServerManagedObjectChangeListener<?> l2 = adaptor.getServerManagedObjectChangeListener();
                if (l2 instanceof ServerManagedObjectChangeListenerAdaptor<?>) {
                    ServerManagedObjectChangeListenerAdaptor<?> adaptor2 = (ServerManagedObjectChangeListenerAdaptor<?>) l2;
                    ServerManagedObjectChangeListenerAdaptor<?> adaptor2 =
                        (ServerManagedObjectChangeListenerAdaptor<?>) l2;
                    if (adaptor2.getConfigurationChangeListener() == listener) {
                        adaptor.finalizeChangeListener();
                        configRepository.deregisterChangeListener(configDN, adaptor);
@@ -286,7 +287,7 @@
     *             with this managed object's definition.
     */
    public <M extends Configuration> void deregisterDeleteListener(InstantiableRelationDefinition<?, M> d,
            ConfigurationDeleteListener<M> listener) throws IllegalArgumentException {
            ConfigurationDeleteListener<M> listener) {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
@@ -307,7 +308,7 @@
     *             with this managed object's definition.
     */
    public <M extends Configuration> void deregisterDeleteListener(InstantiableRelationDefinition<?, M> d,
            ServerManagedObjectDeleteListener<M> listener) throws IllegalArgumentException {
            ServerManagedObjectDeleteListener<M> listener) {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
@@ -328,7 +329,7 @@
     *             this managed object's definition.
     */
    public <M extends Configuration> void deregisterDeleteListener(OptionalRelationDefinition<?, M> d,
            ConfigurationDeleteListener<M> listener) throws IllegalArgumentException {
            ConfigurationDeleteListener<M> listener) {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d).parent();
@@ -349,7 +350,7 @@
     *             this managed object's definition.
     */
    public <M extends Configuration> void deregisterDeleteListener(OptionalRelationDefinition<?, M> d,
            ServerManagedObjectDeleteListener<M> listener) throws IllegalArgumentException {
            ServerManagedObjectDeleteListener<M> listener) {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d).parent();
@@ -370,7 +371,7 @@
     *             managed object's definition.
     */
    public <M extends Configuration> void deregisterDeleteListener(SetRelationDefinition<?, M> d,
            ConfigurationDeleteListener<M> listener) throws IllegalArgumentException {
            ConfigurationDeleteListener<M> listener) {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
@@ -391,7 +392,7 @@
     *             managed object's definition.
     */
    public <M extends Configuration> void deregisterDeleteListener(SetRelationDefinition<?, M> d,
            ServerManagedObjectDeleteListener<M> listener) throws IllegalArgumentException {
            ServerManagedObjectDeleteListener<M> listener) {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
@@ -417,7 +418,7 @@
     *             not be decoded.
     */
    public <M extends Configuration> ServerManagedObject<? extends M> getChild(InstantiableRelationDefinition<?, M> d,
            String name) throws IllegalArgumentException, ConfigException {
            String name) throws ConfigException {
        validateRelationDefinition(d);
        return serverContext.getManagedObject(path.child(d, name));
    }
@@ -439,7 +440,7 @@
     *             not be decoded.
     */
    public <M extends Configuration> ServerManagedObject<? extends M> getChild(OptionalRelationDefinition<?, M> d)
            throws IllegalArgumentException, ConfigException {
            throws ConfigException {
        validateRelationDefinition(d);
        return serverContext.getManagedObject(path.child(d));
    }
@@ -465,7 +466,7 @@
     *             not be decoded.
     */
    public <M extends Configuration> ServerManagedObject<? extends M> getChild(SetRelationDefinition<?, M> d,
            String name) throws IllegalArgumentException, ConfigException {
            String name) throws ConfigException {
        validateRelationDefinition(d);
        return serverContext.getManagedObject(path.child(d, name));
@@ -488,7 +489,7 @@
     *             not be decoded.
     */
    public <M extends Configuration> ServerManagedObject<? extends M> getChild(SingletonRelationDefinition<?, M> d)
            throws IllegalArgumentException, ConfigException {
            throws ConfigException {
        validateRelationDefinition(d);
        return serverContext.getManagedObject(path.child(d));
    }
@@ -560,7 +561,7 @@
     *             If the property definition is not associated with this
     *             managed object's definition.
     */
    public <T> T getPropertyValue(PropertyDefinition<T> d) throws IllegalArgumentException {
    public <T> T getPropertyValue(PropertyDefinition<T> d) {
        Set<T> values = getPropertyValues(d);
        if (values.isEmpty()) {
            return null;
@@ -586,7 +587,7 @@
     *             managed object's definition.
     */
    @SuppressWarnings("unchecked")
    public <T> SortedSet<T> getPropertyValues(PropertyDefinition<T> d) throws IllegalArgumentException {
    public <T> SortedSet<T> getPropertyValues(PropertyDefinition<T> d) {
        if (!properties.containsKey(d)) {
            throw new IllegalArgumentException("Unknown property " + d.getName());
        }
@@ -605,7 +606,7 @@
     *             If the optional relation definition is not associated with
     *             this managed object's definition.
     */
    public boolean hasChild(OptionalRelationDefinition<?, ?> d) throws IllegalArgumentException {
    public boolean hasChild(OptionalRelationDefinition<?, ?> d) {
        validateRelationDefinition(d);
        return serverContext.managedObjectExists(path.child(d));
    }
@@ -621,7 +622,7 @@
     *             If the relation definition is not associated with this
     *             managed object's definition.
     */
    public String[] listChildren(InstantiableRelationDefinition<?, ?> d) throws IllegalArgumentException {
    public String[] listChildren(InstantiableRelationDefinition<?, ?> d) {
        validateRelationDefinition(d);
        return serverContext.listManagedObjects(path, d);
    }
@@ -637,7 +638,7 @@
     *             If the relation definition is not associated with this
     *             managed object's definition.
     */
    public String[] listChildren(SetRelationDefinition<?, ?> d) throws IllegalArgumentException {
    public String[] listChildren(SetRelationDefinition<?, ?> d) {
        validateRelationDefinition(d);
        return serverContext.listManagedObjects(path, d);
    }
@@ -660,7 +661,7 @@
     *             relation could not be retrieved.
     */
    public <M extends Configuration> void registerAddListener(InstantiableRelationDefinition<?, M> d,
            ConfigurationAddListener<M> listener) throws IllegalArgumentException, ConfigException {
            ConfigurationAddListener<M> listener) throws ConfigException {
        registerAddListener(d, new ServerManagedObjectAddListenerAdaptor<M>(listener));
    }
@@ -682,7 +683,7 @@
     *             relation could not be retrieved.
     */
    public <M extends Configuration> void registerAddListener(InstantiableRelationDefinition<?, M> d,
            ServerManagedObjectAddListener<M> listener) throws IllegalArgumentException, ConfigException {
            ServerManagedObjectAddListener<M> listener) throws ConfigException {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
        ConfigAddListener adaptor = new ConfigAddListenerAdaptor<M>(serverContext, path, d, listener);
@@ -707,7 +708,7 @@
     *             relation could not be retrieved.
     */
    public <M extends Configuration> void registerAddListener(OptionalRelationDefinition<?, M> d,
            ConfigurationAddListener<M> listener) throws IllegalArgumentException, ConfigException {
            ConfigurationAddListener<M> listener) throws ConfigException {
        registerAddListener(d, new ServerManagedObjectAddListenerAdaptor<M>(listener));
    }
@@ -729,7 +730,7 @@
     *             relation could not be retrieved.
     */
    public <M extends Configuration> void registerAddListener(OptionalRelationDefinition<?, M> d,
            ServerManagedObjectAddListener<M> listener) throws IllegalArgumentException, ConfigException {
            ServerManagedObjectAddListener<M> listener) throws ConfigException {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d).parent();
        ConfigAddListener adaptor = new ConfigAddListenerAdaptor<M>(serverContext, path, d, listener);
@@ -754,7 +755,7 @@
     *             could not be retrieved.
     */
    public <M extends Configuration> void registerAddListener(SetRelationDefinition<?, M> d,
            ConfigurationAddListener<M> listener) throws IllegalArgumentException, ConfigException {
            ConfigurationAddListener<M> listener) throws ConfigException {
        registerAddListener(d, new ServerManagedObjectAddListenerAdaptor<M>(listener));
    }
@@ -776,7 +777,7 @@
     *             could not be retrieved.
     */
    public <M extends Configuration> void registerAddListener(SetRelationDefinition<?, M> d,
            ServerManagedObjectAddListener<M> listener) throws IllegalArgumentException, ConfigException {
            ServerManagedObjectAddListener<M> listener) throws ConfigException {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
        ConfigAddListener adaptor = new ConfigAddListenerAdaptor<M>(serverContext, path, d, listener);
@@ -843,7 +844,7 @@
     *             relation could not be retrieved.
     */
    public <M extends Configuration> void registerDeleteListener(InstantiableRelationDefinition<?, M> d,
            ConfigurationDeleteListener<M> listener) throws IllegalArgumentException, ConfigException {
            ConfigurationDeleteListener<M> listener) throws ConfigException {
        registerDeleteListener(d, new ServerManagedObjectDeleteListenerAdaptor<M>(listener));
    }
@@ -865,7 +866,7 @@
     *             relation could not be retrieved.
     */
    public <M extends Configuration> void registerDeleteListener(InstantiableRelationDefinition<?, M> d,
            ServerManagedObjectDeleteListener<M> listener) throws IllegalArgumentException, ConfigException {
            ServerManagedObjectDeleteListener<M> listener) throws ConfigException {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
        ConfigDeleteListener adaptor = new ConfigDeleteListenerAdaptor<M>(serverContext, path, d, listener);
@@ -890,7 +891,7 @@
     *             relation could not be retrieved.
     */
    public <M extends Configuration> void registerDeleteListener(OptionalRelationDefinition<?, M> d,
            ConfigurationDeleteListener<M> listener) throws IllegalArgumentException, ConfigException {
            ConfigurationDeleteListener<M> listener) throws ConfigException {
        registerDeleteListener(d, new ServerManagedObjectDeleteListenerAdaptor<M>(listener));
    }
@@ -912,7 +913,7 @@
     *             relation could not be retrieved.
     */
    public <M extends Configuration> void registerDeleteListener(OptionalRelationDefinition<?, M> d,
            ServerManagedObjectDeleteListener<M> listener) throws IllegalArgumentException, ConfigException {
            ServerManagedObjectDeleteListener<M> listener) throws ConfigException {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d).parent();
        ConfigDeleteListener adaptor = new ConfigDeleteListenerAdaptor<M>(serverContext, path, d, listener);
@@ -937,7 +938,7 @@
     *             could not be retrieved.
     */
    public <M extends Configuration> void registerDeleteListener(SetRelationDefinition<?, M> d,
            ConfigurationDeleteListener<M> listener) throws IllegalArgumentException, ConfigException {
            ConfigurationDeleteListener<M> listener) throws ConfigException {
        registerDeleteListener(d, new ServerManagedObjectDeleteListenerAdaptor<M>(listener));
    }
@@ -959,7 +960,7 @@
     *             could not be retrieved.
     */
    public <M extends Configuration> void registerDeleteListener(SetRelationDefinition<?, M> d,
            ServerManagedObjectDeleteListener<M> listener) throws IllegalArgumentException, ConfigException {
            ServerManagedObjectDeleteListener<M> listener) throws ConfigException {
        validateRelationDefinition(d);
        DN baseDN = DNBuilder.create(path, d);
        ConfigDeleteListener adaptor = new ConfigDeleteListenerAdaptor<M>(serverContext, path, d, listener);
@@ -1040,7 +1041,8 @@
                        ConfigAddListenerAdaptor<?> adaptor = (ConfigAddListenerAdaptor<?>) configListener;
                        ServerManagedObjectAddListener<?> smoListener = adaptor.getServerManagedObjectAddListener();
                        if (smoListener instanceof ServerManagedObjectAddListenerAdaptor<?>) {
                            ServerManagedObjectAddListenerAdaptor<?> adaptor2 = (ServerManagedObjectAddListenerAdaptor<?>) smoListener;
                            ServerManagedObjectAddListenerAdaptor<?> adaptor2 =
                                (ServerManagedObjectAddListenerAdaptor<?>) smoListener;
                            if (adaptor2.getConfigurationAddListener() == listener) {
                                configRepository.deregisterAddListener(baseDN, adaptor);
                            }
@@ -1059,7 +1061,8 @@
    }
    // Deregister an add listener.
    private <M extends Configuration> void deregisterAddListener(DN baseDN, ServerManagedObjectAddListener<M> listener) {
    private <M extends Configuration> void deregisterAddListener(DN baseDN,
        ServerManagedObjectAddListener<M> listener) {
        try {
            if (configRepository.hasEntry(baseDN)) {
                for (ConfigAddListener configListener : configRepository.getAddListeners(baseDN)) {
@@ -1092,8 +1095,10 @@
     * @return a pair of (intermediate adaptor, intermediate listener) or
     *         {@code Pair.EMPTY} if listener can't be extracted
     */
    // @Checkstyle:off
    static <T extends Configuration> Pair<ConfigAddListenerAdaptor<T>, ConfigurationAddListener<T>>
        extractInitialListener(ConfigAddListener configListener) {
        // @Checkstyle:on
        Pair<ConfigAddListenerAdaptor<T>, ServerManagedObjectAddListener<T>> pair =
                extractIntermediateListener(configListener);
        if (!pair.equals(Pair.EMPTY) && pair.getSecond() instanceof ServerManagedObjectAddListenerAdaptor) {
@@ -1116,8 +1121,10 @@
     *         {@code Pair.EMPTY} if listener can't be extracted
     */
    @SuppressWarnings("unchecked")
    // @Checkstyle:off
    static <T extends Configuration> Pair<ConfigAddListenerAdaptor<T>, ServerManagedObjectAddListener<T>>
        extractIntermediateListener(ConfigAddListener configListener) {
        // @Checkstyle:on
        if (configListener instanceof ConfigAddListenerAdaptor) {
            ConfigAddListenerAdaptor<T> adaptor = ((ConfigAddListenerAdaptor<T>) configListener);
            return Pair.of(adaptor, adaptor.getServerManagedObjectAddListener());
@@ -1126,7 +1133,8 @@
    }
    // Deregister a delete listener.
    private <M extends Configuration> void deregisterDeleteListener(DN baseDN, ConfigurationDeleteListener<M> listener) {
    private <M extends Configuration> void deregisterDeleteListener(DN baseDN,
        ConfigurationDeleteListener<M> listener) {
        try {
            if (configRepository.hasEntry(baseDN)) {
                for (ConfigDeleteListener l : configRepository.getDeleteListeners(baseDN)) {
@@ -1134,7 +1142,8 @@
                        ConfigDeleteListenerAdaptor<?> adaptor = (ConfigDeleteListenerAdaptor<?>) l;
                        ServerManagedObjectDeleteListener<?> l2 = adaptor.getServerManagedObjectDeleteListener();
                        if (l2 instanceof ServerManagedObjectDeleteListenerAdaptor<?>) {
                            ServerManagedObjectDeleteListenerAdaptor<?> adaptor2 = (ServerManagedObjectDeleteListenerAdaptor<?>) l2;
                            ServerManagedObjectDeleteListenerAdaptor<?> adaptor2 =
                                (ServerManagedObjectDeleteListenerAdaptor<?>) l2;
                            if (adaptor2.getConfigurationDeleteListener() == listener) {
                                configRepository.deregisterDeleteListener(baseDN, adaptor);
                            }
@@ -1177,7 +1186,7 @@
    }
    // Register an instantiable or optional relation add listener.
    private void registerAddListener(DN baseDN, ConfigAddListener adaptor) throws IllegalArgumentException,
    private void registerAddListener(DN baseDN, ConfigAddListener adaptor) throws
            ConfigException {
        if (configRepository.hasEntry(baseDN)) {
            configRepository.registerAddListener(baseDN, adaptor);
@@ -1212,8 +1221,8 @@
    // Deregister a delayed listener with the nearest existing parent
    // entry to the provided base DN.
    private <M extends Configuration> void deregisterDelayedAddListener(DN baseDN, ConfigurationAddListener<M> listener)
            throws ConfigException {
    private <M extends Configuration> void deregisterDelayedAddListener(DN baseDN,
        ConfigurationAddListener<M> listener) throws ConfigException {
        DN parentDN = baseDN.parent();
        int delayWrappers = 0;
        while (parentDN != null) {
@@ -1248,7 +1257,8 @@
                            ConfigAddListenerAdaptor<?> adaptor = (ConfigAddListenerAdaptor<?>) delayedListener;
                            ServerManagedObjectAddListener<?> l2 = adaptor.getServerManagedObjectAddListener();
                            if (l2 instanceof ServerManagedObjectAddListenerAdaptor<?>) {
                                ServerManagedObjectAddListenerAdaptor<?> adaptor2 = (ServerManagedObjectAddListenerAdaptor<?>) l2;
                                ServerManagedObjectAddListenerAdaptor<?> adaptor2 =
                                    (ServerManagedObjectAddListenerAdaptor<?>) l2;
                                if (adaptor2.getConfigurationAddListener() == listener) {
                                    configRepository.deregisterAddListener(parentDN, configListener);
                                }
@@ -1299,7 +1309,8 @@
                            ConfigDeleteListenerAdaptor<?> adaptor = (ConfigDeleteListenerAdaptor<?>) delayedListener;
                            ServerManagedObjectDeleteListener<?> l2 = adaptor.getServerManagedObjectDeleteListener();
                            if (l2 instanceof ServerManagedObjectDeleteListenerAdaptor<?>) {
                                ServerManagedObjectDeleteListenerAdaptor<?> adaptor2 = (ServerManagedObjectDeleteListenerAdaptor<?>) l2;
                                ServerManagedObjectDeleteListenerAdaptor<?> adaptor2 =
                                    (ServerManagedObjectDeleteListenerAdaptor<?>) l2;
                                if (adaptor2.getConfigurationDeleteListener() == listener) {
                                    configRepository.deregisterAddListener(parentDN, l);
                                }
@@ -1420,7 +1431,7 @@
    // Validate that a relation definition belongs to this managed
    // object.
    private void validateRelationDefinition(RelationDefinition<?, ?> rd) throws IllegalArgumentException {
    private void validateRelationDefinition(RelationDefinition<?, ?> rd) {
        RelationDefinition<?, ?> tmp = definition.getRelationDefinition(rd.getName());
        if (tmp != rd) {
            throw new IllegalArgumentException("The relation " + rd.getName() + " is not associated with a "
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectAddListenerAdaptor.java
@@ -39,7 +39,8 @@
 *            The type of server managed object that this listener should be
 *            notified about.
 */
final class ServerManagedObjectAddListenerAdaptor<T extends Configuration> implements ServerManagedObjectAddListener<T> {
final class ServerManagedObjectAddListenerAdaptor<T extends Configuration> implements
    ServerManagedObjectAddListener<T> {
    // The underlying add listener.
    private final ConfigurationAddListener<T> listener;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectChangeListener.java
@@ -25,8 +25,6 @@
 */
package org.opends.server.admin.server;
import org.forgerock.i18n.LocalizableMessage;
import java.util.List;
@@ -34,46 +32,39 @@
import org.opends.server.admin.Configuration;
import org.opends.server.types.ConfigChangeResult;
/**
 * This interface defines the methods that a Directory Server
 * configurable component should implement if it wishes to be able to
 * receive notifications when a its associated server managed object
 * is changed.
 * This interface defines the methods that a Directory Server configurable
 * component should implement if it wishes to be able to receive notifications
 * when a its associated server managed object is changed.
 *
 * @param <T>
 *          The type of server managed object that this listener
 *          should be notified about.
 *            The type of server managed object that this listener should be
 *            notified about.
 */
public interface ServerManagedObjectChangeListener<T extends Configuration> {
  /**
   * Indicates whether the proposed change to the server managed
   * object is acceptable to this change listener.
     * Indicates whether the proposed change to the server managed object is
     * acceptable to this change listener.
   *
   * @param mo
   *          The new server managed object containing the changes.
   * @param unacceptableReasons
   *          A list that can be used to hold messages about why the
   *          provided server managed object is not acceptable.
   * @return Returns <code>true</code> if the proposed change is
   *         acceptable, or <code>false</code> if it is not.
     * @return Returns <code>true</code> if the proposed change is acceptable,
     *         or <code>false</code> if it is not.
   */
  public boolean isConfigurationChangeAcceptable(
      ServerManagedObject<? extends T> mo, List<LocalizableMessage> unacceptableReasons);
    public boolean isConfigurationChangeAcceptable(ServerManagedObject<? extends T> mo,
        List<LocalizableMessage> unacceptableReasons);
  /**
   * Applies the server managed object changes to this change
   * listener.
     * Applies the server managed object changes to this change listener.
   *
   * @param mo
   *          The new server managed object containing the changes.
   * @return Returns information about the result of changing the
   *         server managed object.
     * @return Returns information about the result of changing the server
     *         managed object.
   */
  public ConfigChangeResult applyConfigurationChange(
      ServerManagedObject<? extends T> mo);
    public ConfigChangeResult applyConfigurationChange(ServerManagedObject<? extends T> mo);
}
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagedObjectChangeListenerAdaptor.java
@@ -58,6 +58,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public ConfigChangeResult applyConfigurationChange(ServerManagedObject<? extends T> mo) {
        return listener.applyConfigurationChange(mo.getConfiguration());
    }
@@ -75,6 +76,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isConfigurationChangeAcceptable(ServerManagedObject<? extends T> mo,
            List<LocalizableMessage> unacceptableReasons) {
        return listener.isConfigurationChangeAcceptable(mo.getConfiguration(), unacceptableReasons);
opendj-sdk/opendj-admin/src/main/java/org/opends/server/admin/server/ServerManagementContext.java
@@ -68,7 +68,6 @@
import org.opends.server.admin.RelationDefinition;
import org.opends.server.admin.RelativeInheritedDefaultBehaviorProvider;
import org.opends.server.admin.UndefinedDefaultBehaviorProvider;
import org.opends.server.admin.UnknownPropertyDefinitionException;
import org.opends.server.admin.DefinitionDecodingException.Reason;
import org.opends.server.config.ConfigException;
import org.opends.server.config.ConfigurationRepository;
@@ -97,7 +96,7 @@
     * @param <T>
     *            The type of the property.
     */
    private class DefaultValueFinder<T> implements DefaultBehaviorProviderVisitor<T, Collection<T>, Void> {
    private final class DefaultValueFinder<T> implements DefaultBehaviorProviderVisitor<T, Collection<T>, Void> {
        // Any exception that occurred whilst retrieving inherited default
        // values.
@@ -178,8 +177,7 @@
        }
        // Find the default values for the next path/property.
        private Collection<T> find(ManagedObjectPath<?, ?> path, PropertyDefinition<T> propertyDef)
                throws DefaultBehaviorException {
        private Collection<T> find(ManagedObjectPath<?, ?> path, PropertyDefinition<T> propertyDef) {
            nextPath = path;
            nextProperty = propertyDef;
@@ -199,8 +197,7 @@
        // Get an inherited property value.
        @SuppressWarnings("unchecked")
        private Collection<T> getInheritedProperty(ManagedObjectPath<?,?> target,
                AbstractManagedObjectDefinition<?, ?> definition, String propertyName)
                        throws DefaultBehaviorException {
            AbstractManagedObjectDefinition<?, ?> definition, String propertyName) {
            // First check that the requested type of managed object
            // corresponds to the path.
            AbstractManagedObjectDefinition<?, ?> supr = target.getManagedObjectDefinition();
@@ -271,7 +268,7 @@
     * A definition resolver that determines the managed object definition from
     * the object classes of a ConfigEntry.
     */
    private class MyDefinitionResolver implements DefinitionResolver {
    private final class MyDefinitionResolver implements DefinitionResolver {
        // The config entry.
        private final Entry entry;
@@ -306,7 +303,7 @@
        /**
         * Decodes the provided property LDAP value.
         *
         * @param <PD>
         * @param <P>
         *            The type of the property.
         * @param propertyDef
         *            The property definition.
@@ -317,8 +314,7 @@
         *             If the property value could not be decoded because it was
         *             invalid.
         */
        public static <PD> PD decode(PropertyDefinition<PD> propertyDef, String value)
                throws IllegalPropertyValueStringException {
        public static <P> P decode(PropertyDefinition<P> propertyDef, String value) {
            return propertyDef.castValue(propertyDef.accept(new ValueDecoder(), value));
        }
@@ -347,7 +343,7 @@
         * {@inheritDoc}
         */
        @Override
        public <T> Object visitUnknown(PropertyDefinition<T> d, String p) throws UnknownPropertyDefinitionException {
        public <T> Object visitUnknown(PropertyDefinition<T> d, String p) {
            // By default the property definition's decoder will do.
            return d.decodeValue(p);
        }
@@ -360,7 +356,7 @@
     */
    private volatile ServerManagedObject<RootCfg> root;
    /** Repository of configuration entries */
    /** Repository of configuration entries. */
    private final ConfigurationRepository configRepository;
    /**
@@ -426,7 +422,7 @@
     * @param <S>
     *            The type of server managed object configuration that the path
     *            definition refers to.
     * @param <PD>
     * @param <P>
     *            The type of the property to be retrieved.
     * @param path
     *            The path of the managed object containing the property.
@@ -444,10 +440,9 @@
     *             If the named managed object could not be found or if it could
     *             not be decoded.
     */
    public <C extends ConfigurationClient, S extends Configuration, PD> PD getPropertyValue(
            ManagedObjectPath<C, S> path, PropertyDefinition<PD> pd) throws IllegalArgumentException, ConfigException,
            PropertyException {
        SortedSet<PD> values = getPropertyValues(path, pd);
    public <C extends ConfigurationClient, S extends Configuration, P> P getPropertyValue(
            ManagedObjectPath<C, S> path, PropertyDefinition<P> pd) throws ConfigException {
        SortedSet<P> values = getPropertyValues(path, pd);
        if (values.isEmpty()) {
            return null;
        } else {
@@ -464,7 +459,7 @@
     * @param <S>
     *            The type of server managed object configuration that the path
     *            definition refers to.
     * @param <PD>
     * @param <P>
     *            The type of the property to be retrieved.
     * @param path
     *            The path of the managed object containing the property.
@@ -483,9 +478,8 @@
     *             not be decoded.
     */
    @SuppressWarnings("unchecked")
    public <C extends ConfigurationClient, S extends Configuration, PD> SortedSet<PD> getPropertyValues(
            ManagedObjectPath<C, S> path, PropertyDefinition<PD> propertyDef) throws IllegalArgumentException, ConfigException,
            PropertyException {
    public <C extends ConfigurationClient, S extends Configuration, P> SortedSet<P> getPropertyValues(
            ManagedObjectPath<C, S> path, PropertyDefinition<P> propertyDef) throws ConfigException {
        // Check that the requested property is from the definition
        // associated with the path.
        AbstractManagedObjectDefinition<C, S> definition = path.getManagedObjectDefinition();
@@ -512,7 +506,7 @@
        // Make sure we use the correct property definition, the
        // provided one might have been overridden in the resolved
        // definition.
        propertyDef = (PropertyDefinition<PD>) managedObjDef.getPropertyDefinition(propertyDef.getName());
        propertyDef = (PropertyDefinition<P>) managedObjDef.getPropertyDefinition(propertyDef.getName());
        List<String> attributeValues = getAttributeValues(managedObjDef, propertyDef, configEntry);
        return decodeProperty(path.asSubType(managedObjDef), propertyDef, attributeValues, null);
@@ -536,15 +530,17 @@
     * @return the root configuration server managed object
     */
    public ServerManagedObject<RootCfg> getRootConfigurationManagedObject() {
        // Use lazy initialisation because it needs a reference to this server context.
        // Use lazy initialisation because it needs a reference to this server
        // context.
        ServerManagedObject<RootCfg> rootObject = root;
        if (rootObject == null) {
            synchronized(this) {
                rootObject = root;
                if (rootObject == null) {
                    root = rootObject = new ServerManagedObject<RootCfg>(ManagedObjectPath.emptyPath(),
                            RootCfgDefn.getInstance(), Collections.<PropertyDefinition<?>, SortedSet<?>> emptyMap(),
                            null, this);
                    root = rootObject =
                        new ServerManagedObject<RootCfg>(ManagedObjectPath.emptyPath(),
                                RootCfgDefn.getInstance(), Collections.<PropertyDefinition<?>,
                                SortedSet<?>> emptyMap(), null, this);
                }
            }
        }
@@ -707,7 +703,7 @@
    /** Decode a property using the provided attribute values. */
    private <T> SortedSet<T> decodeProperty(ManagedObjectPath<?, ?> path, PropertyDefinition<T> propertyDef,
            List<String> attributeValues, Entry newConfigEntry) throws PropertyException {
            List<String> attributeValues, Entry newConfigEntry) {
        PropertyException exception = null;
        SortedSet<T> pvalues = new TreeSet<T>(propertyDef);
@@ -751,7 +747,7 @@
        }
    }
    /** Gets the attribute values associated with a property from a ConfigEntry */
    /** Gets the attribute values associated with a property from a ConfigEntry. */
    private List<String> getAttributeValues(ManagedObjectDefinition<?, ?> d, PropertyDefinition<?> pd,
            Entry configEntry) {
        // TODO: we create a default attribute type if it is undefined.
@@ -771,7 +767,7 @@
    // Get the default values for the specified property.
    private <T> Collection<T> getDefaultValues(ManagedObjectPath<?, ?> p, PropertyDefinition<T> pd,
            Entry newConfigEntry) throws DefaultBehaviorException {
            Entry newConfigEntry) {
        DefaultValueFinder<T> v = new DefaultValueFinder<T>(newConfigEntry);
        return v.find(p, pd);
    }
@@ -823,8 +819,7 @@
    }
    // Validate that a relation definition belongs to the path.
    private void validateRelationDefinition(ManagedObjectPath<?, ?> path, RelationDefinition<?, ?> rd)
            throws IllegalArgumentException {
    private void validateRelationDefinition(ManagedObjectPath<?, ?> path, RelationDefinition<?, ?> rd) {
        AbstractManagedObjectDefinition<?, ?> d = path.getManagedObjectDefinition();
        RelationDefinition<?, ?> tmp = d.getRelationDefinition(rd.getName());
        if (tmp != rd) {
opendj-sdk/opendj-admin/src/main/java/org/opends/server/api/package-info.java
New file
@@ -0,0 +1,44 @@
/*
 * 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 legal-notices/CDDLv1_0.txt
 * or http://forgerock.org/license/CDDLv1.0.html.
 * 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 legal-notices/CDDLv1_0.txt.
 * 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-2008 Sun Microsystems, Inc.
 */
/**
 * Contains a number of API declarations for use throughout the
 * Directory Server.  Whenever possible, these APIs should be declared
 * using abstract classes rather than interfaces so that they can be
 * altered in future versions without impacting backward
 * compatibility.
 * <BR><BR>
 * Note that the mere existence of a class or interface in this
 * package does not in itself imply that it is intended for use by
 * third party code.  Please refer to the official product
 * documentation to indicate which APIs may be safely used by anyone
 * other than the core Directory Server developers.  Failure to heed
 * this warning may result in code that could have unintended side
 * effects or that does not work properly across different Directory
 * Server versions.
 */
package org.opends.server.api;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/authorization/dseecompat/Aci.java
@@ -40,7 +40,18 @@
        throw new RuntimeException("This class is not implemented");
    }
    public static Aci decode(ByteString valueOf, DN rootDN) throws AciException {
    /**
     * Decode an ACI byte string.
     *
     * @param byteString
     *            The ByteString containing the ACI string.
     * @param dn
     *            DN of the ACI entry.
     * @return Returns a decoded ACI representing the string argument.
     * @throws AciException
     *             If the parsing of the ACI string fails.
     */
    public static Aci decode(ByteString byteString, DN dn) throws AciException {
        throw new RuntimeException("This class is not implemented");
    }
}
opendj-sdk/opendj-admin/src/main/java/org/opends/server/authorization/dseecompat/AciException.java
@@ -24,20 +24,19 @@
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.authorization.dseecompat;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.types.IdentifiedException;
/**
 * The AciException class defines an exception that may be thrown
 * either during ACI syntax verification of an "aci" attribute type value
 * or during evaluation of an LDAP operation using a set of applicable
 * ACIs.
 * The AciException class defines an exception that may be thrown either during
 * ACI syntax verification of an "aci" attribute type value or during evaluation
 * of an LDAP operation using a set of applicable ACIs.
 */
public class AciException extends IdentifiedException {
  /**
   * The serial version identifier required to satisfy the compiler because this
   * class extends <CODE>java.lang.Exception</CODE>, which implements the
     * The serial version identifier required to satisfy the compiler because
     * this class extends <CODE>java.lang.Exception</CODE>, which implements the
   * <CODE>java.io.Serializable</CODE> interface.  This value was generated
   * using the <CODE>serialver</CODE> command-line utility included with the
   * Java SDK.
@@ -56,19 +55,20 @@
    /**
     * Creates a new ACI exception with the provided message.
     *
     * @param  message    The message to use for this ACI exception.
     * @param message
     *            The message to use for this ACI exception.
     */
    public AciException(LocalizableMessage message) {
      super(message);
    }
    /**
     * Creates a new ACI exception with the provided message and root
     * cause.
     * Creates a new ACI exception with the provided message and root cause.
     *
     * @param  message    The message that explains the problem that occurred.
     * @param  cause      The exception that was caught to trigger this
     *                    exception.
     * @param message
     *            The message that explains the problem that occurred.
     * @param cause
     *            The exception that was caught to trigger this exception.
     */
    public AciException(LocalizableMessage message, Throwable cause) {
      super(message, cause);
opendj-sdk/opendj-admin/src/main/java/org/opends/server/authorization/dseecompat/package-info.java
New file
@@ -0,0 +1,31 @@
/*
 * 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 legal-notices/CDDLv1_0.txt
 * or http://forgerock.org/license/CDDLv1.0.html.
 * 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 legal-notices/CDDLv1_0.txt.
 * 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.
 */
/**
 * Contains the Directory Server Sun Java System Directory Server Enterprise
 * Edition (dseecompat) compatability access control handler implementation.
 */
package org.opends.server.authorization.dseecompat;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/config/package-info.java
New file
@@ -0,0 +1,45 @@
/*
 * 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 legal-notices/CDDLv1_0.txt
 * or http://forgerock.org/license/CDDLv1.0.html.
 * 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 legal-notices/CDDLv1_0.txt.
 * 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-2008 Sun Microsystems, Inc.
 */
/**
 * Contains code used to interact with the Directory Server configuration.  This
 * includes various kinds of configuration attributes for different data types,
 * as well as the primary means of exposing configuration and operations over
 * JMX.  Further, it includes the code for the default configuration handler
 * which stores information in an LDIF file.
 * <BR><BR>
 * Whenever a configuration entry is modified, assuming that the result of the
 * modification is in conformance with the server schema, then any configurable
 * components and configuration change listeners associated with that entry will
 * be invoked and given an opportunity to reject that update if there is a
 * problem with it, or dynamically react to it by applying the new
 * configuration.  If a new configuration entry is added, then any configuration
 * add listeners associated with that entry's parent will be invoked.  If an
 * existing entry is removed, then any configuration delete listeners associated
 * with that entry's parent will be invoked.
 */
package org.opends.server.config;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/core/DirectoryServer.java
@@ -34,7 +34,11 @@
 * TODO : this is a stub, with some default implementations for some methods,
 * and no implementation for others.
 */
public class DirectoryServer {
public final class DirectoryServer {
    private DirectoryServer() {
        // no implementation yet
    }
    /**
     * Retrieves the attribute type for the provided lowercase name or OID. It
@@ -75,10 +79,20 @@
        return Schema.getDefaultSchema().getAttributeType(lowerName);
    }
    /**
     * Returns the directory of server instance.
     *
     * @return the instance root directory
     */
    public static String getInstanceRoot() {
        throw new RuntimeException("Not implemented");
    }
    /**
     * Returns the root directory of server.
     *
     * @return the server root directory
     */
    public static String getServerRoot() {
        throw new RuntimeException("Not implemented");
    }
opendj-sdk/opendj-admin/src/main/java/org/opends/server/core/package-info.java
New file
@@ -0,0 +1,54 @@
/*
 * 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 legal-notices/CDDLv1_0.txt
 * or http://forgerock.org/license/CDDLv1.0.html.
 * 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 legal-notices/CDDLv1_0.txt.
 * 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-2008 Sun Microsystems, Inc.
 */
/**
 * Contains various classes that comprise the core of the Directory Server
 * codebase.  This includes:
 * <BR>
 * <UL>
 *   <LI>
 *     The code that is invoked to initialize the various components of the
 *     Directory Server when it is started.
 *   </LI>
 *   <LI>
 *     The code that is invoked whenever the Directory Server is in the process
 *     of shutting down.
 *   </LI>
 *   <LI>
 *     The various types of operations that may be processed within the
 *     Directory Server.
 *   </LI>
 *   <LI>
 *     Data structures for important elements of Directory Server data,
 *     including attributes, objectclasses, DNs, entries.
 *   </LI>
 *   <LI>
 *     The implementation of the work queue and worker threads responsible for
 *     processing operations requested by clients.
 *   </LI>
 * </UL>
 */
package org.opends.server.core;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/types/AddressMask.java
@@ -289,8 +289,8 @@
            return true;
        }
        for (int i = 0; i < s.length; i++) {
            if (!hostName[i].equals("*")) // skip if wildcard
            {
            // skip if wildcard
            if (!hostName[i].equals("*")) {
                if (!s[i].equalsIgnoreCase(hostName[i])) {
                    return false;
                }
@@ -335,7 +335,7 @@
     *            The rule string containing all wildcards.
     */
    private void processAllWilds(final String rule) {
        final String s[] = rule.split("\\.", -1);
        final String []s = rule.split("\\.", -1);
        if (s.length == IN4ADDRSZ) {
            for (int i = 0; i < IN4ADDRSZ; i++) {
                wildCard.set(i);
@@ -354,7 +354,7 @@
     */
    private void processHost(final String rule) throws ConfigException {
        // Note that '*' is valid in host rule
        final String s[] = rule.split("^[0-9a-zA-z-.*]+");
        final String []s = rule.split("^[0-9a-zA-z-.*]+");
        if (s.length > 0) {
            final LocalizableMessage message = ERR_ADDRESSMASK_FORMAT_DECODE_ERROR.get();
            throw new ConfigException(message);
@@ -373,7 +373,7 @@
     */
    private void processHostPattern(final String rule) throws ConfigException {
        // quick check for invalid chars like " "
        final String s[] = rule.split("^[0-9a-zA-z-.]+");
        final String []s = rule.split("^[0-9a-zA-z-.]+");
        if (s.length > 0) {
            final LocalizableMessage message = ERR_ADDRESSMASK_FORMAT_DECODE_ERROR.get();
            throw new ConfigException(message);
opendj-sdk/opendj-admin/src/main/java/org/opends/server/types/OpenDsException.java
@@ -23,18 +23,14 @@
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 */
package org.opends.server.types;
import org.forgerock.i18n.LocalizableMessage;
/**
 * This class defines a base exception for OpenDS exceptions.
 */
public abstract class OpenDsException
        extends Exception
{
public abstract class OpenDsException extends Exception {
  /**
   * Generated serialization ID.
@@ -47,19 +43,17 @@
  /**
   * Creates a new identified exception.
   */
  protected OpenDsException()
  {
    protected OpenDsException() {
    super();
  }
  /**
   * Constructs a new instance from another
   * <code>OpenDsException</code>.
   * This constructor sets the message to be that of
   * <code>cause</code>.
     * Constructs a new instance from another <code>OpenDsException</code>. This
     * constructor sets the message to be that of <code>cause</code>.
   *
   * @param cause exception whose message will be used for
   *        this exception's message.
     * @param cause
     *            exception whose message will be used for this exception's
     *            message.
   */
  protected OpenDsException(OpenDsException cause) {
    this(null, cause);
@@ -68,41 +62,33 @@
  /**
   * Creates a new identified exception with the provided information.
   *
   * @param  message  The message that explains the problem that
   *                  occurred.
     * @param message
     *            The message that explains the problem that occurred.
   */
  protected OpenDsException(LocalizableMessage message)
  {
    protected OpenDsException(LocalizableMessage message) {
    this(message, null);
  }
  /**
   * Creates a new identified exception with the provided information.
   *
   * @param  cause  The underlying cause that triggered this
   *                exception.
     * @param cause
     *            The underlying cause that triggered this exception.
   */
  protected OpenDsException(Throwable cause)
  {
    protected OpenDsException(Throwable cause) {
    this(null, cause);
  }
  /**
   * Creates a new identified exception with the provided information.
   *
   * @param  message  The message that explains the problem that
   *                  occurred.
   * @param  cause    The underlying cause that triggered this
   *                  exception.
     * @param message
     *            The message that explains the problem that occurred.
     * @param cause
     *            The underlying cause that triggered this exception.
   */
  protected OpenDsException(LocalizableMessage message, Throwable cause)
  {
    super(message != null ? message.toString() :
            cause != null ? cause.getMessage() : null, cause);
    protected OpenDsException(LocalizableMessage message, Throwable cause) {
        super(message != null ? message.toString() : cause != null ? cause.getMessage() : null, cause);
    if (message != null) {
      this.message = message;
    } else if (cause instanceof OpenDsException) {
@@ -110,8 +96,6 @@
    }
  }
  /**
   * Returns the message that explains the problem that occurred.
   *
opendj-sdk/opendj-admin/src/main/java/org/opends/server/types/package-info.java
New file
@@ -0,0 +1,35 @@
/*
 * 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 legal-notices/CDDLv1_0.txt
 * or http://forgerock.org/license/CDDLv1.0.html.
 * 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 legal-notices/CDDLv1_0.txt.
 * 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-2008 Sun Microsystems, Inc.
 */
/**
 * Contains implementations for a number of Directory Server data
 * types.  Most, but not necessarily all, of these data types may be
 * considered part of the public API for use when extending the
 * Directory Server.  Please refer to the official documentation for
 * authoritative information on what classes are considered part of
 * the public API.
 */
package org.opends.server.types;
opendj-sdk/opendj-admin/src/main/java/org/opends/server/util/EmbeddedUtils.java
@@ -101,4 +101,10 @@
    public static void initializeForClientUse() {
        throw new RuntimeException("not implemented");
    }
    private EmbeddedUtils() {
        // no implementation required.
    }
}
opendj-sdk/opendj-admin/src/main/java/org/opends/server/util/package-info.java
New file
@@ -0,0 +1,58 @@
/*
 * 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 legal-notices/CDDLv1_0.txt
 * or http://forgerock.org/license/CDDLv1.0.html.
 * 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 legal-notices/CDDLv1_0.txt.
 * 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-2008 Sun Microsystems, Inc.
 */
/**
 * Contains implementations for various Directory Server utility classes and
 * methods which may be used throughout the server but do not necessarily fit in
 * elsewhere.  Notable utility classes include:
 * <BR>
 * <UL>
 *   <LI>
 *     StaticUtils.java -- a set of static methods that may be called to perform
 *     all kinds of useful operations on data (e.g., get a stack trace from an
 *     exception, or convert the contents of a byte array to a readable form).
 *   </LI>
 *   <LI>
 *     Base64.java -- provides a mechanism for performing base64 encoding and
 *     decoding.
 *   </LI>
 *   <LI>
 *     DynamicConstants.java -- a set of constants that are actually generated
 *     automatically at build time and reflect information about the time and
 *     conditions under which the server was built.
 *   </LI>
 *   <LI>
 *     TimeThread.java -- provides a thread that will periodically retrieve
 *     the current time and format it in several common methods in an attempt to
 *     minimize the need to have multiple calls to
 *     <CODE>System.currentTimeMillis()</CODE> or <CODE>new Date()</CODE>
 *     whenever the time is needed.  This thread updates internal variables
 *     several times each second, which should be sufficient for cases in which
 *     high-resolution timing is not required.
 *   </LI>
 * </UL>
 */
package org.opends.server.util;
opendj-sdk/opendj-admin/src/test/java/org/forgerock/opendj/config/ConfigurationMock.java
@@ -65,7 +65,7 @@
 */
public final class ConfigurationMock {
    private static final ConfigAnswer configAnswer = new ConfigAnswer();
    private static final ConfigAnswer CONFIG_ANSWER = new ConfigAnswer();
    /**
     * Returns a mock for the provided configuration class.
@@ -83,7 +83,7 @@
     * @return a mock
     */
    public static <T extends Configuration> T mockCfg(Class<T> configClass) {
        return mock(configClass, configAnswer);
        return mock(configClass, CONFIG_ANSWER);
    }
    /**
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/AbstractManagedObjectDefinitionTest.java
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/DNPropertyDefinitionTest.java
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/DurationPropertyDefinitionTest.java
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/DurationUnitTest.java
@@ -30,7 +30,8 @@
import static org.testng.Assert.*;
import org.forgerock.opendj.config.ConfigTestCase;
import org.testng.annotations.*;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@SuppressWarnings("javadoc")
public class DurationUnitTest extends ConfigTestCase {
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/IntegerPropertyDefinitionTest.java
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/MockLDAPProfile.java
@@ -25,8 +25,6 @@
 */
package org.opends.server.admin;
/**
 * A mock LDAP profile wrapper for testing purposes.
 */
@@ -43,8 +41,7 @@
   * {@inheritDoc}
   */
  @Override
  public String getAttributeName(AbstractManagedObjectDefinition<?, ?> d,
      PropertyDefinition<?> pd) {
    public String getAttributeName(AbstractManagedObjectDefinition<?, ?> d, PropertyDefinition<?> pd) {
    if (d == TestParentCfgDefn.getInstance()) {
      TestParentCfgDefn td = TestParentCfgDefn.getInstance();
@@ -53,14 +50,12 @@
        return "ds-cfg-enabled";
      } else if (pd == (PropertyDefinition<?>)td.getMandatoryClassPropertyPropertyDefinition()) {
        return "ds-cfg-java-class";
      } else if (pd == (PropertyDefinition<?>)td
          .getMandatoryReadOnlyAttributeTypePropertyPropertyDefinition()) {
            } else if (pd == (PropertyDefinition<?>) td.getMandatoryReadOnlyAttributeTypePropertyPropertyDefinition()) {
        return "ds-cfg-attribute-type";
      } else if (pd == (PropertyDefinition<?>)td.getOptionalMultiValuedDNPropertyPropertyDefinition()) {
        return "ds-cfg-base-dn";
      } else {
        throw new RuntimeException("Unexpected test-parent property"
            + pd.getName());
                throw new RuntimeException("Unexpected test-parent property" + pd.getName());
      }
    } else if (d == TestChildCfgDefn.getInstance()) {
      TestChildCfgDefn td = TestChildCfgDefn.getInstance();
@@ -69,8 +64,7 @@
        return "ds-cfg-enabled";
      } else if (pd == (PropertyDefinition<?>)td.getMandatoryClassPropertyPropertyDefinition()) {
        return "ds-cfg-java-class";
      } else if (pd == (PropertyDefinition<?>)td
          .getMandatoryReadOnlyAttributeTypePropertyPropertyDefinition()) {
            } else if (pd == (PropertyDefinition<?>) td.getMandatoryReadOnlyAttributeTypePropertyPropertyDefinition()) {
        return "ds-cfg-attribute-type";
      } else if (pd == (PropertyDefinition<?>)td.getOptionalMultiValuedDNProperty1PropertyDefinition()) {
        return "ds-cfg-base-dn";
@@ -79,8 +73,7 @@
      } else if (pd.getName().equals("aggregation-property")) {
        return "ds-cfg-rotation-policy";
      } else {
        throw new RuntimeException("Unexpected test-child property"
            + pd.getName());
                throw new RuntimeException("Unexpected test-child property" + pd.getName());
      }
    }
@@ -88,25 +81,19 @@
    return null;
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public String getRelationChildRDNType(
      InstantiableRelationDefinition<?, ?> r) {
    public String getRelationChildRDNType(InstantiableRelationDefinition<?, ?> r) {
    if (r == TestCfg.getTestOneToManyParentRelationDefinition()
        || r == TestParentCfgDefn.getInstance()
            .getTestChildrenRelationDefinition()) {
                || r == TestParentCfgDefn.getInstance().getTestChildrenRelationDefinition()) {
      return "cn";
    } else {
      return null;
    }
  }
  /**
   * {@inheritDoc}
   */
@@ -122,8 +109,6 @@
    }
  }
  /**
   * {@inheritDoc}
   */
@@ -133,11 +118,9 @@
      return "cn=test parents,cn=config";
    } else if (r == TestCfg.getTestOneToZeroOrOneParentRelationDefinition()) {
      return "cn=optional test parent,cn=config";
    } else if (r == TestParentCfgDefn.getInstance()
        .getTestChildrenRelationDefinition()) {
        } else if (r == TestParentCfgDefn.getInstance().getTestChildrenRelationDefinition()) {
      return "cn=test children";
    } else if (r == TestParentCfgDefn.getInstance()
        .getOptionalTestChildRelationDefinition()) {
        } else if (r == TestParentCfgDefn.getInstance().getOptionalTestChildRelationDefinition()) {
      return "cn=optional test child";
    } else {
      return null;
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/SizeUnitTest.java
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/TestCfg.java
@@ -43,8 +43,10 @@
     * A one-to-zero-or-one relation between the root and a test-parent
     * component.
     */
    // @Checkstyle:off
    private static final OptionalRelationDefinition<TestParentCfgClient, TestParentCfg>
        RD_TEST_ONE_TO_ZERO_OR_ONE_PARENT;
    // @Checkstyle:on
    // Create a one-to-many relation for test-parent components.
    static {
@@ -117,10 +119,12 @@
     * @return Returns the one-to-many relation between the root and test-parent
     *         components.
     */
    // @Checkstyle:off
    public static InstantiableRelationDefinition<TestParentCfgClient, TestParentCfg>
        getTestOneToManyParentRelationDefinition() {
            return RD_TEST_ONE_TO_MANY_PARENT;
    }
    // @Checkstyle:on
    /**
     * Gets the one-to-zero-or-one relation between the root and a test-parent
@@ -132,10 +136,12 @@
     * @return Returns the one-to-zero-or-one relation between the root and a
     *         test-parent component.
     */
    // @Checkstyle:off
    public static OptionalRelationDefinition<TestParentCfgClient, TestParentCfg>
        getTestOneToZeroOrOneParentRelationDefinition() {
            return RD_TEST_ONE_TO_ZERO_OR_ONE_PARENT;
    }
    // @Checkstyle:on
    /**
     * Initializes a property definition and its default behavior.
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/TestChildCfgDefn.java
@@ -53,8 +53,10 @@
    private static final TestChildCfgDefn INSTANCE = new TestChildCfgDefn();
    // The "aggregation-property" property definition.
    // @Checkstyle:off
    private static final AggregationPropertyDefinition<ConnectionHandlerCfgClient, ConnectionHandlerCfg>
        PROPDEF_AGGREGATION_PROPERTY;
    // @Checkstyle:on
    // The "mandatory-boolean-property" property definition.
    private static final BooleanPropertyDefinition PROPDEF_MANDATORY_BOOLEAN_PROPERTY;
@@ -199,10 +201,12 @@
     *
     * @return Returns the "aggregation-property" property definition.
     */
    // @Checkstyle:off
    public AggregationPropertyDefinition<ConnectionHandlerCfgClient, ConnectionHandlerCfg>
        getAggregationPropertyPropertyDefinition() {
            return PROPDEF_AGGREGATION_PROPERTY;
    }
    // @Checkstyle:on
    /**
     * Get the "mandatory-boolean-property" property definition.
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/ValidateConfigDefinitionsTest.java
@@ -78,7 +78,7 @@
    private static final List<String> CLASS_OBJECT_CLASS_EXCEPTIONS = Arrays.asList(new String[] {
            "org.opends.server.admin.std.meta.RootCfgDefn", "org.opends.server.admin.std.meta.GlobalCfgDefn", });
    // TODO : does not work because can retrieve object class objects
    // TODO : does not work because can't retrieve object class objects
    @Test(enabled = false, dataProvider = "enumerateManageObjectDefns")
    public void validateConfigObjectDefinitions(AbstractManagedObjectDefinition<?, ?> objectDef) {
        String objName = objectDef.getName();
@@ -98,9 +98,8 @@
                                + " instead of " + ldapObjectclassName).append(EOL + EOL);
            }
        }
        ObjectClass configObjectClass = Schema.getDefaultSchema().asNonStrictSchema().
                getObjectClass(ldapObjectclassName.toLowerCase());
        ;
        ObjectClass configObjectClass =
            Schema.getDefaultSchema().asNonStrictSchema().getObjectClass(ldapObjectclassName.toLowerCase());
        for (PropertyDefinition<?> propDef : allPropertyDefs) {
            validatePropertyDefinition(objectDef, configObjectClass, propDef, errors);
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/client/ldap/LDAPClientTest.java
@@ -268,8 +268,7 @@
            if (expectedExceptionClass.equals(ErrorResultException.class)) {
                assertThat(e).isInstanceOf(ErrorResultException.class);
                assertThat(((ErrorResultException) e).getResult().getResultCode()).isEqualTo(expectedCode);
            }
            else {
            } else {
                assertThat(e).isInstanceOf(expectedExceptionClass);
            }
        }
@@ -378,8 +377,7 @@
            if (expectedExceptionClass.equals(ErrorResultException.class)) {
                assertThat(e).isInstanceOf(ErrorResultException.class);
                assertThat(((ErrorResultException) e).getResult().getResultCode()).isEqualTo(expectedCode);
            }
            else {
            } else {
                assertThat(e).isInstanceOf(expectedExceptionClass);
            }
        }
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/client/ldap/MockLDAPConnection.java
@@ -241,7 +241,8 @@
            }
            @Override
            public <C extends Control> C getControl(ControlDecoder<C> decoder, DecodeOptions options) throws DecodeException {
            public <C extends Control> C getControl(ControlDecoder<C> decoder, DecodeOptions options)
                    throws DecodeException {
                throw new RuntimeException("not implemented");
            }
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/server/AdminTestCaseUtils.java
@@ -87,12 +87,13 @@
        }
    }
    // Construct a dummy path.
    private synchronized static <C extends ConfigurationClient, S extends Configuration> ManagedObjectPath<C, S> getPath(
            AbstractManagedObjectDefinition<C, S> d) {
    /** Construct a dummy path. */
    // @Checkstyle:off
    private synchronized static <C extends ConfigurationClient, S extends Configuration> ManagedObjectPath<C, S>
        getPath(AbstractManagedObjectDefinition<C, S> d) {
    // @Checkstyle:on
        if (!isProfileRegistered) {
            LDAPProfile.Wrapper profile = new LDAPProfile.Wrapper() {
                @Override
                public String getRelationRDNSequence(RelationDefinition<?, ?> r) {
                    if (r.getName().equals(DUMMY_TEST_RELATION)) {
@@ -103,15 +104,12 @@
                }
            };
            LDAPProfile.getInstance().pushWrapper(profile);
            isProfileRegistered = true;
        }
        SingletonRelationDefinition.Builder<C, S> builder = new SingletonRelationDefinition.Builder<C, S>(
                RootCfgDefn.getInstance(), DUMMY_TEST_RELATION, d);
        SingletonRelationDefinition.Builder<C, S> builder =
            new SingletonRelationDefinition.Builder<C, S>(RootCfgDefn.getInstance(), DUMMY_TEST_RELATION, d);
        ManagedObjectPath<?, ?> root = ManagedObjectPath.emptyPath();
        return root.child(builder.getInstance());
    }
}
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/server/AggregationServerTest.java
@@ -219,6 +219,7 @@
        "ds-cfg-enabled: true",
        "ds-cfg-listen-address: 0.0.0.0", "ds-cfg-listen-port: 389");
    // @Checkstyle:off
    /**
     * The default test child configuration "aggregation-property" property
     * definition.
@@ -235,6 +236,7 @@
    /** An aggregation where the target must be enabled. */
    private AggregationPropertyDefinition<ConnectionHandlerCfgClient, ConnectionHandlerCfg>
        aggregationPropertyDefinitionTargetMustBeEnabled = null;
    // @Checkstyle:on
    @BeforeClass
    public void setUp() throws Exception {
@@ -510,8 +512,10 @@
            TestParentCfg parentCfg = getParentCfg(entryName(TEST_PARENT_1), context);
            parentCfg.addTestChildDeleteListener(deleteListener);
            ArgumentCaptor<ConfigDeleteListener> registeredListener = ArgumentCaptor.forClass(ConfigDeleteListener.class);
            verify(configRepository).registerDeleteListener(eq(TEST_BASE_CHILD.getName()), registeredListener.capture());
            ArgumentCaptor<ConfigDeleteListener> registeredListener =
                ArgumentCaptor.forClass(ConfigDeleteListener.class);
            verify(configRepository).registerDeleteListener(eq(TEST_BASE_CHILD.getName()),
                registeredListener.capture());
            // Now simulate the delete ofthe referenced connection handler.
            assertThat(registeredListener.getValue().
@@ -545,7 +549,8 @@
            TestChildCfg testChildCfg = parentCfg.getTestChild(entryName(TEST_CHILD_7));
            testChildCfg.addChangeListener(changeListener);
            ArgumentCaptor<ConfigChangeListener> registeredListener = ArgumentCaptor.forClass(ConfigChangeListener.class);
            ArgumentCaptor<ConfigChangeListener> registeredListener =
                ArgumentCaptor.forClass(ConfigChangeListener.class);
            verify(configRepository).registerChangeListener(eq(TEST_CHILD_7.getName()), registeredListener.capture());
            // Now simulate the disabling ofthe referenced connection handler.
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/server/DNBuilderTest.java
@@ -60,7 +60,8 @@
    public void createWithInstantiableRelationDefinition() throws Exception {
        ManagedObjectPath<?,?> parentPath = ManagedObjectPath.emptyPath().
                child(TestCfg.getTestOneToManyParentRelationDefinition(), "test-parent-1");
        ManagedObjectPath<?,?> childPath = parentPath.child(TestParentCfgDefn.getInstance().getTestChildrenRelationDefinition(), "test-child-1");
        ManagedObjectPath<?, ?> childPath = parentPath.child(TestParentCfgDefn.getInstance().
            getTestChildrenRelationDefinition(), "test-child-1");
        assertEquals(
            DNBuilder.create(childPath),
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/server/DefaultBehaviorTest.java
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/server/ListenerTest.java