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

Matthew Swift
18.58.2014 a94c41b1759c23f849376a5f5448bc6e819f1c11
Simplify config framework exception hierarchy by removing and pulling up the following exceptions:

* DefaultBehaviorException
* IllegalPropertyValueException
* IllegalPropertyValueStringException
* PropertyIsMandatoryException
* PropertyIsReadOnlyException
* PropertyIsSingleValuedException
* UnknownPropertyDefinitionException
7 files deleted
44 files modified
1073 ■■■■■ changed files
opendj-config-maven-plugin/src/main/resources/config/stylesheets/clientMO.xsl 18 ●●●● patch | view | raw | blame | history
opendj-config-maven-plugin/src/main/resources/config/stylesheets/metaMO.xsl 12 ●●●● patch | view | raw | blame | history
opendj-config-maven-plugin/src/main/resources/config/stylesheets/property-types.xsl 16 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/ACIPropertyDefinition.java 2 ●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/AggregationPropertyDefinition.java 8 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/AttributeTypePropertyDefinition.java 6 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/BooleanPropertyDefinition.java 2 ●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/ClassPropertyDefinition.java 14 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/DNPropertyDefinition.java 6 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/DefaultBehaviorException.java 61 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/DurationPropertyDefinition.java 14 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/EnumPropertyDefinition.java 2 ●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/IPAddressMaskPropertyDefinition.java 2 ●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/IPAddressPropertyDefinition.java 2 ●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/IllegalPropertyValueException.java 90 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/IllegalPropertyValueStringException.java 90 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/IntegerPropertyDefinition.java 12 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyDefinition.java 8 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyDefinitionVisitor.java 6 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyException.java 137 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyIsMandatoryException.java 50 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyIsReadOnlyException.java 50 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyIsSingleValuedException.java 50 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyValueVisitor.java 6 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/Reference.java 2 ●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/SizePropertyDefinition.java 12 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/StringPropertyDefinition.java 6 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/UnknownPropertyDefinitionException.java 65 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/client/IllegalManagedObjectNameException.java 4 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/client/ManagedObject.java 27 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/client/MissingMandatoryPropertiesException.java 16 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/client/ldap/LDAPDriver.java 20 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/AbstractManagedObject.java 27 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/Driver.java 46 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/PropertySet.java 14 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/server/ServerManagementContext.java 47 ●●●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/AttributeTypePropertyDefinitionTest.java 2 ●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/BooleanPropertyDefinitionTest.java 2 ●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/ClassPropertyDefinitionTest.java 2 ●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/DNPropertyDefinitionTest.java 4 ●●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/DurationPropertyDefinitionTest.java 10 ●●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/EnumPropertyDefinitionTest.java 2 ●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/IntegerPropertyDefinitionTest.java 8 ●●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/SizePropertyDefinitionTest.java 8 ●●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/StringPropertyDefinitionTest.java 4 ●●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/TestChildCfgClient.java 28 ●●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/TestChildCfgDefn.java 2 ●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/TestParentCfgClient.java 28 ●●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/TestParentCfgDefn.java 6 ●●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/client/ldap/AggregationClientTest.java 8 ●●●●● patch | view | raw | blame | history
opendj-config/src/test/java/org/forgerock/opendj/config/server/AggregationServerTest.java 9 ●●●●● patch | view | raw | blame | history
opendj-config-maven-plugin/src/main/resources/config/stylesheets/clientMO.xsl
@@ -181,14 +181,14 @@
                       '         The definition of the ', $ufn,' to be created.
',
                       '@param exceptions
',
                       '         An optional collection in which to place any ',
                       '{@link DefaultBehaviorException}s that occurred whilst ',
                       '{@link PropertyException}s that occurred whilst ',
                       'attempting to determine the default values of the ', $ufn,
                       '. This argument can be <code>null<code>.
',
                       '@return Returns a new ', $ufn,' configuration instance.
')" />
        </xsl:call-template>
        <xsl:value-of
          select="concat('  &lt;C extends ', $java-class-name,'CfgClient&gt; C create', $java-relation-name, '(&#xa;',
                           '      ManagedObjectDefinition&lt;C, ? extends ', $java-class-name,'Cfg&gt; d, Collection&lt;DefaultBehaviorException&gt; exceptions);&#xa;')" />
                           '      ManagedObjectDefinition&lt;C, ? extends ', $java-class-name,'Cfg&gt; d, Collection&lt;PropertyException&gt; exceptions);&#xa;')" />
        <xsl:text>&#xa;</xsl:text>
        <xsl:text>&#xa;</xsl:text>
        <xsl:text>&#xa;</xsl:text>
@@ -291,7 +291,7 @@
                           '         The name of the new ', $ufn,'.&#xa;',
                           '@param exceptions&#xa;',
                           '         An optional collection in which to place any ',
                           '{@link DefaultBehaviorException}s that occurred whilst ',
                           '{@link PropertyException}s that occurred whilst ',
                           'attempting to determine the default values of the ', $ufn,
                           '. This argument can be &lt;code&gt;null&lt;code&gt;.&#xa;',
                           '@return Returns a new ', $ufn,' configuration instance.&#xa;',
@@ -300,7 +300,7 @@
            </xsl:call-template>
            <xsl:value-of
              select="concat('  &lt;C extends ', $java-class-name,'CfgClient&gt; C create', $java-relation-name, '(&#xa;',
                               '      ManagedObjectDefinition&lt;C, ? extends ', $java-class-name,'Cfg&gt; d, String name, Collection&lt;DefaultBehaviorException&gt; exceptions) throws IllegalManagedObjectNameException;&#xa;')" />
                               '      ManagedObjectDefinition&lt;C, ? extends ', $java-class-name,'Cfg&gt; d, String name, Collection&lt;PropertyException&gt; exceptions) throws IllegalManagedObjectNameException;&#xa;')" />
          </xsl:when>
          <xsl:when test="string(adm:one-to-many/@unique) = 'true'">
            <xsl:call-template name="add-java-comment2">
@@ -319,14 +319,14 @@
                           '         The definition of the ', $ufn,' to be created.&#xa;',
                           '@param exceptions&#xa;',
                           '         An optional collection in which to place any ',
                           '{@link DefaultBehaviorException}s that occurred whilst ',
                           '{@link PropertyException}s that occurred whilst ',
                           'attempting to determine the default values of the ', $ufn,
                           '. This argument can be &lt;code&gt;null&lt;code&gt;.&#xa;',
                           '@return Returns a new ', $ufn,' configuration instance.&#xa;')" />
            </xsl:call-template>
            <xsl:value-of
              select="concat('  &lt;C extends ', $java-class-name,'CfgClient&gt; C create', $java-relation-name, '(&#xa;',
                               '      ManagedObjectDefinition&lt;C, ? extends ', $java-class-name,'Cfg&gt; d, Collection&lt;DefaultBehaviorException&gt; exceptions);&#xa;')" />
                               '      ManagedObjectDefinition&lt;C, ? extends ', $java-class-name,'Cfg&gt; d, Collection&lt;PropertyException&gt; exceptions);&#xa;')" />
          </xsl:when>
        </xsl:choose>
        <xsl:text>&#xa;</xsl:text>
@@ -386,12 +386,12 @@
        <xsl:if
          test="$this-local-properties[not(@monitoring='true')]">
          <import>
            org.forgerock.opendj.config.IllegalPropertyValueException
            org.forgerock.opendj.config.PropertyException
          </import>
        </xsl:if>
        <xsl:if test="$this-local-properties[@read-only='true']">
          <import>
            org.forgerock.opendj.config.PropertyIsReadOnlyException
            org.forgerock.opendj.config.PropertyException
          </import>
        </xsl:if>
        <xsl:if test="$this-local-relations">
@@ -428,7 +428,7 @@
          test="$this-local-relations/adm:one-to-zero-or-one|$this-local-relations/adm:one-to-many">
          <import>java.util.Collection</import>
          <import>
            org.forgerock.opendj.config.DefaultBehaviorException
            org.forgerock.opendj.config.PropertyException
          </import>
          <import>
            org.forgerock.opendj.config.client.OperationRejectedException
opendj-config-maven-plugin/src/main/resources/config/stylesheets/metaMO.xsl
@@ -1225,7 +1225,7 @@
                         '     * {@inheritDoc}&#xa;',
                         '     */&#xa;',
                         '    public &lt;M extends ', $java-class-name, 'CfgClient&gt; M create', $java-relation-name, '(&#xa;',
                         '        ManagedObjectDefinition&lt;M, ? extends ', $java-class-name,'Cfg&gt; d, Collection&lt;DefaultBehaviorException&gt; exceptions) {&#xa;',
                         '        ManagedObjectDefinition&lt;M, ? extends ', $java-class-name,'Cfg&gt; d, Collection&lt;PropertyException&gt; exceptions) {&#xa;',
                         '      return impl.createChild(INSTANCE.get', $java-relation-name,'RelationDefinition(), d, exceptions).getConfiguration();&#xa;',
                         '    }&#xa;')" />
        <xsl:text>&#xa;</xsl:text>
@@ -1280,7 +1280,7 @@
                             '     * {@inheritDoc}&#xa;',
                             '     */&#xa;',
                             '    public &lt;M extends ', $java-class-name, 'CfgClient&gt; M create', $java-relation-name, '(&#xa;',
                             '        ManagedObjectDefinition&lt;M, ? extends ', $java-class-name,'Cfg&gt; d, String name, Collection&lt;DefaultBehaviorException&gt; exceptions) throws IllegalManagedObjectNameException {&#xa;',
                             '        ManagedObjectDefinition&lt;M, ? extends ', $java-class-name,'Cfg&gt; d, String name, Collection&lt;PropertyException&gt; exceptions) throws IllegalManagedObjectNameException {&#xa;',
                             '      return impl.createChild(INSTANCE.get', $java-relation-plural-name,'RelationDefinition(), d, name, exceptions).getConfiguration();&#xa;',
                             '    }&#xa;')" />
          </xsl:when>
@@ -1291,7 +1291,7 @@
                             '     * {@inheritDoc}&#xa;',
                             '     */&#xa;',
                             '    public &lt;M extends ', $java-class-name, 'CfgClient&gt; M create', $java-relation-name, '(&#xa;',
                             '        ManagedObjectDefinition&lt;M, ? extends ', $java-class-name,'Cfg&gt; d, Collection&lt;DefaultBehaviorException&gt; exceptions) {&#xa;',
                             '        ManagedObjectDefinition&lt;M, ? extends ', $java-class-name,'Cfg&gt; d, Collection&lt;PropertyException&gt; exceptions) {&#xa;',
                             '      return impl.createChild(INSTANCE.get', $java-relation-plural-name,'RelationDefinition(), d, exceptions).getConfiguration();&#xa;',
                             '    }&#xa;')" />
          </xsl:when>
@@ -1964,7 +1964,7 @@
                </import>
              </xsl:if>
              <import>
                org.forgerock.opendj.config.DefaultBehaviorException
                org.forgerock.opendj.config.PropertyException
              </import>
              <import>
                org.forgerock.opendj.config.server.ConfigurationAddListener
@@ -1977,7 +1977,7 @@
            <xsl:if test="$this-all-relations/adm:one-to-zero-or-one">
              <import>java.util.Collection</import>
              <import>
                org.forgerock.opendj.config.DefaultBehaviorException
                org.forgerock.opendj.config.PropertyException
              </import>
              <import>
                org.forgerock.opendj.config.server.ConfigurationAddListener
@@ -1996,7 +1996,7 @@
            </xsl:if>
            <xsl:if test="$this-all-properties[@read-only='true']">
              <import>
                org.forgerock.opendj.config.PropertyIsReadOnlyException
                org.forgerock.opendj.config.PropertyException
              </import>
            </xsl:if>
          </xsl:otherwise>
opendj-config-maven-plugin/src/main/resources/config/stylesheets/property-types.xsl
@@ -519,12 +519,12 @@
          <xsl:value-of
            select="concat('   *&#xa;',
                     '   * @param value The value of the &quot;', $name, '&quot; property.&#xa;',
                     '   * @throws IllegalPropertyValueException&#xa;',
                     '   * @throws PropertyException&#xa;',
                     '   *           If the new value is invalid.&#xa;')" />
          <xsl:if test="@read-only='true'">
            <xsl:value-of
              select="concat(
                     '   * @throws PropertyIsReadOnlyException&#xa;',
                     '   * @throws PropertyException&#xa;',
                     '   *           If this ', $this-ufn, ' is not being initialized.&#xa;')" />
          </xsl:if>
          <xsl:value-of
@@ -546,12 +546,12 @@
          <xsl:value-of
            select="concat('   *&#xa;',
                     '   * @param values The values of the &quot;', $name, '&quot; property.&#xa;',
                     '   * @throws IllegalPropertyValueException&#xa;',
                     '   * @throws PropertyException&#xa;',
                     '   *           If one or more of the new values are invalid.&#xa;')" />
          <xsl:if test="@read-only='true'">
            <xsl:value-of
              select="concat(
                     '   * @throws PropertyIsReadOnlyException&#xa;',
                     '   * @throws PropertyException&#xa;',
                     '   *           If this ', $this-ufn, ' is not being initialized.&#xa;')" />
          </xsl:if>
          <xsl:value-of
@@ -562,9 +562,9 @@
          <xsl:value-of select="'&gt; values'" />
        </xsl:otherwise>
      </xsl:choose>
      <xsl:value-of select="') throws IllegalPropertyValueException'" />
      <xsl:value-of select="') throws PropertyException'" />
      <xsl:if test="@read-only='true'">
        <xsl:value-of select="', PropertyIsReadOnlyException'" />
        <xsl:value-of select="', PropertyException'" />
      </xsl:if>
      <xsl:value-of select="';&#xa;'" />
    </xsl:if>
@@ -606,7 +606,7 @@
          <xsl:value-of select="' value)'" />
          <xsl:if test="@read-only='true'">
            <xsl:value-of
              select="' throws PropertyIsReadOnlyException'" />
              select="' throws PropertyException'" />
          </xsl:if>
          <xsl:value-of
            select="concat(' {&#xa;' ,
@@ -621,7 +621,7 @@
          <xsl:value-of select="'&gt; values)'" />
          <xsl:if test="@read-only='true'">
            <xsl:value-of
              select="' throws PropertyIsReadOnlyException'" />
              select="' throws PropertyException'" />
          </xsl:if>
          <xsl:value-of
            select="concat(' {&#xa;' ,
opendj-config/src/main/java/org/forgerock/opendj/config/ACIPropertyDefinition.java
@@ -102,7 +102,7 @@
            return Aci.decode(ByteString.valueOf(value), DN.rootDN());
        } catch (LocalizedIllegalArgumentException e) {
            // TODO: it would be nice to throw the cause.
            throw new IllegalPropertyValueStringException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
opendj-config/src/main/java/org/forgerock/opendj/config/AggregationPropertyDefinition.java
@@ -818,8 +818,8 @@
        try {
            validateValue(value, options);
            return value;
        } catch (IllegalPropertyValueException e) {
            throw new IllegalPropertyValueStringException(this, value);
        } catch (PropertyException e) {
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
@@ -952,7 +952,7 @@
            Reference<C, S> reference = Reference.parseName(parentPath, relationDefinition, value);
            return reference.getNormalizedName();
        } catch (IllegalArgumentException e) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
@@ -984,7 +984,7 @@
        try {
            Reference.parseName(parentPath, relationDefinition, value);
        } catch (IllegalArgumentException e) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
opendj-config/src/main/java/org/forgerock/opendj/config/AttributeTypePropertyDefinition.java
@@ -116,13 +116,13 @@
        AttributeType type = DirectoryServer.getAttributeType(name, !options.checkSchemaForAttributes());
        if (type == null) {
            throw new IllegalPropertyValueStringException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        } else {
            try {
                validateValue(type, options);
                return type;
            } catch (IllegalPropertyValueException e) {
                throw new IllegalPropertyValueStringException(this, value);
            } catch (PropertyException e) {
                throw PropertyException.illegalPropertyValueException(this, value);
            }
        }
    }
opendj-config/src/main/java/org/forgerock/opendj/config/BooleanPropertyDefinition.java
@@ -114,7 +114,7 @@
        Boolean b = VALUE_MAP.get(nvalue);
        if (b == null) {
            throw new IllegalPropertyValueStringException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        } else {
            return b;
        }
opendj-config/src/main/java/org/forgerock/opendj/config/ClassPropertyDefinition.java
@@ -157,8 +157,8 @@
        try {
            validateValue(value, options);
        } catch (IllegalPropertyValueException e) {
            throw new IllegalPropertyValueStringException(this, value, e.getCause());
        } catch (PropertyException e) {
            throw PropertyException.illegalPropertyValueException(this, value, e.getCause());
        }
        return value;
@@ -187,7 +187,7 @@
     *            The class representing the requested type.
     * @return Returns the named class cast to a subclass of the specified
     *         class.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If the named class was invalid, could not be loaded, or did
     *             not implement the required interfaces.
     * @throws ClassCastException
@@ -240,7 +240,7 @@
    private void validateClassName(String className) {
        String nvalue = className.trim();
        if (!nvalue.matches(CLASS_RE)) {
            throw new IllegalPropertyValueException(this, className);
            throw PropertyException.illegalPropertyValueException(this, className);
        }
    }
@@ -253,7 +253,7 @@
        for (String i : instanceOfInterfaces) {
            Class<?> instanceOfClass = loadClassForValidation(className, i, initialize);
            if (!instanceOfClass.isAssignableFrom(theClass)) {
                throw new IllegalPropertyValueException(this, className);
                throw PropertyException.illegalPropertyValueException(this, className);
            }
        }
        return theClass;
@@ -264,10 +264,10 @@
            return loadClass(classToBeLoaded.trim(), initialize);
        } catch (ClassNotFoundException e) {
            // If the class cannot be loaded then it is an invalid value.
            throw new IllegalPropertyValueException(this, componentClassName, e);
            throw PropertyException.illegalPropertyValueException(this, componentClassName, e);
        } catch (LinkageError e) {
            // If the class cannot be initialized then it is an invalid value.
            throw new IllegalPropertyValueException(this, componentClassName, e);
            throw PropertyException.illegalPropertyValueException(this, componentClassName, e);
        }
    }
}
opendj-config/src/main/java/org/forgerock/opendj/config/DNPropertyDefinition.java
@@ -145,7 +145,7 @@
            }
            if (!parent.equals(baseDN)) {
                throw new IllegalPropertyValueException(this, value);
                throw PropertyException.illegalPropertyValueException(this, value);
            }
        }
    }
@@ -161,8 +161,8 @@
            DN dn = DN.valueOf(value);
            validateValue(dn, options);
            return dn;
        } catch (IllegalPropertyValueException e) {
            throw new IllegalPropertyValueStringException(this, value);
        } catch (PropertyException e) {
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
opendj-config/src/main/java/org/forgerock/opendj/config/DefaultBehaviorException.java
File was deleted
opendj-config/src/main/java/org/forgerock/opendj/config/DurationPropertyDefinition.java
@@ -397,15 +397,15 @@
        long nvalue = baseUnit.toMilliSeconds(value);
        if (!allowUnlimited && nvalue < lowerLimit) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
            // unlimited allowed
        } else if (nvalue >= 0 && nvalue < lowerLimit) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        if ((upperLimit != null) && (nvalue > upperLimit)) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
@@ -451,21 +451,21 @@
        try {
            ms = DurationUnit.parseValue(value);
        } catch (NumberFormatException e) {
            throw new IllegalPropertyValueStringException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        // Check the unit is in range - values must not be more granular
        // than the base unit.
        if ((ms % baseUnit.getDuration()) != 0) {
            throw new IllegalPropertyValueStringException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        // Convert the value a long in the property's required unit.
        Long i = (long) baseUnit.fromMilliSeconds(ms);
        try {
            validateValue(i, options);
        } catch (IllegalPropertyValueException e) {
            throw new IllegalPropertyValueStringException(this, value);
        } catch (PropertyException e) {
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        return i;
    }
opendj-config/src/main/java/org/forgerock/opendj/config/EnumPropertyDefinition.java
@@ -156,7 +156,7 @@
        String nvalue = value.trim().toLowerCase();
        E eValue = decodeMap.get(nvalue);
        if (eValue == null) {
            throw new IllegalPropertyValueStringException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        } else {
            return eValue;
        }
opendj-config/src/main/java/org/forgerock/opendj/config/IPAddressMaskPropertyDefinition.java
@@ -103,7 +103,7 @@
            return AddressMask.decode(value);
        } catch (ConfigException e) {
            // TODO: it would be nice to throw the cause.
            throw new IllegalPropertyValueStringException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
opendj-config/src/main/java/org/forgerock/opendj/config/IPAddressPropertyDefinition.java
@@ -102,7 +102,7 @@
            return InetAddress.getByName(value);
        } catch (UnknownHostException e) {
            // TODO: it would be nice to throw the cause.
            throw new IllegalPropertyValueStringException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
opendj-config/src/main/java/org/forgerock/opendj/config/IllegalPropertyValueException.java
File was deleted
opendj-config/src/main/java/org/forgerock/opendj/config/IllegalPropertyValueStringException.java
File was deleted
opendj-config/src/main/java/org/forgerock/opendj/config/IntegerPropertyDefinition.java
@@ -233,15 +233,15 @@
        Reject.ifNull(value);
        if (!allowUnlimited && value < lowerLimit) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
            // unlimited allowed
        } else if (value >= 0 && value < lowerLimit) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        if ((upperLimit != null) && (value > upperLimit)) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
@@ -279,13 +279,13 @@
        try {
            i = Integer.valueOf(value);
        } catch (NumberFormatException e) {
            throw new IllegalPropertyValueStringException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        try {
            validateValue(i, options);
        } catch (IllegalPropertyValueException e) {
            throw new IllegalPropertyValueStringException(this, value);
        } catch (PropertyException e) {
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        return i;
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyDefinition.java
@@ -321,7 +321,7 @@
     * @param options
     *            Options to use when decoding value.
     * @return Returns the decoded property value.
     * @throws IllegalPropertyValueStringException
     * @throws PropertyException
     *             If the property value string is invalid.
     */
    public abstract T decodeValue(String value, PropertyDefinitionsOptions options);
@@ -335,7 +335,7 @@
     * @param value
     *            The property value (must not be <code>null</code>).
     * @return Returns the encoded property string value.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If the property value is invalid.
     */
    public String encodeValue(T value) {
@@ -520,7 +520,7 @@
     * @param value
     *            The property value to be normalized.
     * @return Returns the normalized property value.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If the property value is invalid.
     */
    public String normalizeValue(T value) {
@@ -566,7 +566,7 @@
     *            The property value (must not be <code>null</code>).
     * @param options
     *            Options to use when decoding value.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If the property value is invalid.
     */
    public abstract void validateValue(T value, PropertyDefinitionsOptions options);
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyDefinitionVisitor.java
@@ -242,7 +242,7 @@
     * types.
     * <p>
     * The default implementation of this method throws an
     * {@link UnknownPropertyDefinitionException}. Sub-classes can override this
     * {@link PropertyException}. Sub-classes can override this
     * method with their own default behavior.
     *
     * @param <T>
@@ -252,11 +252,11 @@
     * @param p
     *            A visitor specified parameter.
     * @return Returns a visitor specified result.
     * @throws UnknownPropertyDefinitionException
     * @throws PropertyException
     *             Visitor implementations may optionally throw this exception.
     */
    public <T> R visitUnknown(PropertyDefinition<T> pd, P p) {
        throw new UnknownPropertyDefinitionException(pd, p);
        throw PropertyException.unknownPropertyDefinitionException(pd, p);
    }
}
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyException.java
@@ -26,49 +26,140 @@
package org.forgerock.opendj.config;
import static com.forgerock.opendj.ldap.AdminMessages.ERR_DEFAULT_BEHAVIOR_PROPERTY_EXCEPTION;
import static com.forgerock.opendj.ldap.AdminMessages.ERR_ILLEGAL_PROPERTY_VALUE_EXCEPTION;
import static com.forgerock.opendj.ldap.AdminMessages.ERR_PROPERTY_IS_MANDATORY_EXCEPTION;
import static com.forgerock.opendj.ldap.AdminMessages.ERR_PROPERTY_IS_READ_ONLY_EXCEPTION;
import static com.forgerock.opendj.ldap.AdminMessages.ERR_PROPERTY_IS_SINGLE_VALUED_EXCEPTION;
import static com.forgerock.opendj.ldap.AdminMessages.ERR_UNKNOWN_PROPERTY_DEFINITION_EXCEPTION;
import org.forgerock.i18n.LocalizableMessage;
/**
 * Exceptions thrown as a result of errors that occurred when decoding and
 * modifying property values.
 */
public abstract class PropertyException extends AdminRuntimeException {
public final class PropertyException extends AdminRuntimeException {
    /**
     * Version ID required by serializable classes.
     */
    private static final long serialVersionUID = -8465109598081914482L;
    /**
     * Creates a new default behavior exception with a cause.
     *
     * @param pd
     *            The property definition whose default values could not be
     *            determined.
     * @param cause
     *            The exception that prevented the default values from being
     *            determined.
     * @return A new default behavior exception with a cause.
     */
    public static PropertyException defaultBehaviorException(final PropertyDefinition<?> pd,
            final Throwable cause) {
        return new PropertyException(pd, ERR_DEFAULT_BEHAVIOR_PROPERTY_EXCEPTION.get(pd.getName()),
                cause);
    }
    /**
     * Creates a new illegal property value exception.
     *
     * @param pd
     *            The property definition.
     * @param value
     *            The illegal property value.
     * @return A new illegal property value exception.
     */
    public static PropertyException illegalPropertyValueException(final PropertyDefinition<?> pd,
            final Object value) {
        return new PropertyException(pd, createMessage(pd, value));
    }
    /**
     * Creates a new illegal property value exception.
     *
     * @param pd
     *            The property definition.
     * @param value
     *            The illegal property value.
     * @param cause
     *            The cause.
     * @return A new illegal property value exception.
     */
    public static PropertyException illegalPropertyValueException(final PropertyDefinition<?> pd,
            final Object value, final Throwable cause) {
        return new PropertyException(pd, createMessage(pd, value), cause);
    }
    /**
     * Create a new property is mandatory exception.
     *
     * @param pd
     *            The property definition.
     * @return A new property is mandatory exception.
     */
    public static PropertyException propertyIsMandatoryException(final PropertyDefinition<?> pd) {
        return new PropertyException(pd, ERR_PROPERTY_IS_MANDATORY_EXCEPTION.get(pd.getName()));
    }
    /**
     * Create a new property is read-only exception.
     *
     * @param pd
     *            The property definition.
     * @return A new property is read-only exception.
     */
    public static PropertyException propertyIsReadOnlyException(final PropertyDefinition<?> pd) {
        return new PropertyException(pd, ERR_PROPERTY_IS_READ_ONLY_EXCEPTION.get(pd.getName()));
    }
    /**
     * Create a new property is single valued exception.
     *
     * @param pd
     *            The property definition.
     * @return A new property is single valued exception.
     */
    public static PropertyException propertyIsSingleValuedException(final PropertyDefinition<?> pd) {
        return new PropertyException(pd, ERR_PROPERTY_IS_SINGLE_VALUED_EXCEPTION.get(pd.getName()));
    }
    /**
     * Creates a new unknown property definition exception.
     *
     * @param pd
     *            The unknown property definition.
     * @param p
     *            The visitor parameter if there was one.
     * @return A new unknown property definition exception.
     */
    public static PropertyException unknownPropertyDefinitionException(
            final PropertyDefinition<?> pd, final Object p) {
        return new PropertyException(pd, ERR_UNKNOWN_PROPERTY_DEFINITION_EXCEPTION.get(
                pd.getName(), pd.getClass().getName()));
    }
    // Create the message.
    private static LocalizableMessage createMessage(final PropertyDefinition<?> pd,
            final Object value) {
        final PropertyDefinitionUsageBuilder builder = new PropertyDefinitionUsageBuilder(true);
        return ERR_ILLEGAL_PROPERTY_VALUE_EXCEPTION.get(String.valueOf(value), pd.getName(),
                builder.getUsage(pd));
    }
    // The property definition associated with the property that caused
    // the exception.
    private final PropertyDefinition<?> pd;
    /**
     * Creates property exception without a cause.
     *
     * @param pd
     *            The property definition associated with the property that
     *            caused the exception.
     * @param message
     *            The message.
     */
    protected PropertyException(PropertyDefinition<?> pd, LocalizableMessage message) {
    private PropertyException(final PropertyDefinition<?> pd, final LocalizableMessage message) {
        super(message);
        this.pd = pd;
    }
    /**
     * Creates property exception with a cause.
     *
     * @param pd
     *            The property definition associated with the property that
     *            caused the exception.
     * @param message
     *            The message.
     * @param cause
     *            The cause.
     */
    protected PropertyException(PropertyDefinition<?> pd, LocalizableMessage message, Throwable cause) {
    private PropertyException(final PropertyDefinition<?> pd, final LocalizableMessage message,
            final Throwable cause) {
        super(message, cause);
        this.pd = pd;
    }
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyIsMandatoryException.java
File was deleted
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyIsReadOnlyException.java
File was deleted
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyIsSingleValuedException.java
File was deleted
opendj-config/src/main/java/org/forgerock/opendj/config/PropertyValueVisitor.java
@@ -274,7 +274,7 @@
     * 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
     * {@link PropertyException}. Sub-classes can override this
     * method with their own default behavior.
     *
     * @param <T>
@@ -286,11 +286,11 @@
     * @param p
     *            A visitor specified parameter.
     * @return Returns a visitor specified result.
     * @throws UnknownPropertyDefinitionException
     * @throws PropertyException
     *             Visitor implementations may optionally throw this exception.
     */
    public <T> R visitUnknown(PropertyDefinition<T> pd, T v, P p) {
        throw new UnknownPropertyDefinitionException(pd, p);
        throw PropertyException.unknownPropertyDefinitionException(pd, p);
    }
}
opendj-config/src/main/java/org/forgerock/opendj/config/Reference.java
@@ -192,7 +192,7 @@
                // TODO : is it correct to have no validation ?
                T tvalue = pd.decodeValue(name, PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
                return pd.normalizeValue(tvalue);
            } catch (IllegalPropertyValueStringException e) {
            } catch (PropertyException e) {
                // Fall through to default normalization.
            }
        }
opendj-config/src/main/java/org/forgerock/opendj/config/SizePropertyDefinition.java
@@ -234,15 +234,15 @@
        Reject.ifNull(value);
        if (!allowUnlimited && value < lowerLimit) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
            // unlimited allowed
        } else if (value >= 0 && value < lowerLimit) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        if ((upperLimit != null) && (value > upperLimit)) {
            throw new IllegalPropertyValueException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
@@ -291,13 +291,13 @@
        try {
            i = SizeUnit.parseValue(value, SizeUnit.BYTES);
        } catch (NumberFormatException e) {
            throw new IllegalPropertyValueStringException(this, value);
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        try {
            validateValue(i, options);
        } catch (IllegalPropertyValueException e) {
            throw new IllegalPropertyValueStringException(this, value);
        } catch (PropertyException e) {
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        return i;
    }
opendj-config/src/main/java/org/forgerock/opendj/config/StringPropertyDefinition.java
@@ -175,8 +175,8 @@
        try {
            validateValue(value, options);
        } catch (IllegalPropertyValueException e) {
            throw new IllegalPropertyValueStringException(this, value);
        } catch (PropertyException e) {
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        return value;
@@ -275,7 +275,7 @@
        if (pattern != null) {
            Matcher matcher = pattern.matcher(value);
            if (!matcher.matches()) {
                throw new IllegalPropertyValueException(this, value);
                throw PropertyException.illegalPropertyValueException(this, value);
            }
        }
    }
opendj-config/src/main/java/org/forgerock/opendj/config/UnknownPropertyDefinitionException.java
File was deleted
opendj-config/src/main/java/org/forgerock/opendj/config/client/IllegalManagedObjectNameException.java
@@ -28,7 +28,7 @@
import static com.forgerock.opendj.ldap.AdminMessages.*;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.config.IllegalPropertyValueStringException;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.OperationsException;
import org.forgerock.opendj.config.PropertyDefinition;
import org.forgerock.opendj.config.PropertyDefinitionUsageBuilder;
@@ -60,7 +60,7 @@
        } else if (namingPropertyDefinition != null) {
            try {
                namingPropertyDefinition.decodeValue(illegalName, options);
            } catch (IllegalPropertyValueStringException e) {
            } catch (PropertyException e) {
                PropertyDefinitionUsageBuilder builder = new PropertyDefinitionUsageBuilder(true);
                return ERR_ILLEGAL_MANAGED_OBJECT_NAME_EXCEPTION_SYNTAX.get(illegalName,
                    namingPropertyDefinition.getName(), builder.getUsage(namingPropertyDefinition));
opendj-config/src/main/java/org/forgerock/opendj/config/client/ManagedObject.java
@@ -32,7 +32,7 @@
import org.forgerock.opendj.config.AbstractManagedObjectDefinition;
import org.forgerock.opendj.config.Configuration;
import org.forgerock.opendj.config.ConfigurationClient;
import org.forgerock.opendj.config.DefaultBehaviorException;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.DefinitionDecodingException;
import org.forgerock.opendj.config.InstantiableRelationDefinition;
import org.forgerock.opendj.config.ManagedObjectAlreadyExistsException;
@@ -41,9 +41,6 @@
import org.forgerock.opendj.config.ManagedObjectPath;
import org.forgerock.opendj.config.OptionalRelationDefinition;
import org.forgerock.opendj.config.PropertyDefinition;
import org.forgerock.opendj.config.PropertyIsMandatoryException;
import org.forgerock.opendj.config.PropertyIsReadOnlyException;
import org.forgerock.opendj.config.PropertyIsSingleValuedException;
import org.forgerock.opendj.config.PropertyProvider;
import org.forgerock.opendj.config.SetRelationDefinition;
import org.forgerock.opendj.config.SingletonRelationDefinition;
@@ -150,7 +147,7 @@
     *            The name of the child managed object.
     * @param exceptions
     *            A collection in which to place any
     *            {@link DefaultBehaviorException}s that occurred whilst
     *            {@link PropertyException}s that occurred whilst
     *            attempting to determine the managed object's default values.
     * @return Returns a new child managed object bound to the specified
     *         instantiable relation.
@@ -162,7 +159,7 @@
     */
    <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;
            Collection<PropertyException> exceptions) throws IllegalManagedObjectNameException;
    /**
     * Creates a new child managed object bound to the specified optional
@@ -186,7 +183,7 @@
     *            The definition of the managed object to be created.
     * @param exceptions
     *            A collection in which to place any
     *            {@link DefaultBehaviorException}s that occurred whilst
     *            {@link PropertyException}s that occurred whilst
     *            attempting to determine the managed object's default values.
     * @return Returns a new child managed object bound to the specified
     *         optional relation.
@@ -196,7 +193,7 @@
     */
    <C extends ConfigurationClient, S extends Configuration, C1 extends C> ManagedObject<C1> createChild(
            OptionalRelationDefinition<C, S> r, ManagedObjectDefinition<C1, ? extends S> d,
            Collection<DefaultBehaviorException> exceptions);
            Collection<PropertyException> exceptions);
    /**
     * Creates a new child managed object bound to the specified set relation.
@@ -220,7 +217,7 @@
     *            The definition of the managed object to be created.
     * @param exceptions
     *            A collection in which to place any
     *            {@link DefaultBehaviorException}s that occurred whilst
     *            {@link PropertyException}s that occurred whilst
     *            attempting to determine the managed object's default values.
     * @return Returns a new child managed object bound to the specified set
     *         relation.
@@ -230,7 +227,7 @@
     */
    <C extends ConfigurationClient, S extends Configuration, C1 extends C> ManagedObject<C1> createChild(
            SetRelationDefinition<C, S> r, ManagedObjectDefinition<C1, ? extends S> d,
            Collection<DefaultBehaviorException> exceptions);
            Collection<PropertyException> exceptions);
    /**
     * Retrieves an instantiable child managed object.
@@ -702,10 +699,10 @@
     * @param value
     *            The new pending value for the property, or <code>null</code>
     *            if the property should be reset to its default behavior.
     * @throws PropertyIsReadOnlyException
     * @throws PropertyException
     *             If this is not a new managed object and the property is
     *             read-only or for monitoring purposes.
     * @throws PropertyIsMandatoryException
     * @throws PropertyException
     *             If an attempt was made to remove a mandatory property.
     */
    <P> void setPropertyValue(PropertyDefinition<P> pd, P value);
@@ -724,13 +721,13 @@
     *            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 PropertyIsSingleValuedException
     * @throws PropertyException
     *             If an attempt was made to add multiple pending values to a
     *             single-valued property.
     * @throws PropertyIsReadOnlyException
     * @throws PropertyException
     *             If this is not a new managed object and the property is
     *             read-only or for monitoring purposes.
     * @throws PropertyIsMandatoryException
     * @throws PropertyException
     *             If an attempt was made to remove a mandatory property.
     */
    <P> void setPropertyValues(PropertyDefinition<P> pd, Collection<P> values);
opendj-config/src/main/java/org/forgerock/opendj/config/client/MissingMandatoryPropertiesException.java
@@ -34,7 +34,7 @@
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.forgerock.opendj.config.OperationsException;
import org.forgerock.opendj.config.PropertyIsMandatoryException;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.util.Reject;
/**
@@ -49,7 +49,7 @@
    private static final long serialVersionUID = 6342522125252055588L;
    // Create the message.
    private static LocalizableMessage createMessage(Collection<PropertyIsMandatoryException> causes) {
    private static LocalizableMessage createMessage(Collection<PropertyException> causes) {
        Reject.ifNull(causes);
        Reject.ifFalse(!causes.isEmpty(), "causes should not be empty");
@@ -60,7 +60,7 @@
            LocalizableMessageBuilder builder = new LocalizableMessageBuilder();
            boolean isFirst = true;
            for (PropertyIsMandatoryException cause : causes) {
            for (PropertyException cause : causes) {
                if (!isFirst) {
                    builder.append(", ");
                }
@@ -73,7 +73,7 @@
    }
    // The causes of this exception.
    private final Collection<PropertyIsMandatoryException> causes;
    private final Collection<PropertyException> causes;
    // Indicates whether the exception occurred during managed object
    // creation.
@@ -98,10 +98,10 @@
     *            creation.
     */
    public MissingMandatoryPropertiesException(LocalizableMessage ufn,
        Collection<PropertyIsMandatoryException> causes, boolean isCreate) {
        Collection<PropertyException> causes, boolean isCreate) {
        super(createMessage(causes));
        this.causes = new ArrayList<PropertyIsMandatoryException>(causes);
        this.causes = new ArrayList<PropertyException>(causes);
        this.ufn = ufn;
        this.isCreate = isCreate;
    }
@@ -112,7 +112,7 @@
     * @return Returns the first exception that caused this exception.
     */
    @Override
    public PropertyIsMandatoryException getCause() {
    public PropertyException getCause() {
        return causes.iterator().next();
    }
@@ -122,7 +122,7 @@
     * @return Returns an unmodifiable collection view of the causes of this
     *         exception.
     */
    public Collection<PropertyIsMandatoryException> getCauses() {
    public Collection<PropertyException> getCauses() {
        return Collections.unmodifiableCollection(causes);
    }
opendj-config/src/main/java/org/forgerock/opendj/config/client/ldap/LDAPDriver.java
@@ -43,10 +43,9 @@
import org.forgerock.opendj.config.AggregationPropertyDefinition;
import org.forgerock.opendj.config.Configuration;
import org.forgerock.opendj.config.ConfigurationClient;
import org.forgerock.opendj.config.DefaultBehaviorException;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.DefinitionDecodingException;
import org.forgerock.opendj.config.DefinitionResolver;
import org.forgerock.opendj.config.IllegalPropertyValueStringException;
import org.forgerock.opendj.config.InstantiableRelationDefinition;
import org.forgerock.opendj.config.LDAPProfile;
import org.forgerock.opendj.config.ManagedObjectDefinition;
@@ -55,9 +54,6 @@
import org.forgerock.opendj.config.PropertyDefinition;
import org.forgerock.opendj.config.PropertyDefinitionVisitor;
import org.forgerock.opendj.config.PropertyDefinitionsOptions;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.PropertyIsMandatoryException;
import org.forgerock.opendj.config.PropertyIsSingleValuedException;
import org.forgerock.opendj.config.PropertyOption;
import org.forgerock.opendj.config.Reference;
import org.forgerock.opendj.config.RelationDefinition;
@@ -100,7 +96,7 @@
         * @param options
         *            Decoding options for property definitions.
         * @return Returns the decoded LDAP value.
         * @throws IllegalPropertyValueStringException
         * @throws PropertyException
         *             If the property value could not be decoded because it was
         *             invalid.
         */
@@ -126,7 +122,7 @@
                Reference<C, S> reference = Reference.parseDN(d.getParentPath(), d.getRelationDefinition(), p);
                return reference.getName();
            } catch (IllegalArgumentException e) {
                throw new IllegalPropertyValueStringException(d, p);
                throw PropertyException.illegalPropertyValueException(d, p);
            }
        }
@@ -278,11 +274,11 @@
            // Sanity check the returned values.
            if (values.size() > 1 && !propertyDef.hasOption(PropertyOption.MULTI_VALUED)) {
                throw new PropertyIsSingleValuedException(propertyDef);
                throw PropertyException.propertyIsSingleValuedException(propertyDef);
            }
            if (values.isEmpty() && propertyDef.hasOption(PropertyOption.MANDATORY)) {
                throw new PropertyIsMandatoryException(propertyDef);
                throw PropertyException.propertyIsMandatoryException(propertyDef);
            }
            if (values.isEmpty()) {
@@ -503,7 +499,7 @@
        if (activeValues.size() > 1 && !propertyDef.hasOption(PropertyOption.MULTI_VALUED)) {
            // This exception takes precedence over previous exceptions.
            exception = new PropertyIsSingleValuedException(propertyDef);
            exception = PropertyException.propertyIsSingleValuedException(propertyDef);
            P value = activeValues.first();
            activeValues.clear();
            activeValues.add(value);
@@ -513,7 +509,7 @@
        Collection<P> defaultValues;
        try {
            defaultValues = findDefaultValues(path, propertyDef, false);
        } catch (DefaultBehaviorException e) {
        } catch (PropertyException e) {
            defaultValues = Collections.emptySet();
            exception = e;
        }
@@ -524,7 +520,7 @@
            // The active values maybe empty because of a previous
            // exception.
            if (exception == null) {
                exception = new PropertyIsMandatoryException(propertyDef);
                exception = PropertyException.propertyIsMandatoryException(propertyDef);
            }
        }
opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/AbstractManagedObject.java
@@ -38,10 +38,9 @@
import org.forgerock.opendj.config.Configuration;
import org.forgerock.opendj.config.ConfigurationClient;
import org.forgerock.opendj.config.Constraint;
import org.forgerock.opendj.config.DefaultBehaviorException;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.DefaultManagedObject;
import org.forgerock.opendj.config.DefinitionDecodingException;
import org.forgerock.opendj.config.IllegalPropertyValueStringException;
import org.forgerock.opendj.config.InstantiableRelationDefinition;
import org.forgerock.opendj.config.ManagedObjectAlreadyExistsException;
import org.forgerock.opendj.config.ManagedObjectDefinition;
@@ -50,8 +49,6 @@
import org.forgerock.opendj.config.OptionalRelationDefinition;
import org.forgerock.opendj.config.PropertyDefinition;
import org.forgerock.opendj.config.PropertyDefinitionsOptions;
import org.forgerock.opendj.config.PropertyIsMandatoryException;
import org.forgerock.opendj.config.PropertyIsReadOnlyException;
import org.forgerock.opendj.config.PropertyOption;
import org.forgerock.opendj.config.RelationDefinition;
import org.forgerock.opendj.config.RelationDefinitionVisitor;
@@ -267,12 +264,12 @@
    public final void commit() throws ManagedObjectAlreadyExistsException, MissingMandatoryPropertiesException,
        ConcurrentModificationException, OperationRejectedException, ErrorResultException {
        // First make sure all mandatory properties are defined.
        List<PropertyIsMandatoryException> exceptions = new LinkedList<PropertyIsMandatoryException>();
        List<PropertyException> exceptions = new LinkedList<PropertyException>();
        for (PropertyDefinition<?> pd : definition.getAllPropertyDefinitions()) {
            Property<?> p = getProperty(pd);
            if (pd.hasOption(PropertyOption.MANDATORY) && p.getEffectiveValues().isEmpty()) {
                exceptions.add(new PropertyIsMandatoryException(pd));
                exceptions.add(PropertyException.propertyIsMandatoryException(pd));
            }
        }
@@ -339,7 +336,7 @@
    @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 {
        Collection<PropertyException> exceptions) throws IllegalManagedObjectNameException {
        validateRelationDefinition(r);
        // Empty names are not allowed.
@@ -353,7 +350,7 @@
        if (pd != null) {
            try {
                pd.decodeValue(name, propertyDefOptions);
            } catch (IllegalPropertyValueStringException e) {
            } catch (PropertyException e) {
                throw new IllegalManagedObjectNameException(name, pd, propertyDefOptions);
            }
        }
@@ -368,7 +365,7 @@
    @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) {
        Collection<PropertyException> exceptions) {
        validateRelationDefinition(r);
        ManagedObjectPath<C1, ? extends S> childPath = path.child(r, d);
        return createNewManagedObject(d, childPath, null, null, exceptions);
@@ -380,7 +377,7 @@
    @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) {
        Collection<PropertyException> exceptions) {
        validateRelationDefinition(r);
        ManagedObjectPath<C1, ? extends S> childPath = path.child(r, d);
@@ -663,11 +660,11 @@
    @Override
    public final <P> void setPropertyValues(PropertyDefinition<P> pd, Collection<P> values) {
        if (pd.hasOption(PropertyOption.MONITORING)) {
            throw new PropertyIsReadOnlyException(pd);
            throw PropertyException.propertyIsReadOnlyException(pd);
        }
        if (existsOnServer && pd.hasOption(PropertyOption.READ_ONLY)) {
            throw new PropertyIsReadOnlyException(pd);
            throw PropertyException.propertyIsReadOnlyException(pd);
        }
        properties.setPropertyValues(pd, values, propertyDefOptions);
@@ -800,12 +797,12 @@
    // values.
    private <M extends ConfigurationClient, P> ManagedObject<M> createNewManagedObject(
        ManagedObjectDefinition<M, ?> d, ManagedObjectPath<M, ?> p, PropertyDefinition<P> namingPropertyDefinition,
        String name, Collection<DefaultBehaviorException> exceptions) {
        String name, Collection<PropertyException> exceptions) {
        PropertySet childProperties = new PropertySet();
        for (PropertyDefinition<?> pd : d.getAllPropertyDefinitions()) {
            try {
                createProperty(childProperties, p, pd);
            } catch (DefaultBehaviorException e) {
            } catch (PropertyException e) {
                // Add the exception if requested.
                if (exceptions != null) {
                    exceptions.add(e);
@@ -829,7 +826,7 @@
            Driver context = getDriver();
            Collection<P> defaultValues = context.findDefaultValues(p, pd, true);
            properties.addProperty(pd, defaultValues, Collections.<P> emptySet());
        } catch (DefaultBehaviorException e) {
        } catch (PropertyException e) {
            // Make sure that we have still created the property.
            properties.addProperty(pd, Collections.<P> emptySet(), Collections.<P> emptySet());
            throw e;
opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/Driver.java
@@ -25,6 +25,9 @@
 */
package org.forgerock.opendj.config.client.spi;
import static org.forgerock.opendj.config.PropertyException.defaultBehaviorException;
import static org.forgerock.opendj.config.PropertyException.propertyIsSingleValuedException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -40,19 +43,16 @@
import org.forgerock.opendj.config.Configuration;
import org.forgerock.opendj.config.ConfigurationClient;
import org.forgerock.opendj.config.Constraint;
import org.forgerock.opendj.config.DefaultBehaviorException;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.DefaultBehaviorProviderVisitor;
import org.forgerock.opendj.config.DefinedDefaultBehaviorProvider;
import org.forgerock.opendj.config.DefinitionDecodingException;
import org.forgerock.opendj.config.IllegalPropertyValueStringException;
import org.forgerock.opendj.config.InstantiableRelationDefinition;
import org.forgerock.opendj.config.ManagedObjectNotFoundException;
import org.forgerock.opendj.config.ManagedObjectPath;
import org.forgerock.opendj.config.OptionalRelationDefinition;
import org.forgerock.opendj.config.PropertyDefinition;
import org.forgerock.opendj.config.PropertyDefinitionsOptions;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.PropertyIsSingleValuedException;
import org.forgerock.opendj.config.PropertyNotFoundException;
import org.forgerock.opendj.config.PropertyOption;
import org.forgerock.opendj.config.RelationDefinition;
@@ -85,7 +85,7 @@
        // Any exception that occurred whilst retrieving inherited default
        // values.
        private DefaultBehaviorException exception = null;
        private PropertyException exception = null;
        // The path of the managed object containing the first property.
        private final ManagedObjectPath<?, ?> firstPath;
@@ -113,7 +113,7 @@
            try {
                return getInheritedProperty(d.getManagedObjectPath(), d.getManagedObjectDefinition(),
                    d.getPropertyName());
            } catch (DefaultBehaviorException e) {
            } catch (PropertyException e) {
                exception = e;
                return Collections.emptySet();
            }
@@ -138,8 +138,8 @@
            for (String stringValue : stringValues) {
                try {
                    values.add(nextProperty.decodeValue(stringValue, propertyDefOptions));
                } catch (IllegalPropertyValueStringException e) {
                    exception = new DefaultBehaviorException(nextProperty, e);
                } catch (PropertyException e) {
                    exception = PropertyException.defaultBehaviorException(nextProperty, e);
                    break;
                }
            }
@@ -155,7 +155,7 @@
            try {
                return getInheritedProperty(d.getManagedObjectPath(nextPath), d.getManagedObjectDefinition(),
                    d.getPropertyName());
            } catch (DefaultBehaviorException e) {
            } catch (PropertyException e) {
                exception = e;
                return Collections.emptySet();
            }
@@ -181,7 +181,7 @@
            }
            if (values.size() > 1 && !pd.hasOption(PropertyOption.MULTI_VALUED)) {
                throw new DefaultBehaviorException(pd, new PropertyIsSingleValuedException(pd));
                throw defaultBehaviorException(pd, propertyIsSingleValuedException(pd));
            }
            return values;
@@ -195,7 +195,7 @@
            // corresponds to the path.
            AbstractManagedObjectDefinition<?, ?> supr = target.getManagedObjectDefinition();
            if (!supr.isParentOf(d)) {
                throw new DefaultBehaviorException(nextProperty, new DefinitionDecodingException(supr,
                throw PropertyException.defaultBehaviorException(nextProperty, new DefinitionDecodingException(supr,
                    Reason.WRONG_TYPE_INFORMATION));
            }
@@ -238,19 +238,17 @@
                    // object.
                    return getPropertyValues(target, pd2);
                }
            } catch (DefaultBehaviorException e) {
                // Wrap any errors due to recursion.
                throw new DefaultBehaviorException(pd1, e);
            } catch (DefinitionDecodingException e) {
                throw new DefaultBehaviorException(pd1, e);
            } catch (PropertyNotFoundException e) {
                throw new DefaultBehaviorException(pd1, e);
            } catch (ErrorResultException e) {
                throw new DefaultBehaviorException(pd1, e);
            } catch (ManagedObjectNotFoundException e) {
                throw new DefaultBehaviorException(pd1, e);
            } catch (PropertyException e) {
                throw new DefaultBehaviorException(pd1, e);
                // Wrap any errors due to recursion.
                throw PropertyException.defaultBehaviorException(pd1, e);
            } catch (DefinitionDecodingException e) {
                throw PropertyException.defaultBehaviorException(pd1, e);
            } catch (PropertyNotFoundException e) {
                throw PropertyException.defaultBehaviorException(pd1, e);
            } catch (ErrorResultException e) {
                throw PropertyException.defaultBehaviorException(pd1, e);
            } catch (ManagedObjectNotFoundException e) {
                throw PropertyException.defaultBehaviorException(pd1, e);
            }
        }
    };
@@ -588,7 +586,7 @@
     * @param isCreate
     *            Indicates whether the managed object has been created yet.
     * @return Returns the default values for the specified property.
     * @throws DefaultBehaviorException
     * @throws PropertyException
     *             If the default values could not be retrieved or decoded
     *             properly.
     */
opendj-config/src/main/java/org/forgerock/opendj/config/client/spi/PropertySet.java
@@ -33,11 +33,9 @@
import java.util.SortedSet;
import java.util.TreeSet;
import org.forgerock.opendj.config.IllegalPropertyValueException;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.PropertyDefinition;
import org.forgerock.opendj.config.PropertyDefinitionsOptions;
import org.forgerock.opendj.config.PropertyIsMandatoryException;
import org.forgerock.opendj.config.PropertyIsSingleValuedException;
import org.forgerock.opendj.config.PropertyOption;
/**
@@ -285,13 +283,13 @@
     *            by this managed object.
     * @param options
     *            Options to validate property definitions values.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If a new pending value is deemed to be invalid according to
     *             the property definition.
     * @throws PropertyIsSingleValuedException
     * @throws PropertyException
     *             If an attempt was made to add multiple pending values to a
     *             single-valued property.
     * @throws PropertyIsMandatoryException
     * @throws PropertyException
     *             If an attempt was made to remove a mandatory property.
     * @throws IllegalArgumentException
     *             If the specified property definition is not associated with
@@ -302,13 +300,13 @@
        MyProperty<T> property = (MyProperty<T>) getProperty(d);
        if (values.size() > 1 && !d.hasOption(PropertyOption.MULTI_VALUED)) {
            throw new PropertyIsSingleValuedException(d);
            throw PropertyException.propertyIsSingleValuedException(d);
        }
        if (values.isEmpty() && d.hasOption(PropertyOption.MANDATORY)) {
            // But only if there are no default values.
            if (property.getDefaultValues().isEmpty()) {
                throw new PropertyIsMandatoryException(d);
                throw PropertyException.propertyIsMandatoryException(d);
            }
        }
opendj-config/src/main/java/org/forgerock/opendj/config/server/ServerManagementContext.java
@@ -28,6 +28,8 @@
import static com.forgerock.opendj.ldap.AdminMessages.*;
import static com.forgerock.opendj.util.StaticUtils.*;
import static org.forgerock.opendj.config.PropertyException.defaultBehaviorException;
import static org.forgerock.opendj.config.PropertyException.propertyIsSingleValuedException;
import java.util.ArrayList;
import java.util.Collection;
@@ -50,22 +52,17 @@
import org.forgerock.opendj.config.AliasDefaultBehaviorProvider;
import org.forgerock.opendj.config.Configuration;
import org.forgerock.opendj.config.ConfigurationClient;
import org.forgerock.opendj.config.DefaultBehaviorException;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.DefaultBehaviorProviderVisitor;
import org.forgerock.opendj.config.DefinedDefaultBehaviorProvider;
import org.forgerock.opendj.config.DefinitionDecodingException;
import org.forgerock.opendj.config.DefinitionResolver;
import org.forgerock.opendj.config.IllegalPropertyValueException;
import org.forgerock.opendj.config.IllegalPropertyValueStringException;
import org.forgerock.opendj.config.LDAPProfile;
import org.forgerock.opendj.config.ManagedObjectDefinition;
import org.forgerock.opendj.config.ManagedObjectPath;
import org.forgerock.opendj.config.PropertyDefinition;
import org.forgerock.opendj.config.PropertyDefinitionVisitor;
import org.forgerock.opendj.config.PropertyDefinitionsOptions;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.PropertyIsMandatoryException;
import org.forgerock.opendj.config.PropertyIsSingleValuedException;
import org.forgerock.opendj.config.PropertyNotFoundException;
import org.forgerock.opendj.config.PropertyOption;
import org.forgerock.opendj.config.Reference;
@@ -99,7 +96,7 @@
        // Any exception that occurred whilst retrieving inherited default
        // values.
        private DefaultBehaviorException exception = null;
        private PropertyException exception = null;
        // Optional new configuration entry which does not yet exist in
        // the configuration back-end.
@@ -123,7 +120,7 @@
            try {
                return getInheritedProperty(d.getManagedObjectPath(), d.getManagedObjectDefinition(),
                        d.getPropertyName());
            } catch (DefaultBehaviorException e) {
            } catch (PropertyException e) {
                exception = e;
                return Collections.emptySet();
            }
@@ -146,8 +143,8 @@
            for (String stringValue : stringValues) {
                try {
                    values.add(nextProperty.decodeValue(stringValue, propertyDefOptions));
                } catch (IllegalPropertyValueStringException e) {
                    exception = new DefaultBehaviorException(nextProperty, e);
                } catch (PropertyException e) {
                    exception = PropertyException.defaultBehaviorException(nextProperty, e);
                    break;
                }
            }
@@ -162,7 +159,7 @@
            try {
                return getInheritedProperty(d.getManagedObjectPath(nextPath), d.getManagedObjectDefinition(),
                        d.getPropertyName());
            } catch (DefaultBehaviorException e) {
            } catch (PropertyException e) {
                exception = e;
                return Collections.emptySet();
            }
@@ -187,7 +184,7 @@
            }
            if (values.size() > 1 && !propertyDef.hasOption(PropertyOption.MULTI_VALUED)) {
                throw new DefaultBehaviorException(propertyDef, new PropertyIsSingleValuedException(propertyDef));
                throw defaultBehaviorException(propertyDef, propertyIsSingleValuedException(propertyDef));
            }
            return values;
@@ -201,7 +198,7 @@
            // corresponds to the path.
            AbstractManagedObjectDefinition<?, ?> supr = target.getManagedObjectDefinition();
            if (!supr.isParentOf(definition)) {
                throw new DefaultBehaviorException(nextProperty, new DefinitionDecodingException(supr,
                throw PropertyException.defaultBehaviorException(nextProperty, new DefinitionDecodingException(supr,
                        Reason.WRONG_TYPE_INFORMATION));
            }
@@ -250,15 +247,13 @@
                    return pvalues;
                }
            } catch (DefinitionDecodingException e) {
                throw new DefaultBehaviorException(propDef1, e);
                throw PropertyException.defaultBehaviorException(propDef1, e);
            } catch (PropertyNotFoundException e) {
                throw new DefaultBehaviorException(propDef1, e);
            } catch (IllegalPropertyValueException e) {
                throw new DefaultBehaviorException(propDef1, e);
            } catch (IllegalPropertyValueStringException e) {
                throw new DefaultBehaviorException(propDef1, e);
                throw PropertyException.defaultBehaviorException(propDef1, e);
            } catch (PropertyException e) {
                throw PropertyException.defaultBehaviorException(propDef1, e);
            } catch (ConfigException e) {
                throw new DefaultBehaviorException(propDef1, e);
                throw PropertyException.defaultBehaviorException(propDef1, e);
            }
        }
    }
@@ -313,7 +308,7 @@
         * @param options
         *            Options to decode property definitions values.
         * @return Returns the decoded LDAP value.
         * @throws IllegalPropertyValueStringException
         * @throws PropertyException
         *             If the property value could not be decoded because it was
         *             invalid.
         */
@@ -339,7 +334,7 @@
                Reference<C, S> reference = Reference.parseDN(d.getParentPath(), d.getRelationDefinition(), p);
                return reference.getName();
            } catch (IllegalArgumentException e) {
                throw new IllegalPropertyValueStringException(d, p);
                throw PropertyException.illegalPropertyValueException(d, p);
            }
        }
@@ -726,7 +721,7 @@
            for (String value : attributeValues) {
                try {
                    pvalues.add(ValueDecoder.decode(propertyDef, value, propertyDefOptions));
                } catch (IllegalPropertyValueStringException e) {
                } catch (PropertyException e) {
                    exception = e;
                }
            }
@@ -734,14 +729,14 @@
            // No values defined so get the defaults.
            try {
                pvalues.addAll(getDefaultValues(path, propertyDef, newConfigEntry));
            } catch (DefaultBehaviorException e) {
            } catch (PropertyException e) {
                exception = e;
            }
        }
        if (pvalues.size() > 1 && !propertyDef.hasOption(PropertyOption.MULTI_VALUED)) {
            // This exception takes precedence over previous exceptions.
            exception = new PropertyIsSingleValuedException(propertyDef);
            exception = PropertyException.propertyIsSingleValuedException(propertyDef);
            T value = pvalues.first();
            pvalues.clear();
            pvalues.add(value);
@@ -750,7 +745,7 @@
        if (pvalues.isEmpty() && propertyDef.hasOption(PropertyOption.MANDATORY)) {
            // The values maybe empty because of a previous exception.
            if (exception == null) {
                exception = new PropertyIsMandatoryException(propertyDef);
                exception = PropertyException.propertyIsMandatoryException(propertyDef);
            }
        }
opendj-config/src/test/java/org/forgerock/opendj/config/AttributeTypePropertyDefinitionTest.java
@@ -65,7 +65,7 @@
        return new Object[][] { { "dummy-type-xxx" } };
    }
    @Test(dataProvider = "valueIllegalData", expectedExceptions = { IllegalPropertyValueStringException.class })
    @Test(dataProvider = "valueIllegalData", expectedExceptions = { PropertyException.class })
    public void testDecodeValueIllegal(String value) {
        AttributeTypePropertyDefinition propertyDef = createPropertyDefinition();
        propertyDef.decodeValue(value, new PropertyDefinitionsOptions());
opendj-config/src/test/java/org/forgerock/opendj/config/BooleanPropertyDefinitionTest.java
@@ -71,7 +71,7 @@
    }
    @Test(dataProvider = "decodeValueDataIllegal", expectedExceptions = { NullPointerException.class,
            IllegalPropertyValueStringException.class })
            PropertyException.class })
    public void testDecodeValueIllegal(String value) {
        BooleanPropertyDefinition def = createPropertyDefinition();
        def.decodeValue(value, PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
opendj-config/src/test/java/org/forgerock/opendj/config/ClassPropertyDefinitionTest.java
@@ -131,7 +131,7 @@
            { "java.lang.Runnable", "java.lang.String", Number.class, Number.class }, };
    }
    @Test(dataProvider = "loadClassesIllegal", expectedExceptions = { IllegalPropertyValueException.class })
    @Test(dataProvider = "loadClassesIllegal", expectedExceptions = { PropertyException.class })
    public <T> void testLoadClassIllegal(String interfaceName, String loadClassName, Class<T> instanceOfClass,
            Class<?> expectedClass) {
        ClassPropertyDefinition.Builder localBuilder = ClassPropertyDefinition.createBuilder(RootCfgDefn.getInstance(),
opendj-config/src/test/java/org/forgerock/opendj/config/DNPropertyDefinitionTest.java
@@ -97,7 +97,7 @@
        propertyDef.validateValue(DN.valueOf(valueToValidate), PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
    }
    @Test(dataProvider = "illegalValues", expectedExceptions = IllegalPropertyValueException.class)
    @Test(dataProvider = "illegalValues", expectedExceptions = PropertyException.class)
    public void testValidateIllegalValues(String baseDN, String valueToValidate) {
        DNPropertyDefinition.Builder localBuilder = DNPropertyDefinition.createBuilder(RootCfgDefn.getInstance(),
                "test-property");
@@ -115,7 +115,7 @@
        propertyDef.decodeValue(valueToValidate, PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
    }
    @Test(dataProvider = "illegalValues", expectedExceptions = IllegalPropertyValueStringException.class)
    @Test(dataProvider = "illegalValues", expectedExceptions = PropertyException.class)
    public void testDecodeIllegalValues(String baseDN, String valueToValidate) {
        DNPropertyDefinition.Builder localBuilder = DNPropertyDefinition.createBuilder(RootCfgDefn.getInstance(),
                "test-property");
opendj-config/src/test/java/org/forgerock/opendj/config/DurationPropertyDefinitionTest.java
@@ -127,7 +127,7 @@
        def.decodeValue("unlimited", PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
    }
    @Test(expectedExceptions = IllegalPropertyValueStringException.class)
    @Test(expectedExceptions = PropertyException.class)
    public void testAllowUnlimitedIsFalse() {
        DurationPropertyDefinition.Builder builder = createTestBuilder();
        builder.setAllowUnlimited(false);
@@ -135,7 +135,7 @@
        def.decodeValue("unlimited", PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
    }
    @Test(expectedExceptions = IllegalPropertyValueException.class)
    @Test(expectedExceptions = PropertyException.class)
    public void testAllowUnlimitedIsFalseNumValue() {
        DurationPropertyDefinition.Builder builder = createTestBuilder();
        builder.setAllowUnlimited(false);
@@ -177,7 +177,7 @@
    }
    @Test(dataProvider = "illegalValidateValueData", expectedExceptions = { AssertionError.class,
            NullPointerException.class, IllegalPropertyValueException.class })
            NullPointerException.class, PropertyException.class })
    public void testValidateValueIllegal(Long lowLimitInMillis, Long highLimitInMillis,
            boolean isAllowUnlimited, Long valueInSeconds) {
        DurationPropertyDefinition.Builder builder = createTestBuilder();
@@ -224,7 +224,7 @@
                return true;
            }
            @SuppressWarnings("unused")
            public Boolean visitUnknown(PropertyDefinition<?> d, Void o) throws UnknownPropertyDefinitionException {
            public Boolean visitUnknown(PropertyDefinition<?> d, Void o) throws PropertyException {
                return false;
            }
        };
@@ -329,7 +329,7 @@
        };
    }
    @Test(dataProvider = "decodeValueDataIllegal", expectedExceptions = { IllegalPropertyValueStringException.class })
    @Test(dataProvider = "decodeValueDataIllegal", expectedExceptions = { PropertyException.class })
    public void testDecodeValue(String valueToDecode) {
        DurationPropertyDefinition.Builder builder = createTestBuilder();
        builder.setAllowUnlimited(false);
opendj-config/src/test/java/org/forgerock/opendj/config/EnumPropertyDefinitionTest.java
@@ -114,7 +114,7 @@
     *            to decode
     */
    @Test(dataProvider = "decodeValueIllegalData", expectedExceptions = { NullPointerException.class,
            IllegalPropertyValueStringException.class })
            PropertyException.class })
    public void testDecodeValueIllegalData(String value) {
        EnumPropertyDefinition<?> def = builder.getInstance();
        def.decodeValue(value, PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
opendj-config/src/test/java/org/forgerock/opendj/config/IntegerPropertyDefinitionTest.java
@@ -95,7 +95,7 @@
        propertyDef.decodeValue("unlimited", PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
    }
    @Test(expectedExceptions = IllegalPropertyValueStringException.class)
    @Test(expectedExceptions = PropertyException.class)
    public void testIsAllowUnlimitedFalse() {
        IntegerPropertyDefinition.Builder builder = createTestBuilder();
        builder.setAllowUnlimited(false);
@@ -103,7 +103,7 @@
        propertyDef.decodeValue("unlimited", PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
    }
    @Test(expectedExceptions = IllegalPropertyValueException.class)
    @Test(expectedExceptions = PropertyException.class)
    public void testIsAllowUnlimitedInteger() {
        IntegerPropertyDefinition.Builder builder = createTestBuilder();
        builder.setAllowUnlimited(false);
@@ -145,7 +145,7 @@
    }
    @Test(dataProvider = "illegalValidateValueData", expectedExceptions = { AssertionError.class,
            NullPointerException.class, IllegalPropertyValueException.class })
            NullPointerException.class, PropertyException.class })
    public void testValidateValueIllegal(Integer low, Integer high, boolean allowUnlimited, Integer value) {
        IntegerPropertyDefinition.Builder builder = createTestBuilder();
        builder.setLowerLimit(low);
@@ -181,7 +181,7 @@
            }
            @SuppressWarnings("unused")
            public Boolean visitUnknown(PropertyDefinition<?> d, Void o) throws UnknownPropertyDefinitionException {
            public Boolean visitUnknown(PropertyDefinition<?> d, Void o) throws PropertyException {
                return false;
            }
        };
opendj-config/src/test/java/org/forgerock/opendj/config/SizePropertyDefinitionTest.java
@@ -102,7 +102,7 @@
        propertyDef.decodeValue("unlimited", PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
    }
    @Test(expectedExceptions = IllegalPropertyValueStringException.class)
    @Test(expectedExceptions = PropertyException.class)
    public void testIsAllowUnlimitedFalse() {
        SizePropertyDefinition.Builder builder = createTestBuilder();
        builder.setAllowUnlimited(false);
@@ -110,7 +110,7 @@
        propertyDef.decodeValue("unlimited", PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
    }
    @Test(expectedExceptions = IllegalPropertyValueException.class)
    @Test(expectedExceptions = PropertyException.class)
    public void testIsAllowUnlimitedNumeric() {
        SizePropertyDefinition.Builder builder = createTestBuilder();
        builder.setAllowUnlimited(false);
@@ -152,7 +152,7 @@
    }
    @Test(dataProvider = "illegalValidateValueData", expectedExceptions = { AssertionError.class,
            NullPointerException.class, IllegalPropertyValueException.class })
            NullPointerException.class, PropertyException.class })
    public void testValidateValueIllegal(Long low, Long high, boolean allowUnlimited, Long valueToValidate) {
        SizePropertyDefinition.Builder builder = createTestBuilder();
        builder.setLowerLimit(low);
@@ -200,7 +200,7 @@
                return true;
            }
            @SuppressWarnings("unused")
            public Boolean visitUnknown(PropertyDefinition<?> d, Void o) throws UnknownPropertyDefinitionException {
            public Boolean visitUnknown(PropertyDefinition<?> d, Void o) throws PropertyException {
                return false;
            }
        };
opendj-config/src/test/java/org/forgerock/opendj/config/StringPropertyDefinitionTest.java
@@ -46,7 +46,7 @@
    }
    // TODO : I18N problem
    @Test(enabled = false, expectedExceptions = IllegalPropertyValueException.class)
    @Test(enabled = false, expectedExceptions = PropertyException.class)
    public void testValidateValuePatternDoesNotMatch() {
        StringPropertyDefinition d = getDefinition(true, "^[a-z]+$");
        d.validateValue("abc123", PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
@@ -59,7 +59,7 @@
    }
    // TODO : I18N problem
    @Test(enabled = false, expectedExceptions = IllegalPropertyValueStringException.class)
    @Test(enabled = false, expectedExceptions = PropertyException.class)
    public void testDecodeValuePatternDoesNotMatch() {
        StringPropertyDefinition d = getDefinition(true, "^[a-z]+$");
        d.decodeValue("abc123", PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS);
opendj-config/src/test/java/org/forgerock/opendj/config/TestChildCfgClient.java
@@ -63,10 +63,10 @@
     *
     * @param values
     *            The values of the "aggregation-property" property.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If one or more of the new values are invalid.
     */
    void setAggregationProperty(Collection<String> values) throws IllegalPropertyValueException;
    void setAggregationProperty(Collection<String> values) throws PropertyException;
    /**
     * Get the "mandatory-boolean-property" property.
@@ -84,10 +84,10 @@
     *
     * @param value
     *            The value of the "mandatory-boolean-property" property.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If the new value is invalid.
     */
    void setMandatoryBooleanProperty(boolean value) throws IllegalPropertyValueException;
    void setMandatoryBooleanProperty(boolean value) throws PropertyException;
    /**
     * Get the "mandatory-class-property" property.
@@ -105,10 +105,10 @@
     *
     * @param value
     *            The value of the "mandatory-class-property" property.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If the new value is invalid.
     */
    void setMandatoryClassProperty(String value) throws IllegalPropertyValueException;
    void setMandatoryClassProperty(String value) throws PropertyException;
    /**
     * Get the "mandatory-read-only-attribute-type-property" property.
@@ -131,13 +131,13 @@
     * @param value
     *            The value of the "mandatory-read-only-attribute-type-property"
     *            property.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If the new value is invalid.
     * @throws PropertyIsReadOnlyException
     * @throws PropertyException
     *             If this Test Child is not being initialized.
     */
    void setMandatoryReadOnlyAttributeTypeProperty(AttributeType value) throws IllegalPropertyValueException,
            PropertyIsReadOnlyException;
    void setMandatoryReadOnlyAttributeTypeProperty(AttributeType value) throws PropertyException,
            PropertyException;
    /**
     * Get the "optional-multi-valued-dn-property1" property.
@@ -159,10 +159,10 @@
     * @param values
     *            The values of the "optional-multi-valued-dn-property1"
     *            property.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If one or more of the new values are invalid.
     */
    void setOptionalMultiValuedDNProperty1(Collection<DN> values) throws IllegalPropertyValueException;
    void setOptionalMultiValuedDNProperty1(Collection<DN> values) throws PropertyException;
    /**
     * Get the "optional-multi-valued-dn-property2" property.
@@ -184,9 +184,9 @@
     * @param values
     *            The values of the "optional-multi-valued-dn-property2"
     *            property.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If one or more of the new values are invalid.
     */
    void setOptionalMultiValuedDNProperty2(Collection<DN> values) throws IllegalPropertyValueException;
    void setOptionalMultiValuedDNProperty2(Collection<DN> values) throws PropertyException;
}
opendj-config/src/test/java/org/forgerock/opendj/config/TestChildCfgDefn.java
@@ -334,7 +334,7 @@
        /**
         * {@inheritDoc}
         */
        public void setMandatoryReadOnlyAttributeTypeProperty(AttributeType value) throws PropertyIsReadOnlyException {
        public void setMandatoryReadOnlyAttributeTypeProperty(AttributeType value) throws PropertyException {
            impl.setPropertyValue(INSTANCE.getMandatoryReadOnlyAttributeTypePropertyPropertyDefinition(), value);
        }
opendj-config/src/test/java/org/forgerock/opendj/config/TestParentCfgClient.java
@@ -68,10 +68,10 @@
     *
     * @param value
     *            The value of the "mandatory-boolean-property" property.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If the new value is invalid.
     */
    void setMandatoryBooleanProperty(boolean value) throws IllegalPropertyValueException;
    void setMandatoryBooleanProperty(boolean value) throws PropertyException;
    /**
     * Get the "mandatory-class-property" property.
@@ -89,10 +89,10 @@
     *
     * @param value
     *            The value of the "mandatory-class-property" property.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If the new value is invalid.
     */
    void setMandatoryClassProperty(String value) throws IllegalPropertyValueException;
    void setMandatoryClassProperty(String value) throws PropertyException;
    /**
     * Get the "mandatory-read-only-attribute-type-property" property.
@@ -115,13 +115,13 @@
     * @param value
     *            The value of the "mandatory-read-only-attribute-type-property"
     *            property.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If the new value is invalid.
     * @throws PropertyIsReadOnlyException
     * @throws PropertyException
     *             If this Test Parent is not being initialized.
     */
    void setMandatoryReadOnlyAttributeTypeProperty(AttributeType value) throws IllegalPropertyValueException,
            PropertyIsReadOnlyException;
    void setMandatoryReadOnlyAttributeTypeProperty(AttributeType value) throws PropertyException,
            PropertyException;
    /**
     * Get the "optional-multi-valued-dn-property" property.
@@ -141,10 +141,10 @@
     * @param values
     *            The values of the "optional-multi-valued-dn-property"
     *            property.
     * @throws IllegalPropertyValueException
     * @throws PropertyException
     *             If one or more of the new values are invalid.
     */
    void setOptionalMultiValuedDNProperty(Collection<DN> values) throws IllegalPropertyValueException;
    void setOptionalMultiValuedDNProperty(Collection<DN> values) throws PropertyException;
    /**
     * Lists the Test Children.
@@ -195,7 +195,7 @@
     *            The name of the new Test Child.
     * @param exceptions
     *            An optional collection in which to place any
     *            {@link DefaultBehaviorException}s that occurred whilst
     *            {@link PropertyException}s that occurred whilst
     *            attempting to determine the default values of the Test Child.
     *            This argument can be <code>null<code>.
     * @return Returns a new Test Child configuration instance.
@@ -203,7 +203,7 @@
     *             If the name is invalid.
     */
    <C extends TestChildCfgClient> C createTestChild(ManagedObjectDefinition<C, ? extends TestChildCfg> d, String name,
            Collection<DefaultBehaviorException> exceptions) throws IllegalManagedObjectNameException;
            Collection<PropertyException> exceptions) throws IllegalManagedObjectNameException;
    /**
     * Removes the named Test Child.
@@ -270,13 +270,13 @@
     *            The definition of the Optional Test Child to be created.
     * @param exceptions
     *            An optional collection in which to place any
     *            {@link DefaultBehaviorException}s that occurred whilst
     *            {@link PropertyException}s that occurred whilst
     *            attempting to determine the default values of the Optional
     *            Test Child. This argument can be <code>null<code>.
     * @return Returns a new Optional Test Child configuration instance.
     */
    <C extends TestChildCfgClient> C createOptionalTestChild(ManagedObjectDefinition<C, ? extends TestChildCfg> d,
            Collection<DefaultBehaviorException> exceptions);
            Collection<PropertyException> exceptions);
    /**
     * Removes the Optional Test Child if it exists.
opendj-config/src/test/java/org/forgerock/opendj/config/TestParentCfgDefn.java
@@ -299,7 +299,7 @@
        /**
         * {@inheritDoc}
         */
        public void setMandatoryReadOnlyAttributeTypeProperty(AttributeType value) throws PropertyIsReadOnlyException {
        public void setMandatoryReadOnlyAttributeTypeProperty(AttributeType value) throws PropertyException {
            impl.setPropertyValue(INSTANCE.getMandatoryReadOnlyAttributeTypePropertyPropertyDefinition(), value);
        }
@@ -337,7 +337,7 @@
         * {@inheritDoc}
         */
        public <M extends TestChildCfgClient> M createTestChild(ManagedObjectDefinition<M, ? extends TestChildCfg> d,
                String name, Collection<DefaultBehaviorException> exceptions) throws IllegalManagedObjectNameException {
                String name, Collection<PropertyException> exceptions) throws IllegalManagedObjectNameException {
            return impl.createChild(INSTANCE.getTestChildrenRelationDefinition(), d, name, exceptions)
                    .getConfiguration();
        }
@@ -370,7 +370,7 @@
         * {@inheritDoc}
         */
        public <M extends TestChildCfgClient> M createOptionalTestChild(
                ManagedObjectDefinition<M, ? extends TestChildCfg> d, Collection<DefaultBehaviorException> exceptions) {
                ManagedObjectDefinition<M, ? extends TestChildCfg> d, Collection<PropertyException> exceptions) {
            return impl.createChild(INSTANCE.getOptionalTestChildRelationDefinition(), d, exceptions)
                    .getConfiguration();
        }
opendj-config/src/test/java/org/forgerock/opendj/config/client/ldap/AggregationClientTest.java
@@ -32,10 +32,9 @@
import java.util.TreeSet;
import org.forgerock.opendj.config.AdminTestCase;
import org.forgerock.opendj.config.IllegalPropertyValueStringException;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.LDAPProfile;
import org.forgerock.opendj.config.PropertyDefinitionsOptions;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.TestCfg;
import org.forgerock.opendj.config.TestChildCfgClient;
import org.forgerock.opendj.config.TestChildCfgDefn;
@@ -248,11 +247,10 @@
            Assert.assertEquals(causes.size(), 1);
            Throwable cause = causes.iterator().next();
            if (cause instanceof IllegalPropertyValueStringException) {
                IllegalPropertyValueStringException pe = (IllegalPropertyValueStringException) cause;
            if (cause instanceof PropertyException) {
                PropertyException pe = (PropertyException) cause;
                Assert.assertEquals(pe.getPropertyDefinition(), TestChildCfgDefn.getInstance()
                        .getAggregationPropertyPropertyDefinition());
                Assert.assertEquals(pe.getIllegalValueString(), "cn=LDAP Connection Handler, cn=bad rdn, cn=config");
            } else {
                // Got an unexpected cause.
                throw e;
opendj-config/src/test/java/org/forgerock/opendj/config/server/AggregationServerTest.java
@@ -42,9 +42,8 @@
import org.forgerock.opendj.config.AdminTestCase;
import org.forgerock.opendj.config.AdministratorAction;
import org.forgerock.opendj.config.AggregationPropertyDefinition;
import org.forgerock.opendj.config.IllegalPropertyValueStringException;
import org.forgerock.opendj.config.PropertyDefinitionsOptions;
import org.forgerock.opendj.config.PropertyException;
import org.forgerock.opendj.config.PropertyDefinitionsOptions;
import org.forgerock.opendj.config.PropertyOption;
import org.forgerock.opendj.config.TestCfg;
import org.forgerock.opendj.config.TestChildCfg;
@@ -307,11 +306,9 @@
            ServerManagedObjectDecodingException de = (ServerManagedObjectDecodingException) e.getCause();
            assertThat(de.getCauses()).hasSize(1);
            PropertyException propertyException = de.getCauses().iterator().next();
            assertThat(propertyException).isInstanceOf(IllegalPropertyValueStringException.class);
            IllegalPropertyValueStringException pe = (IllegalPropertyValueStringException) propertyException;
            assertEquals(pe.getPropertyDefinition(), TestChildCfgDefn.getInstance()
            assertThat(propertyException).isInstanceOf(PropertyException.class);
            assertEquals(propertyException.getPropertyDefinition(), TestChildCfgDefn.getInstance()
                .getAggregationPropertyPropertyDefinition());
            assertEquals(pe.getIllegalValueString(), "cn=LDAP Connection Handler, cn=bad rdn, cn=config");
        }
    }