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

Matthew Swift
18.55.2014 d46701cdbecec6f6c10f57432f3e6a484752f42c
opendj3-server-dev/resource/admin/clientMO.xsl
@@ -187,14 +187,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>
@@ -304,7 +304,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;',
@@ -313,7 +313,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">
@@ -332,14 +332,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>
@@ -402,12 +402,12 @@
        <xsl:if
          test="$this-local-properties[not(@monitoring='true')]">
          <import>
            org.opends.server.admin.IllegalPropertyValueException
            org.opends.server.admin.PropertyException
          </import>
        </xsl:if>
        <xsl:if test="$this-local-properties[@read-only='true']">
          <import>
            org.opends.server.admin.PropertyIsReadOnlyException
            org.opends.server.admin.PropertyException
          </import>
        </xsl:if>
        <xsl:if test="$this-local-relations">
@@ -447,7 +447,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.opends.server.admin.DefaultBehaviorException
            org.opends.server.admin.PropertyException
          </import>
          <import>
            org.opends.server.admin.client.OperationRejectedException
opendj3-server-dev/resource/admin/metaMO.xsl
@@ -1226,7 +1226,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>
@@ -1281,7 +1281,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>
@@ -1292,7 +1292,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>
@@ -1968,7 +1968,7 @@
                </import>
              </xsl:if>
              <import>
                org.opends.server.admin.DefaultBehaviorException
                org.opends.server.admin.PropertyException
              </import>
              <import>
                org.opends.server.admin.server.ConfigurationAddListener
@@ -1981,7 +1981,7 @@
            <xsl:if test="$this-all-relations/adm:one-to-zero-or-one">
              <import>java.util.Collection</import>
              <import>
                org.opends.server.admin.DefaultBehaviorException
                org.opends.server.admin.PropertyException
              </import>
              <import>
                org.opends.server.admin.server.ConfigurationAddListener
@@ -2000,7 +2000,7 @@
            </xsl:if>
            <xsl:if test="$this-all-properties[@read-only='true']">
              <import>
                org.opends.server.admin.PropertyIsReadOnlyException
                org.opends.server.admin.PropertyException
              </import>
            </xsl:if>
          </xsl:otherwise>
opendj3-server-dev/resource/admin/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;' ,
opendj3-server-dev/src/quicksetup/org/opends/quicksetup/installer/InstallerHelper.java
@@ -52,7 +52,7 @@
import static org.opends.quicksetup.util.Utils.*;
import org.opends.server.admin.DefaultBehaviorException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.ManagedObjectNotFoundException;
import org.opends.server.admin.client.ManagementContext;
import org.opends.server.admin.client.ldap.LDAPManagementContext;
@@ -497,7 +497,7 @@
          ReplicationSynchronizationProviderCfgDefn.getInstance();
        sync = root.createSynchronizationProvider(provider,
            "Multimaster Synchronization",
            new ArrayList<DefaultBehaviorException>());
            new ArrayList<PropertyException>());
        sync.setJavaClass(
            org.opends.server.replication.plugin.MultimasterReplication.class.
            getName());
@@ -550,7 +550,7 @@
        usedReplicationServerIds.add(id);
        replicationServer = sync.createReplicationServer(
            ReplicationServerCfgDefn.getInstance(),
            new ArrayList<DefaultBehaviorException>());
            new ArrayList<PropertyException>());
        replicationServer.setReplicationServerId(id);
        replicationServer.setReplicationPort(replicationPort);
        replicationServerCreated = true;
@@ -619,7 +619,7 @@
          domainName = getDomainName(domainNames, domainId, dn);
          domain = sync.createReplicationDomain(
              ReplicationDomainCfgDefn.getInstance(), domainName,
              new ArrayList<DefaultBehaviorException>());
              new ArrayList<PropertyException>());
          domain.setServerId(domainId);
          domain.setBaseDN(DN.valueOf(dn));
          isCreated = true;
opendj3-server-dev/src/server/org/opends/server/admin/ACIPropertyDefinition.java
@@ -101,7 +101,7 @@
   */
  @Override
  public void validateValue(Aci value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    ifNull(value);
    // No additional validation required.
@@ -112,14 +112,14 @@
   */
  @Override
  public Aci decodeValue(String value)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    ifNull(value);
    try {
      return Aci.decode(ByteString.valueOf(value), DN.NULL_DN);
    } catch (AciException e) {
      // TODO: it would be nice to throw the cause.
      throw new IllegalPropertyValueStringException(this, value);
      throw PropertyException.illegalPropertyValueException(this, value);
    }
  }
opendj3-server-dev/src/server/org/opends/server/admin/AggregationPropertyDefinition.java
@@ -945,14 +945,14 @@
   */
  @Override
  public String decodeValue(String value)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    ifNull(value);
    try {
      validateValue(value);
      return value;
    } catch (IllegalPropertyValueException e) {
      throw new IllegalPropertyValueStringException(this, value);
    } catch (PropertyException e) {
      throw PropertyException.illegalPropertyValueException(this, value);
    }
  }
@@ -1108,13 +1108,13 @@
   */
  @Override
  public String normalizeValue(String value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    try {
      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);
    }
  }
@@ -1146,11 +1146,11 @@
   * {@inheritDoc}
   */
  @Override
  public void validateValue(String value) throws IllegalPropertyValueException {
  public void validateValue(String value) throws PropertyException {
    try {
      Reference.parseName(parentPath, relationDefinition, value);
    } catch (IllegalArgumentException e) {
      throw new IllegalPropertyValueException(this, value);
      throw PropertyException.illegalPropertyValueException(this, value);
    }
  }
opendj3-server-dev/src/server/org/opends/server/admin/AttributeTypePropertyDefinition.java
@@ -174,7 +174,7 @@
   */
  @Override
  public AttributeType decodeValue(String value)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    ifNull(value);
    String name = value.trim().toLowerCase();
@@ -182,13 +182,13 @@
        !isCheckSchema);
    if (type == null) {
      throw new IllegalPropertyValueStringException(this, value);
      throw PropertyException.illegalPropertyValueException(this, value);
    } else {
      try {
        validateValue(type);
        return type;
      } catch (IllegalPropertyValueException e) {
        throw new IllegalPropertyValueStringException(this, value);
      } catch (PropertyException e) {
        throw PropertyException.illegalPropertyValueException(this, value);
      }
    }
  }
@@ -200,7 +200,7 @@
   */
  @Override
  public String encodeValue(AttributeType value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    return value.getNameOrOID();
  }
@@ -211,7 +211,7 @@
   */
  @Override
  public void validateValue(AttributeType value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    ifNull(value);
    // No implementation required.
opendj3-server-dev/src/server/org/opends/server/admin/BooleanPropertyDefinition.java
@@ -124,7 +124,7 @@
   */
  @Override
  public void validateValue(Boolean value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    ifNull(value);
    // No additional validation required.
@@ -137,14 +137,14 @@
   */
  @Override
  public Boolean decodeValue(String value)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    ifNull(value);
    String nvalue = value.trim().toLowerCase();
    Boolean b = VALUE_MAP.get(nvalue);
    if (b == null) {
      throw new IllegalPropertyValueStringException(this, value);
      throw PropertyException.illegalPropertyValueException(this, value);
    } else {
      return b;
    }
opendj3-server-dev/src/server/org/opends/server/admin/ClassPropertyDefinition.java
@@ -30,6 +30,7 @@
import static org.forgerock.util.Reject.ifNull;
import static org.opends.server.admin.PropertyException.*;
import java.util.Collections;
import java.util.EnumSet;
@@ -244,13 +245,13 @@
   */
  @Override
  public String decodeValue(String value)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    ifNull(value);
    try {
      validateValue(value);
    } catch (IllegalPropertyValueException e) {
      throw new IllegalPropertyValueStringException(this, value, e.getCause());
    } catch (PropertyException e) {
      throw illegalPropertyValueException(this, value, e.getCause());
    }
    return value;
@@ -283,7 +284,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
@@ -291,7 +292,7 @@
   *           requested type.
   */
  public <T> Class<? extends T> loadClass(String className,
      Class<T> instanceOf) throws IllegalPropertyValueException,
      Class<T> instanceOf) throws PropertyException,
      ClassCastException {
    ifNull(className, instanceOf);
@@ -310,7 +311,7 @@
   */
  @Override
  public String normalizeValue(String value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    ifNull(value);
    return value.trim();
@@ -323,7 +324,7 @@
   */
  @Override
  public void validateValue(String value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    ifNull(value);
    // Always make sure the name is a valid class name.
@@ -345,14 +346,14 @@
   * definition.
   */
  private Class<?> validateClassInterfaces(String className, boolean initialize)
      throws IllegalPropertyValueException {
      throws PropertyException {
    Class<?> theClass = loadClassForValidation(className, className,
        initialize);
    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;
@@ -366,10 +367,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 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 illegalPropertyValueException(this, componentClassName, e);
    }
  }
@@ -379,10 +380,10 @@
   * Do some basic checks to make sure the string representation is valid.
   */
  private void validateClassName(String className)
      throws IllegalPropertyValueException {
      throws PropertyException {
    String nvalue = className.trim();
    if (!nvalue.matches(CLASS_RE)) {
      throw new IllegalPropertyValueException(this, className);
      throw PropertyException.illegalPropertyValueException(this, className);
    }
  }
}
opendj3-server-dev/src/server/org/opends/server/admin/DNPropertyDefinition.java
@@ -171,7 +171,7 @@
   */
  @Override
  public void validateValue(DN value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    ifNull(value);
    if (baseDN != null) {
@@ -182,7 +182,7 @@
      }
      if (!parent.equals(baseDN)) {
        throw new IllegalPropertyValueException(this, value);
        throw PropertyException.illegalPropertyValueException(this, value);
      }
    }
  }
@@ -194,7 +194,7 @@
   */
  @Override
  public DN decodeValue(String value)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    ifNull(value);
    try {
@@ -202,9 +202,9 @@
      validateValue(dn);
      return dn;
    } catch (DirectoryException e) {
      throw new IllegalPropertyValueStringException(this, value);
    } catch (IllegalPropertyValueException e) {
      throw new IllegalPropertyValueStringException(this, value);
      throw PropertyException.illegalPropertyValueException(this, value);
    } catch (PropertyException e) {
      throw PropertyException.illegalPropertyValueException(this, value);
    }
  }
opendj3-server-dev/src/server/org/opends/server/admin/DefaultBehaviorException.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/admin/DurationPropertyDefinition.java
@@ -462,20 +462,20 @@
   * {@inheritDoc}
   */
  @Override
  public void validateValue(Long value) throws IllegalPropertyValueException {
  public void validateValue(Long value) throws PropertyException {
    ifNull(value);
    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);
    }
  }
@@ -485,7 +485,7 @@
   * {@inheritDoc}
   */
  @Override
  public String encodeValue(Long value) throws IllegalPropertyValueException {
  public String encodeValue(Long value) throws PropertyException {
    ifNull(value);
    // Make sure that we correctly encode negative values as
@@ -511,7 +511,7 @@
   */
  @Override
  public Long decodeValue(String value)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    ifNull(value);
    // First check for the special "unlimited" value when necessary.
@@ -526,21 +526,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);
    } catch (IllegalPropertyValueException e) {
      throw new IllegalPropertyValueStringException(this, value);
    } catch (PropertyException e) {
      throw PropertyException.illegalPropertyValueException(this, value);
    }
    return i;
  }
opendj3-server-dev/src/server/org/opends/server/admin/EnumPropertyDefinition.java
@@ -179,13 +179,13 @@
   */
  @Override
  public E decodeValue(String value)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    ifNull(value);
    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;
    }
@@ -254,7 +254,7 @@
   */
  @Override
  public String normalizeValue(E value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    ifNull(value);
    return value.toString().trim().toLowerCase();
@@ -267,7 +267,7 @@
   */
  @Override
  public void validateValue(E value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    ifNull(value);
    // No additional validation required.
opendj3-server-dev/src/server/org/opends/server/admin/IPAddressMaskPropertyDefinition.java
@@ -110,7 +110,7 @@
   */
  @Override
  public void validateValue(AddressMask value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    ifNull(value);
    // No additional validation required.
@@ -123,14 +123,14 @@
   */
  @Override
  public AddressMask decodeValue(String value)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    ifNull(value);
    try {
      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);
    }
  }
opendj3-server-dev/src/server/org/opends/server/admin/IPAddressPropertyDefinition.java
@@ -109,7 +109,7 @@
   */
  @Override
  public void validateValue(InetAddress value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    ifNull(value);
    // No additional validation required.
@@ -122,14 +122,14 @@
   */
  @Override
  public InetAddress decodeValue(String value)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    ifNull(value);
    try {
      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);
    }
  }
@@ -140,7 +140,7 @@
   */
  @Override
  public String encodeValue(InetAddress value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    // We should return the host name if it is available, or the IP
    // address if not.
opendj3-server-dev/src/server/org/opends/server/admin/IllegalPropertyValueException.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/admin/IllegalPropertyValueStringException.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/admin/IntegerPropertyDefinition.java
@@ -276,19 +276,19 @@
   */
  @Override
  public void validateValue(Integer value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    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);
    }
  }
@@ -297,7 +297,7 @@
   */
  @Override
  public String encodeValue(Integer value)
          throws IllegalPropertyValueException {
          throws PropertyException {
    ifNull(value);
    // Make sure that we correctly encode negative values as "unlimited".
@@ -315,7 +315,7 @@
   */
  @Override
  public Integer decodeValue(String value)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    ifNull(value);
    if (allowUnlimited) {
@@ -328,13 +328,13 @@
    try {
      i = Integer.valueOf(value);
    } catch (NumberFormatException e) {
      throw new IllegalPropertyValueStringException(this, value);
      throw PropertyException.illegalPropertyValueException(this, value);
    }
    try {
      validateValue(i);
    } catch (IllegalPropertyValueException e) {
      throw new IllegalPropertyValueStringException(this, value);
    } catch (PropertyException e) {
      throw PropertyException.illegalPropertyValueException(this, value);
    }
    return i;
opendj3-server-dev/src/server/org/opends/server/admin/PropertyDefinition.java
@@ -365,11 +365,11 @@
   * @param value
   *          The property string value (must not be <code>null</code>).
   * @return Returns the decoded property value.
   * @throws IllegalPropertyValueStringException
   * @throws PropertyException
   *           If the property value string is invalid.
   */
  public abstract T decodeValue(String value)
      throws IllegalPropertyValueStringException;
      throws PropertyException;
@@ -383,10 +383,10 @@
   * @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) throws IllegalPropertyValueException {
  public String encodeValue(T value) throws PropertyException {
    ifNull(value);
    return value.toString();
@@ -602,10 +602,10 @@
   * @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) throws IllegalPropertyValueException {
  public String normalizeValue(T value) throws PropertyException {
    ifNull(value);
    return encodeValue(value);
@@ -653,11 +653,11 @@
   *
   * @param value
   *          The property value (must not be <code>null</code>).
   * @throws IllegalPropertyValueException
   * @throws PropertyException
   *           If the property value is invalid.
   */
  public abstract void validateValue(T value)
      throws IllegalPropertyValueException;
      throws PropertyException;
opendj3-server-dev/src/server/org/opends/server/admin/PropertyDefinitionUsageBuilder.java
@@ -338,7 +338,7 @@
     */
    @Override
    public <T> Message visitUnknown(PropertyDefinition<T> d, Void p)
        throws UnknownPropertyDefinitionException {
        throws PropertyException {
      return Message.raw("?");
    }
  }
opendj3-server-dev/src/server/org/opends/server/admin/PropertyDefinitionVisitor.java
@@ -274,7 +274,7 @@
   * definition types.
   * <p>
   * The default implementation of this method throws an
   * {@link UnknownPropertyDefinitionException}. Sub-classes can
   * {@link PropertyException}. Sub-classes can
   * override this method with their own default behavior.
   *
   * @param <T>
@@ -284,13 +284,13 @@
   * @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)
      throws UnknownPropertyDefinitionException {
    throw new UnknownPropertyDefinitionException(pd, p);
      throws PropertyException {
    throw PropertyException.unknownPropertyDefinitionException(pd, p);
  }
}
opendj3-server-dev/src/server/org/opends/server/admin/PropertyException.java
@@ -22,62 +22,186 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions copyright 2014 ForgeRock AS.
 */
package org.opends.server.admin;
import static org.opends.messages.AdminMessages.*;
import org.opends.messages.Message;
/**
 * Exceptions thrown as a result of errors that occurred when decoding
 * and modifying property values.
 * 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;
  // The property definition associated with the property that caused
  // the exception.
  private final PropertyDefinition<?> pd;
  /**
   * 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(
      PropertyDefinition<?> pd, Throwable cause)
  {
    return new PropertyException(pd,
        ERR_DEFAULT_BEHAVIOR_PROPERTY_EXCEPTION.get(pd.getName()), cause);
  }
  /**
   * Creates property exception without a cause.
   * Creates a new illegal property value exception.
   *
   * @param pd
   *          The property definition associated with the property
   *          that caused the exception.
   * @param message
   *          The message.
   *          The property definition.
   * @param value
   *          The illegal property value.
   * @return A new illegal property value exception.
   */
  protected PropertyException(PropertyDefinition<?> pd, Message message) {
  public static PropertyException illegalPropertyValueException(
      PropertyDefinition<?> pd, 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(
      PropertyDefinition<?> pd, Object value, 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(
      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(
      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(
      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(
      PropertyDefinition<?> pd, Object p)
  {
    return new PropertyException(pd,
        ERR_UNKNOWN_PROPERTY_DEFINITION_EXCEPTION.get(pd.getName(), pd
            .getClass().getName()));
  }
  // Create the message.
  private static Message createMessage(PropertyDefinition<?> pd, Object value)
  {
    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;
  private PropertyException(PropertyDefinition<?> pd, Message 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, Message message,
      Throwable cause) {
  private PropertyException(PropertyDefinition<?> pd, Message message,
      Throwable cause)
  {
    super(message, cause);
    this.pd = pd;
  }
@@ -85,13 +209,14 @@
  /**
   * Get the property definition associated with the property that
   * caused the exception.
   * Get the property definition associated with the property that caused the
   * exception.
   *
   * @return Returns the property definition associated with the
   *         property that caused the exception.
   * @return Returns the property definition associated with the property that
   *         caused the exception.
   */
  public final PropertyDefinition<?> getPropertyDefinition() {
  public final PropertyDefinition<?> getPropertyDefinition()
  {
    return pd;
  }
opendj3-server-dev/src/server/org/opends/server/admin/PropertyIsMandatoryException.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/admin/PropertyIsReadOnlyException.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/admin/PropertyIsSingleValuedException.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/admin/PropertyValueVisitor.java
@@ -312,7 +312,7 @@
   * property.
   * <p>
   * The default implementation of this method throws an
   * {@link UnknownPropertyDefinitionException}. Sub-classes can
   * {@link PropertyException}. Sub-classes can
   * override this method with their own default behavior.
   *
   * @param <T>
@@ -324,13 +324,13 @@
   * @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)
      throws UnknownPropertyDefinitionException {
    throw new UnknownPropertyDefinitionException(pd, p);
      throws PropertyException {
    throw PropertyException.unknownPropertyDefinitionException(pd, p);
  }
}
opendj3-server-dev/src/server/org/opends/server/admin/Reference.java
@@ -233,7 +233,7 @@
      try {
        T tvalue = pd.decodeValue(name);
        return pd.normalizeValue(tvalue);
      } catch (IllegalPropertyValueStringException e) {
      } catch (PropertyException e) {
        // Fall through to default normalization.
      }
    }
opendj3-server-dev/src/server/org/opends/server/admin/SizePropertyDefinition.java
@@ -278,19 +278,19 @@
   * {@inheritDoc}
   */
  @Override
  public void validateValue(Long value) throws IllegalPropertyValueException {
  public void validateValue(Long value) throws PropertyException {
    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);
    }
  }
@@ -300,7 +300,7 @@
   * {@inheritDoc}
   */
  @Override
  public String encodeValue(Long value) throws IllegalPropertyValueException {
  public String encodeValue(Long value) throws PropertyException {
    ifNull(value);
    // Make sure that we correctly encode negative values as "unlimited".
@@ -329,7 +329,7 @@
   */
  @Override
  public Long decodeValue(String value)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    ifNull(value);
    // First check for the special "unlimited" value when necessary.
@@ -344,13 +344,13 @@
    try {
      i = SizeUnit.parseValue(value, SizeUnit.BYTES);
    } catch (NumberFormatException e) {
      throw new IllegalPropertyValueStringException(this, value);
      throw PropertyException.illegalPropertyValueException(this, value);
    }
    try {
      validateValue(i);
    } catch (IllegalPropertyValueException e) {
      throw new IllegalPropertyValueStringException(this, value);
    } catch (PropertyException e) {
      throw PropertyException.illegalPropertyValueException(this, value);
    }
    return i;
  }
opendj3-server-dev/src/server/org/opends/server/admin/StringPropertyDefinition.java
@@ -203,13 +203,13 @@
   */
  @Override
  public String decodeValue(String value)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    ifNull(value);
    try {
      validateValue(value);
    } catch (IllegalPropertyValueException e) {
      throw new IllegalPropertyValueStringException(this, value);
    } catch (PropertyException e) {
      throw PropertyException.illegalPropertyValueException(this, value);
    }
    return value;
@@ -306,7 +306,7 @@
   */
  @Override
  public String normalizeValue(String value)
      throws IllegalPropertyValueException {
      throws PropertyException {
    ifNull(value);
    if (isCaseInsensitive()) {
@@ -322,13 +322,13 @@
   * {@inheritDoc}
   */
  @Override
  public void validateValue(String value) throws IllegalPropertyValueException {
  public void validateValue(String value) throws PropertyException {
    ifNull(value);
    if (pattern != null) {
      Matcher matcher = pattern.matcher(value);
      if (!matcher.matches()) {
        throw new IllegalPropertyValueException(this, value);
        throw PropertyException.illegalPropertyValueException(this, value);
      }
    }
  }
opendj3-server-dev/src/server/org/opends/server/admin/UnknownPropertyDefinitionException.java
File was deleted
opendj3-server-dev/src/server/org/opends/server/admin/client/IllegalManagedObjectNameException.java
@@ -31,7 +31,7 @@
import static org.opends.messages.AdminMessages.*;
import org.opends.messages.Message;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.OperationsException;
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyDefinitionUsageBuilder;
@@ -66,7 +66,7 @@
    } else if (namingPropertyDefinition != null) {
      try {
        namingPropertyDefinition.decodeValue(illegalName);
      } catch (IllegalPropertyValueStringException e) {
      } catch (PropertyException e) {
        PropertyDefinitionUsageBuilder builder =
          new PropertyDefinitionUsageBuilder(true);
        return ERR_ILLEGAL_MANAGED_OBJECT_NAME_EXCEPTION_SYNTAX.get(
opendj3-server-dev/src/server/org/opends/server/admin/client/ManagedObject.java
@@ -33,9 +33,8 @@
import org.opends.server.admin.AbstractManagedObjectDefinition;
import org.opends.server.admin.Configuration;
import org.opends.server.admin.DefaultBehaviorException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.DefinitionDecodingException;
import org.opends.server.admin.IllegalPropertyValueException;
import org.opends.server.admin.InstantiableRelationDefinition;
import org.opends.server.admin.ManagedObjectAlreadyExistsException;
import org.opends.server.admin.ManagedObjectDefinition;
@@ -44,9 +43,6 @@
import org.opends.server.admin.ManagedObjectPath;
import org.opends.server.admin.OptionalRelationDefinition;
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyIsMandatoryException;
import org.opends.server.admin.PropertyIsReadOnlyException;
import org.opends.server.admin.PropertyIsSingleValuedException;
import org.opends.server.admin.PropertyProvider;
import org.opends.server.admin.SetRelationDefinition;
import org.opends.server.admin.SingletonRelationDefinition;
@@ -168,7 +164,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
@@ -182,7 +178,7 @@
  <C extends ConfigurationClient, S extends Configuration, CC extends C>
  ManagedObject<CC> createChild(InstantiableRelationDefinition<C, S> r,
      ManagedObjectDefinition<CC, ? extends S> d, String name,
      Collection<DefaultBehaviorException> exceptions)
      Collection<PropertyException> exceptions)
      throws IllegalManagedObjectNameException, IllegalArgumentException;
@@ -209,7 +205,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
@@ -221,7 +217,7 @@
  <C extends ConfigurationClient, S extends Configuration, CC extends C>
  ManagedObject<CC> createChild(OptionalRelationDefinition<C, S> r,
      ManagedObjectDefinition<CC, ? extends S> d,
      Collection<DefaultBehaviorException> exceptions)
      Collection<PropertyException> exceptions)
      throws IllegalArgumentException;
@@ -248,7 +244,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
@@ -260,7 +256,7 @@
  <C extends ConfigurationClient, S extends Configuration, CC extends C>
  ManagedObject<CC> createChild(SetRelationDefinition<C, S> r,
      ManagedObjectDefinition<CC, ? extends S> d,
      Collection<DefaultBehaviorException> exceptions)
      Collection<PropertyException> exceptions)
      throws IllegalArgumentException;
@@ -870,68 +866,55 @@
  /**
   * Sets a new pending value for the specified property.
   * <p>
   * See the class description for more information regarding pending
   * values.
   * See the class description for more information regarding pending values.
   *
   * @param <PD>
   *          The type of the property to be modified.
   * @param pd
   *          The property to be modified.
   * @param value
   *          The new pending value for the property, or
   *          <code>null</code> if the property should be reset to
   *          its default behavior.
   * @throws IllegalPropertyValueException
   *           If the new pending value is deemed to be invalid
   *           according to the property definition.
   * @throws PropertyIsReadOnlyException
   *           If this is not a new managed object and the property is
   *           read-only or for monitoring purposes.
   * @throws PropertyIsMandatoryException
   *           If an attempt was made to remove a mandatory property.
   *          The new pending value for the property, or <code>null</code> if
   *          the property should be reset to its default behavior.
   * @throws PropertyException
   *           If the new pending value is deemed to be invalid according to the
   *           property definition, or if this is not a new managed object and
   *           the property is read-only or for monitoring purposes, or if an
   *           attempt was made to remove a mandatory property.
   * @throws IllegalArgumentException
   *           If the specified property definition is not associated
   *           with this managed object.
   *           If the specified property definition is not associated with this
   *           managed object.
   */
  <PD> void setPropertyValue(PropertyDefinition<PD> pd, PD value)
      throws IllegalPropertyValueException, PropertyIsReadOnlyException,
      PropertyIsMandatoryException, IllegalArgumentException;
      throws PropertyException, IllegalArgumentException;
  /**
   * Sets a new pending values for the specified property.
   * <p>
   * See the class description for more information regarding pending
   * values.
   * See the class description for more information regarding pending values.
   *
   * @param <PD>
   *          The type of the property to be modified.
   * @param pd
   *          The property to be modified.
   * @param values
   *          A non-<code>null</code> set of new pending values for
   *          the property (an empty set indicates that the property
   *          should be reset to its default behavior). The set will
   *          not be referenced by this managed object.
   * @throws IllegalPropertyValueException
   *           If a new pending value is deemed to be invalid
   *           according to the property definition.
   * @throws PropertyIsSingleValuedException
   *           If an attempt was made to add multiple pending values
   *           to a single-valued property.
   * @throws PropertyIsReadOnlyException
   *           If this is not a new managed object and the property is
   *           read-only or for monitoring purposes.
   * @throws PropertyIsMandatoryException
   *           If an attempt was made to remove a mandatory property.
   *          A non-<code>null</code> set of new pending values for the property
   *          (an empty set indicates that the property should be reset to its
   *          default behavior). The set will not be referenced by this managed
   *          object.
   * @throws PropertyException
   *           If a new pending value is deemed to be invalid according to the
   *           property definition, or if an attempt was made to add multiple
   *           pending values to a single-valued property, or if this is not a
   *           new managed object and the property is read-only or for
   *           monitoring purposes, or if an attempt was made to remove a
   *           mandatory property.
   * @throws IllegalArgumentException
   *           If the specified property definition is not associated
   *           with this managed object.
   *           If the specified property definition is not associated with this
   *           managed object.
   */
  <PD> void setPropertyValues(PropertyDefinition<PD> pd, Collection<PD> values)
      throws IllegalPropertyValueException, PropertyIsSingleValuedException,
      PropertyIsReadOnlyException, PropertyIsMandatoryException,
      IllegalArgumentException;
      throws PropertyException, IllegalArgumentException;
}
opendj3-server-dev/src/server/org/opends/server/admin/client/MissingMandatoryPropertiesException.java
@@ -38,7 +38,7 @@
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.opends.server.admin.OperationsException;
import org.opends.server.admin.PropertyIsMandatoryException;
import org.opends.server.admin.PropertyException;
import org.forgerock.util.Reject;
@@ -58,8 +58,8 @@
  // Create the message.
  private static Message createMessage(
      Collection<PropertyIsMandatoryException> causes) {
  private static Message createMessage(Collection<PropertyException> causes)
  {
    Reject.ifNull(causes);
    Reject.ifFalse(!causes.isEmpty());
@@ -70,7 +70,7 @@
      MessageBuilder builder = new MessageBuilder();
      boolean isFirst = true;
      for (PropertyIsMandatoryException cause : causes) {
      for (PropertyException cause : causes) {
        if (!isFirst) {
          builder.append(", ");
        }
@@ -84,7 +84,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.
@@ -111,10 +111,10 @@
   *          object creation.
   */
  public MissingMandatoryPropertiesException(Message 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;
  }
@@ -127,7 +127,7 @@
   * @return Returns the first exception that caused this exception.
   */
  @Override
  public PropertyIsMandatoryException getCause() {
  public PropertyException getCause() {
    return causes.iterator().next();
  }
@@ -140,7 +140,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);
  }
opendj3-server-dev/src/server/org/opends/server/admin/client/ldap/LDAPDriver.java
@@ -52,10 +52,9 @@
import org.opends.server.admin.AggregationPropertyDefinition;
import org.opends.server.admin.Configuration;
import org.opends.server.admin.ConfigurationClient;
import org.opends.server.admin.DefaultBehaviorException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.DefinitionDecodingException;
import org.opends.server.admin.DefinitionResolver;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.InstantiableRelationDefinition;
import org.opends.server.admin.LDAPProfile;
import org.opends.server.admin.ManagedObjectDefinition;
@@ -63,14 +62,10 @@
import org.opends.server.admin.ManagedObjectPath;
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyDefinitionVisitor;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.PropertyIsMandatoryException;
import org.opends.server.admin.PropertyIsSingleValuedException;
import org.opends.server.admin.PropertyOption;
import org.opends.server.admin.Reference;
import org.opends.server.admin.RelationDefinition;
import org.opends.server.admin.SetRelationDefinition;
import org.opends.server.admin.UnknownPropertyDefinitionException;
import org.opends.server.admin.DefinitionDecodingException.Reason;
import org.opends.server.admin.client.AuthorizationException;
import org.opends.server.admin.client.CommunicationException;
@@ -106,12 +101,12 @@
     * @param value
     *          The LDAP string representation.
     * @return Returns the decoded LDAP value.
     * @throws IllegalPropertyValueStringException
     * @throws PropertyException
     *           If the property value could not be decoded because it
     *           was invalid.
     */
    public static <PD> PD decode(PropertyDefinition<PD> pd, Object value)
        throws IllegalPropertyValueStringException {
        throws PropertyException {
      String s = String.valueOf(value);
      return pd.castValue(pd.accept(new ValueDecoder(), s));
    }
@@ -138,7 +133,7 @@
            .getRelationDefinition(), p);
        return reference.getName();
      } catch (IllegalArgumentException e) {
        throw new IllegalPropertyValueStringException(d, p);
        throw PropertyException.illegalPropertyValueException(d, p);
      }
    }
@@ -149,7 +144,7 @@
     */
    @Override
    public <T> Object visitUnknown(PropertyDefinition<T> d, String p)
        throws UnknownPropertyDefinitionException {
        throws PropertyException {
      // By default the property definition's decoder will do.
      return d.decodeValue(p);
    }
@@ -316,11 +311,11 @@
      // Sanity check the returned values.
      if (values.size() > 1 && !pd.hasOption(PropertyOption.MULTI_VALUED)) {
        throw new PropertyIsSingleValuedException(pd);
        throw PropertyException.propertyIsSingleValuedException(pd);
      }
      if (values.isEmpty() && pd.hasOption(PropertyOption.MANDATORY)) {
        throw new PropertyIsMandatoryException(pd);
        throw PropertyException.propertyIsMandatoryException(pd);
      }
      if (values.isEmpty()) {
@@ -628,7 +623,7 @@
    if (activeValues.size() > 1 && !pd.hasOption(PropertyOption.MULTI_VALUED)) {
      // This exception takes precedence over previous exceptions.
      exception = new PropertyIsSingleValuedException(pd);
      exception = PropertyException.propertyIsSingleValuedException(pd);
      PD value = activeValues.first();
      activeValues.clear();
      activeValues.add(value);
@@ -638,7 +633,7 @@
    Collection<PD> defaultValues;
    try {
      defaultValues = findDefaultValues(p, pd, false);
    } catch (DefaultBehaviorException e) {
    } catch (PropertyException e) {
      defaultValues = Collections.emptySet();
      exception = e;
    }
@@ -650,7 +645,7 @@
      // The active values maybe empty because of a previous
      // exception.
      if (exception == null) {
        exception = new PropertyIsMandatoryException(pd);
        exception = PropertyException.propertyIsMandatoryException(pd);
      }
    }
opendj3-server-dev/src/server/org/opends/server/admin/client/ldap/LDAPManagedObject.java
@@ -54,7 +54,7 @@
import org.opends.server.admin.Reference;
import org.opends.server.admin.RelationDefinition;
import org.opends.server.admin.SetRelationDefinition;
import org.opends.server.admin.UnknownPropertyDefinitionException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.client.AuthorizationException;
import org.opends.server.admin.client.CommunicationException;
import org.opends.server.admin.client.ConcurrentModificationException;
@@ -112,7 +112,7 @@
     */
    @Override
    public <PD> Object visitUnknown(PropertyDefinition<PD> pd, PD v, Void p)
        throws UnknownPropertyDefinitionException {
        throws PropertyException {
      return pd.encodeValue(v);
    }
  }
opendj3-server-dev/src/server/org/opends/server/admin/client/spi/AbstractManagedObject.java
@@ -40,11 +40,9 @@
import org.opends.server.admin.Configuration;
import org.opends.server.admin.ConfigurationClient;
import org.opends.server.admin.Constraint;
import org.opends.server.admin.DefaultBehaviorException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.DefaultManagedObject;
import org.opends.server.admin.DefinitionDecodingException;
import org.opends.server.admin.IllegalPropertyValueException;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.InstantiableRelationDefinition;
import org.opends.server.admin.ManagedObjectAlreadyExistsException;
import org.opends.server.admin.ManagedObjectDefinition;
@@ -52,9 +50,6 @@
import org.opends.server.admin.ManagedObjectPath;
import org.opends.server.admin.OptionalRelationDefinition;
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyIsMandatoryException;
import org.opends.server.admin.PropertyIsReadOnlyException;
import org.opends.server.admin.PropertyIsSingleValuedException;
import org.opends.server.admin.PropertyOption;
import org.opends.server.admin.RelationDefinition;
import org.opends.server.admin.RelationDefinitionVisitor;
@@ -306,14 +301,13 @@
      OperationRejectedException, AuthorizationException,
      CommunicationException {
    // 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));
      }
    }
@@ -388,7 +382,7 @@
  ManagedObject<CC> createChild(
      InstantiableRelationDefinition<C, S> r,
      ManagedObjectDefinition<CC, ? extends S> d, String name,
      Collection<DefaultBehaviorException> exceptions)
      Collection<PropertyException> exceptions)
      throws IllegalManagedObjectNameException, IllegalArgumentException {
    validateRelationDefinition(r);
@@ -403,7 +397,7 @@
    if (pd != null) {
      try {
        pd.decodeValue(name);
      } catch (IllegalPropertyValueStringException e) {
      } catch (PropertyException e) {
        throw new IllegalManagedObjectNameException(name, pd);
      }
    }
@@ -422,7 +416,7 @@
  ManagedObject<CC> createChild(
      OptionalRelationDefinition<C, S> r,
      ManagedObjectDefinition<CC, ? extends S> d,
      Collection<DefaultBehaviorException> exceptions)
      Collection<PropertyException> exceptions)
      throws IllegalArgumentException {
    validateRelationDefinition(r);
    ManagedObjectPath<CC, ? extends S> childPath = path.child(r, d);
@@ -439,7 +433,7 @@
  ManagedObject<CC> createChild(
      SetRelationDefinition<C, S> r,
      ManagedObjectDefinition<CC, ? extends S> d,
      Collection<DefaultBehaviorException> exceptions)
      Collection<PropertyException> exceptions)
      throws IllegalArgumentException {
    validateRelationDefinition(r);
@@ -776,8 +770,8 @@
   * {@inheritDoc}
   */
  public final <PD> void setPropertyValue(PropertyDefinition<PD> pd, PD value)
      throws IllegalPropertyValueException, PropertyIsReadOnlyException,
      PropertyIsMandatoryException, IllegalArgumentException {
      throws PropertyException, PropertyException,
      PropertyException, IllegalArgumentException {
    if (value == null) {
      setPropertyValues(pd, Collections.<PD> emptySet());
    } else {
@@ -791,15 +785,15 @@
   * {@inheritDoc}
   */
  public final <PD> void setPropertyValues(PropertyDefinition<PD> pd,
      Collection<PD> values) throws IllegalPropertyValueException,
      PropertyIsSingleValuedException, PropertyIsReadOnlyException,
      PropertyIsMandatoryException, IllegalArgumentException {
      Collection<PD> values) throws PropertyException,
      PropertyException, PropertyException,
      PropertyException, IllegalArgumentException {
    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);
@@ -970,12 +964,12 @@
  createNewManagedObject(
      ManagedObjectDefinition<M, ?> d, ManagedObjectPath<M, ?> p,
      PropertyDefinition<PD> namingPropertyDefinition, String name,
      Collection<DefaultBehaviorException> exceptions) {
      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);
@@ -998,12 +992,12 @@
  // Create an empty property.
  private <PD> void createProperty(PropertySet properties,
      ManagedObjectPath<?, ?> p, PropertyDefinition<PD> pd)
      throws DefaultBehaviorException {
      throws PropertyException {
    try {
      Driver context = getDriver();
      Collection<PD> defaultValues = context.findDefaultValues(p, pd, true);
      properties.addProperty(pd, defaultValues, Collections.<PD> emptySet());
    } catch (DefaultBehaviorException e) {
    } catch (PropertyException e) {
      // Make sure that we have still created the property.
      properties.addProperty(pd, Collections.<PD> emptySet(), Collections
          .<PD> emptySet());
opendj3-server-dev/src/server/org/opends/server/admin/client/spi/Driver.java
@@ -28,6 +28,8 @@
import static org.opends.server.admin.PropertyException.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -42,18 +44,15 @@
import org.opends.server.admin.Configuration;
import org.opends.server.admin.ConfigurationClient;
import org.opends.server.admin.Constraint;
import org.opends.server.admin.DefaultBehaviorException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.DefaultBehaviorProviderVisitor;
import org.opends.server.admin.DefinedDefaultBehaviorProvider;
import org.opends.server.admin.DefinitionDecodingException;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.InstantiableRelationDefinition;
import org.opends.server.admin.ManagedObjectNotFoundException;
import org.opends.server.admin.ManagedObjectPath;
import org.opends.server.admin.OptionalRelationDefinition;
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.PropertyIsSingleValuedException;
import org.opends.server.admin.PropertyNotFoundException;
import org.opends.server.admin.PropertyOption;
import org.opends.server.admin.RelationDefinition;
@@ -91,7 +90,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;
@@ -123,7 +122,7 @@
      try {
        return getInheritedProperty(d.getManagedObjectPath(), d
            .getManagedObjectDefinition(), d.getPropertyName());
      } catch (DefaultBehaviorException e) {
      } catch (PropertyException e) {
        exception = e;
        return Collections.emptySet();
      }
@@ -151,8 +150,8 @@
      for (String stringValue : stringValues) {
        try {
          values.add(nextProperty.decodeValue(stringValue));
        } catch (IllegalPropertyValueStringException e) {
          exception = new DefaultBehaviorException(nextProperty, e);
        } catch (PropertyException e) {
          exception = defaultBehaviorException(nextProperty, e);
          break;
        }
      }
@@ -170,7 +169,7 @@
      try {
        return getInheritedProperty(d.getManagedObjectPath(nextPath), d
            .getManagedObjectDefinition(), d.getPropertyName());
      } catch (DefaultBehaviorException e) {
      } catch (PropertyException e) {
        exception = e;
        return Collections.emptySet();
      }
@@ -190,7 +189,7 @@
    // Find the default values for the next path/property.
    private Collection<T> find(ManagedObjectPath<?, ?> p,
        PropertyDefinition<T> pd) throws DefaultBehaviorException {
        PropertyDefinition<T> pd) throws PropertyException {
      this.nextPath = p;
      this.nextProperty = pd;
@@ -202,8 +201,8 @@
      }
      if (values.size() > 1 && !pd.hasOption(PropertyOption.MULTI_VALUED)) {
        throw new DefaultBehaviorException(pd,
            new PropertyIsSingleValuedException(pd));
        throw PropertyException.defaultBehaviorException(pd,
            PropertyException.propertyIsSingleValuedException(pd));
      }
      return values;
@@ -215,13 +214,13 @@
    @SuppressWarnings("unchecked")
    private Collection<T> getInheritedProperty(ManagedObjectPath target,
        AbstractManagedObjectDefinition<?, ?> d, String propertyName)
        throws DefaultBehaviorException {
        throws PropertyException {
      // First check that the requested type of managed object
      // corresponds to the path.
      AbstractManagedObjectDefinition<?, ?> supr = target
          .getManagedObjectDefinition();
      if (!supr.isParentOf(d)) {
        throw new DefaultBehaviorException(
        throw PropertyException.defaultBehaviorException(
            nextProperty, new DefinitionDecodingException(supr,
                Reason.WRONG_TYPE_INFORMATION));
      }
@@ -263,21 +262,19 @@
          // inherits its defaults from the newly created managed 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 (AuthorizationException e) {
        throw new DefaultBehaviorException(pd1, e);
      } catch (ManagedObjectNotFoundException e) {
        throw new DefaultBehaviorException(pd1, e);
      } catch (CommunicationException 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 (AuthorizationException e) {
        throw PropertyException.defaultBehaviorException(pd1, e);
      } catch (ManagedObjectNotFoundException e) {
        throw PropertyException.defaultBehaviorException(pd1, e);
      } catch (CommunicationException e) {
        throw PropertyException.defaultBehaviorException(pd1, e);
      }
    }
  };
@@ -712,13 +709,13 @@
   *          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.
   */
  protected final <PD> Collection<PD> findDefaultValues(
      ManagedObjectPath<?, ?> p, PropertyDefinition<PD> pd, boolean isCreate)
      throws DefaultBehaviorException {
      throws PropertyException {
    DefaultValueFinder<PD> v = new DefaultValueFinder<PD>(p, isCreate);
    return v.find(p, pd);
  }
opendj3-server-dev/src/server/org/opends/server/admin/client/spi/PropertySet.java
@@ -35,10 +35,8 @@
import java.util.SortedSet;
import java.util.TreeSet;
import org.opends.server.admin.IllegalPropertyValueException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyIsMandatoryException;
import org.opends.server.admin.PropertyIsSingleValuedException;
import org.opends.server.admin.PropertyOption;
@@ -297,14 +295,13 @@
  /**
   * Makes all pending values active.
   */
  void commit() {
    for (MyProperty<?> p : properties.values()) {
  void commit()
  {
    for (MyProperty<?> p : properties.values())
    {
      p.commit();
    }
  }
@@ -314,44 +311,39 @@
  /**
   * Set a new pending values for the specified property.
   * <p>
   * See the class description for more information regarding pending
   * values.
   * See the class description for more information regarding pending values.
   *
   * @param <T>
   *          The type of the property to be modified.
   * @param d
   *          The property to be modified.
   * @param values
   *          A non-<code>null</code> set of new pending values for
   *          the property (an empty set indicates that the property
   *          should be reset to its default behavior). The set will
   *          not be referenced by this managed object.
   * @throws IllegalPropertyValueException
   *           If a new pending value is deemed to be invalid
   *           according to the property definition.
   * @throws PropertyIsSingleValuedException
   *           If an attempt was made to add multiple pending values
   *           to a single-valued property.
   * @throws PropertyIsMandatoryException
   *           If an attempt was made to remove a mandatory property.
   *          A non-<code>null</code> set of new pending values for the property
   *          (an empty set indicates that the property should be reset to its
   *          default behavior). The set will not be referenced by this managed
   *          object.
   * @throws PropertyException
   *           If a new pending value is deemed to be invalid according to the
   *           property definition, or if an attempt was made to add multiple
   *           pending values to a single-valued property, or if an attempt was
   *           made to remove a mandatory property.
   * @throws IllegalArgumentException
   *           If the specified property definition is not associated
   *           with this managed object.
   *           If the specified property definition is not associated with this
   *           managed object.
   */
  <T> void setPropertyValues(PropertyDefinition<T> d,
      Collection<T> values) throws IllegalPropertyValueException,
      PropertyIsSingleValuedException, PropertyIsMandatoryException,
      IllegalArgumentException {
  <T> void setPropertyValues(PropertyDefinition<T> d, Collection<T> values)
      throws PropertyException, IllegalArgumentException
  {
    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);
      }
    }
opendj3-server-dev/src/server/org/opends/server/admin/condition/ContainsCondition.java
@@ -31,7 +31,7 @@
import java.util.SortedSet;
import org.opends.server.admin.AbstractManagedObjectDefinition;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.client.AuthorizationException;
import org.opends.server.admin.client.CommunicationException;
@@ -67,7 +67,7 @@
    // Private constructor.
    private Impl(PropertyDefinition<T> pd, T value)
        throws IllegalPropertyValueStringException {
        throws PropertyException {
      this.pd = pd;
      this.value = value;
    }
@@ -189,7 +189,7 @@
  // Creates the new private implementation.
  private <T> void buildImpl(PropertyDefinition<T> pd)
      throws IllegalPropertyValueStringException {
      throws PropertyException {
    T value = pd.decodeValue(propertyStringValue);
    this.impl = new Impl<T>(pd, value);
  }
opendj3-server-dev/src/server/org/opends/server/admin/server/ServerManagementContext.java
@@ -30,6 +30,7 @@
import static org.opends.messages.AdminMessages.*;
import static org.opends.server.admin.PropertyException.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import static org.opends.server.util.StaticUtils.*;
@@ -51,22 +52,17 @@
import org.opends.server.admin.AliasDefaultBehaviorProvider;
import org.opends.server.admin.Configuration;
import org.opends.server.admin.ConfigurationClient;
import org.opends.server.admin.DefaultBehaviorException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.DefaultBehaviorProviderVisitor;
import org.opends.server.admin.DefinedDefaultBehaviorProvider;
import org.opends.server.admin.DefinitionDecodingException;
import org.opends.server.admin.DefinitionResolver;
import org.opends.server.admin.IllegalPropertyValueException;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.InstantiableRelationDefinition;
import org.opends.server.admin.LDAPProfile;
import org.opends.server.admin.ManagedObjectDefinition;
import org.opends.server.admin.ManagedObjectPath;
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyDefinitionVisitor;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.PropertyIsMandatoryException;
import org.opends.server.admin.PropertyIsSingleValuedException;
import org.opends.server.admin.PropertyNotFoundException;
import org.opends.server.admin.PropertyOption;
import org.opends.server.admin.Reference;
@@ -74,7 +70,6 @@
import org.opends.server.admin.RelativeInheritedDefaultBehaviorProvider;
import org.opends.server.admin.SetRelationDefinition;
import org.opends.server.admin.UndefinedDefaultBehaviorProvider;
import org.opends.server.admin.UnknownPropertyDefinitionException;
import org.opends.server.admin.DefinitionDecodingException.Reason;
import org.opends.server.admin.std.meta.RootCfgDefn;
import org.opends.server.admin.std.server.RootCfg;
@@ -108,7 +103,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.
@@ -137,7 +132,7 @@
      try {
        return getInheritedProperty(d.getManagedObjectPath(), d
            .getManagedObjectDefinition(), d.getPropertyName());
      } catch (DefaultBehaviorException e) {
      } catch (PropertyException e) {
        exception = e;
        return Collections.emptySet();
      }
@@ -165,8 +160,8 @@
      for (String stringValue : stringValues) {
        try {
          values.add(nextProperty.decodeValue(stringValue));
        } catch (IllegalPropertyValueStringException e) {
          exception = new DefaultBehaviorException(nextProperty, e);
        } catch (PropertyException e) {
          exception = defaultBehaviorException(nextProperty, e);
          break;
        }
      }
@@ -184,7 +179,7 @@
      try {
        return getInheritedProperty(d.getManagedObjectPath(nextPath), d
            .getManagedObjectDefinition(), d.getPropertyName());
      } catch (DefaultBehaviorException e) {
      } catch (PropertyException e) {
        exception = e;
        return Collections.emptySet();
      }
@@ -204,7 +199,7 @@
    // Find the default values for the next path/property.
    private Collection<T> find(ManagedObjectPath<?, ?> p,
        PropertyDefinition<T> pd) throws DefaultBehaviorException {
        PropertyDefinition<T> pd) throws PropertyException {
      nextPath = p;
      nextProperty = pd;
@@ -216,8 +211,8 @@
      }
      if (values.size() > 1 && !pd.hasOption(PropertyOption.MULTI_VALUED)) {
        throw new DefaultBehaviorException(pd,
            new PropertyIsSingleValuedException(pd));
        throw PropertyException.defaultBehaviorException(pd,
            PropertyException.propertyIsSingleValuedException(pd));
      }
      return values;
@@ -229,13 +224,13 @@
    @SuppressWarnings("unchecked")
    private Collection<T> getInheritedProperty(ManagedObjectPath target,
        AbstractManagedObjectDefinition<?, ?> d, String propertyName)
        throws DefaultBehaviorException {
        throws PropertyException {
      // First check that the requested type of managed object
      // corresponds to the path.
      AbstractManagedObjectDefinition<?, ?> supr = target
          .getManagedObjectDefinition();
      if (!supr.isParentOf(d)) {
        throw new DefaultBehaviorException(
        throw PropertyException.defaultBehaviorException(
            nextProperty, new DefinitionDecodingException(supr,
                Reason.WRONG_TYPE_INFORMATION));
      }
@@ -286,15 +281,13 @@
          return pvalues;
        }
      } catch (DefinitionDecodingException e) {
        throw new DefaultBehaviorException(pd1, e);
        throw PropertyException.defaultBehaviorException(pd1, e);
      } catch (PropertyNotFoundException e) {
        throw new DefaultBehaviorException(pd1, e);
      } catch (IllegalPropertyValueException e) {
        throw new DefaultBehaviorException(pd1, e);
      } catch (IllegalPropertyValueStringException e) {
        throw new DefaultBehaviorException(pd1, e);
        throw PropertyException.defaultBehaviorException(pd1, e);
      } catch (PropertyException e) {
        throw PropertyException.defaultBehaviorException(pd1, e);
      } catch (ConfigException e) {
        throw new DefaultBehaviorException(pd1, e);
        throw PropertyException.defaultBehaviorException(pd1, e);
      }
    }
  }
@@ -346,12 +339,12 @@
     * @param value
     *          The LDAP string representation.
     * @return Returns the decoded LDAP value.
     * @throws IllegalPropertyValueStringException
     * @throws PropertyException
     *           If the property value could not be decoded because it
     *           was invalid.
     */
    public static <PD> PD decode(PropertyDefinition<PD> pd,
        AttributeValue value) throws IllegalPropertyValueStringException {
        AttributeValue value) throws PropertyException {
      String s = value.getValue().toString();
      return pd.castValue(pd.accept(new ValueDecoder(), s));
    }
@@ -378,7 +371,7 @@
            .getRelationDefinition(), p);
        return reference.getName();
      } catch (IllegalArgumentException e) {
        throw new IllegalPropertyValueStringException(d, p);
        throw PropertyException.illegalPropertyValueException(d, p);
      }
    }
@@ -389,7 +382,7 @@
     */
    @Override
    public <T> Object visitUnknown(PropertyDefinition<T> d, String p)
        throws UnknownPropertyDefinitionException {
        throws PropertyException {
      // By default the property definition's decoder will do.
      return d.decodeValue(p);
    }
@@ -867,7 +860,7 @@
      for (AttributeValue value : values) {
        try {
          pvalues.add(ValueDecoder.decode(pd, value));
        } catch (IllegalPropertyValueStringException e) {
        } catch (PropertyException e) {
          exception = e;
        }
      }
@@ -875,14 +868,14 @@
      // No values defined so get the defaults.
      try {
        pvalues.addAll(getDefaultValues(path, pd, newConfigEntry));
      } catch (DefaultBehaviorException e) {
      } catch (PropertyException e) {
        exception = e;
      }
    }
    if (pvalues.size() > 1 && !pd.hasOption(PropertyOption.MULTI_VALUED)) {
      // This exception takes precedence over previous exceptions.
      exception = new PropertyIsSingleValuedException(pd);
      exception = PropertyException.propertyIsSingleValuedException(pd);
      T value = pvalues.first();
      pvalues.clear();
      pvalues.add(value);
@@ -891,7 +884,7 @@
    if (pvalues.isEmpty() && pd.hasOption(PropertyOption.MANDATORY)) {
      // The values maybe empty because of a previous exception.
      if (exception == null) {
        exception = new PropertyIsMandatoryException(pd);
        exception = PropertyException.propertyIsMandatoryException(pd);
      }
    }
@@ -936,7 +929,7 @@
  // Get the default values for the specified property.
  private <T> Collection<T> getDefaultValues(ManagedObjectPath<?, ?> p,
      PropertyDefinition<T> pd, ConfigEntry newConfigEntry)
      throws DefaultBehaviorException {
      throws PropertyException {
    DefaultValueFinder<T> v = new DefaultValueFinder<T>(newConfigEntry);
    return v.find(p, pd);
  }
opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/ArgumentExceptionFactory.java
@@ -31,16 +31,10 @@
import org.opends.messages.Message;
import org.opends.server.admin.AbstractManagedObjectDefinition;
import org.opends.server.admin.DefaultBehaviorException;
import org.opends.server.admin.IllegalPropertyValueException;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.ManagedObjectDefinition;
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyDefinitionUsageBuilder;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.PropertyIsMandatoryException;
import org.opends.server.admin.PropertyIsReadOnlyException;
import org.opends.server.admin.PropertyIsSingleValuedException;
import org.opends.server.admin.RelationDefinition;
import org.opends.server.admin.client.IllegalManagedObjectNameException;
import org.opends.server.admin.client.ManagedObjectDecodingException;
@@ -88,7 +82,7 @@
    } else if (pd != null) {
      try {
        pd.decodeValue(illegalName);
      } catch (IllegalPropertyValueStringException e1) {
      } catch (PropertyException e1) {
        PropertyDefinitionUsageBuilder b = new PropertyDefinitionUsageBuilder(
            true);
        Message syntax = b.getUsage(pd);
@@ -117,31 +111,7 @@
   */
  public static ArgumentException adaptPropertyException(PropertyException e,
      AbstractManagedObjectDefinition<?, ?> d) {
    if (e instanceof IllegalPropertyValueException) {
      IllegalPropertyValueException pe = (IllegalPropertyValueException) e;
      return adapt(d, pe);
    } else if (e instanceof IllegalPropertyValueStringException) {
      IllegalPropertyValueStringException pe =
        (IllegalPropertyValueStringException) e;
      return adapt(d, pe);
    } else if (e instanceof PropertyIsMandatoryException) {
      PropertyIsMandatoryException pe = (PropertyIsMandatoryException) e;
      return adapt(d, pe);
    } else if (e instanceof PropertyIsSingleValuedException) {
      PropertyIsSingleValuedException pe = (PropertyIsSingleValuedException) e;
      return adapt(d, pe);
    } else if (e instanceof PropertyIsReadOnlyException) {
      PropertyIsReadOnlyException pe = (PropertyIsReadOnlyException) e;
      return adapt(d, pe);
    } else if (e instanceof DefaultBehaviorException) {
      DefaultBehaviorException pe = (DefaultBehaviorException) e;
      return adapt(d, pe);
    } else {
      Message message = ERR_DSCFG_ERROR_PROPERTY_UNKNOWN_ERROR.
          get(d.getUserFriendlyName(), e.getPropertyDefinition().getName(),
              e.getMessage());
      return new ArgumentException(message);
    }
    return new ArgumentException(e.getMessageObject());
  }
@@ -220,7 +190,7 @@
    builder.appendHeading(INFO_DSCFG_HEADING_PROPERTY_SYNTAX.get());
    PropertyDefinitionUsageBuilder b = new PropertyDefinitionUsageBuilder(true);
    for (PropertyIsMandatoryException pe : e.getCauses()) {
    for (PropertyException pe : e.getCauses()) {
      PropertyDefinition<?> pd = pe.getPropertyDefinition();
      builder.startRow();
      builder.appendCell(pd.getName());
@@ -680,143 +650,6 @@
  /**
   * Creates an argument exception from a default behavior exception.
   *
   * @param d
   *          The managed object definition.
   * @param e
   *          The default behavior exception.
   * @return Returns an argument exception.
   */
  private static ArgumentException adapt(
      AbstractManagedObjectDefinition<?, ?> d, DefaultBehaviorException e) {
    Message message = ERR_DSCFG_ERROR_PROPERTY_DEFAULT_BEHAVIOR.
        get(d.getUserFriendlyName(), e.getPropertyDefinition().getName(),
            e.getMessage());
    return new ArgumentException(message);
  }
  /**
   * Creates an argument exception from an illegal property value
   * exception.
   *
   * @param d
   *          The managed object definition.
   * @param e
   *          The illegal property value exception.
   * @return Returns an argument exception.
   */
  private static ArgumentException adapt(
      AbstractManagedObjectDefinition<?, ?> d,
      IllegalPropertyValueException e) {
    PropertyDefinitionUsageBuilder b = new PropertyDefinitionUsageBuilder(true);
    Message syntax = b.getUsage(e.getPropertyDefinition());
    if (syntax.length() > 20) {
      // syntax =
      // INFO_DSCFG_DESCRIPTION_PROPERTY_SYNTAX_HELP.get();
    }
    Message message = ERR_DSCFG_ERROR_PROPERTY_INVALID_VALUE.
        get(String.valueOf(e.getIllegalValue()), d.getUserFriendlyName(),
            e.getPropertyDefinition().getName(), syntax);
    return new ArgumentException(message);
  }
  /**
   * Creates an argument exception from an illegal property string
   * value exception.
   *
   * @param d
   *          The managed object definition.
   * @param e
   *          The illegal property string value exception.
   * @return Returns an argument exception.
   */
  private static ArgumentException adapt(
      AbstractManagedObjectDefinition<?, ?> d,
      IllegalPropertyValueStringException e) {
    PropertyDefinitionUsageBuilder b = new PropertyDefinitionUsageBuilder(true);
    Message syntax = b.getUsage(e.getPropertyDefinition());
    if (syntax.length() > 20) {
      // syntax =
      // INFO_DSCFG_DESCRIPTION_PROPERTY_SYNTAX_HELP.get();
    }
    Message message = ERR_DSCFG_ERROR_PROPERTY_INVALID_VALUE.
        get(String.valueOf(e.getIllegalValueString()), d.getUserFriendlyName(),
            e.getPropertyDefinition().getName(), syntax);
    return new ArgumentException(message);
  }
  /**
   * Creates an argument exception from a property is mandatory
   * exception.
   *
   * @param d
   *          The managed object definition.
   * @param e
   *          The property is mandatory exception.
   * @return Returns an argument exception.
   */
  private static ArgumentException adapt(
      AbstractManagedObjectDefinition<?, ?> d,
      PropertyIsMandatoryException e) {
    Message message = ERR_DSCFG_ERROR_PROPERTY_MANDATORY.get(
        d.getUserFriendlyName(), e.getPropertyDefinition().getName());
    return new ArgumentException(message);
  }
  /**
   * Creates an argument exception from a property is read-only
   * exception.
   *
   * @param d
   *          The managed object definition.
   * @param e
   *          The property is read-only exception.
   * @return Returns an argument exception.
   */
  private static ArgumentException adapt(
      AbstractManagedObjectDefinition<?, ?> d,
      PropertyIsReadOnlyException e) {
    Message message = ERR_DSCFG_ERROR_PROPERTY_READ_ONLY.get(
        d.getUserFriendlyName(), e.getPropertyDefinition().getName());
    return new ArgumentException(message);
  }
  /**
   * Creates an argument exception from a property is single-valued
   * exception.
   *
   * @param d
   *          The managed object definition.
   * @param e
   *          The property is single-valued exception.
   * @return Returns an argument exception.
   */
  private static ArgumentException adapt(
      AbstractManagedObjectDefinition<?, ?> d,
      PropertyIsSingleValuedException e) {
    Message message = ERR_DSCFG_ERROR_PROPERTY_SINGLE_VALUED.get(
        d.getUserFriendlyName(), e.getPropertyDefinition().getName());
    return new ArgumentException(message);
  }
  // Prevent instantiation.
  private ArgumentExceptionFactory() {
    // No implementation required.
opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/CreateSubCommandHandler.java
@@ -30,6 +30,7 @@
import static org.opends.messages.DSConfigMessages.*;
import static org.opends.messages.ToolMessages.*;
import static org.opends.server.admin.PropertyException.*;
import static org.opends.server.tools.dsconfig.ArgumentExceptionFactory.*;
import java.util.Collection;
@@ -50,9 +51,8 @@
import org.opends.server.admin.AggregationPropertyDefinition;
import org.opends.server.admin.Configuration;
import org.opends.server.admin.ConfigurationClient;
import org.opends.server.admin.DefaultBehaviorException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.DefinitionDecodingException;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.InstantiableRelationDefinition;
import org.opends.server.admin.ManagedObjectAlreadyExistsException;
import org.opends.server.admin.ManagedObjectDefinition;
@@ -62,8 +62,6 @@
import org.opends.server.admin.OptionalRelationDefinition;
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyDefinitionUsageBuilder;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.PropertyIsSingleValuedException;
import org.opends.server.admin.PropertyOption;
import org.opends.server.admin.PropertyProvider;
import org.opends.server.admin.RelationDefinition;
@@ -214,7 +212,7 @@
      T value;
      try {
        value = pd.decodeValue(s);
      } catch (IllegalPropertyValueStringException e) {
      } catch (PropertyException e) {
        throw ArgumentExceptionFactory.adaptPropertyException(e, d);
      }
@@ -225,7 +223,7 @@
      values.add(value);
      if (values.size() > 1 && !pd.hasOption(PropertyOption.MULTI_VALUED)) {
        PropertyException e = new PropertyIsSingleValuedException(pd);
        PropertyException e = propertyIsSingleValuedException(pd);
        throw ArgumentExceptionFactory.adaptPropertyException(e, d);
      }
@@ -541,8 +539,8 @@
    // Now create the component.
    // FIXME: handle default value exceptions?
    List<DefaultBehaviorException> exceptions =
      new LinkedList<DefaultBehaviorException>();
    List<PropertyException> exceptions =
      new LinkedList<PropertyException>();
    app.println();
    app.println();
    ManagedObject<? extends C> mo =
@@ -848,7 +846,7 @@
      ConsoleApplication app, final ManagedObject<?> parent,
      final InstantiableRelationDefinition<C, S> irelation,
      final ManagedObjectDefinition<? extends C, ? extends S> d,
      final List<DefaultBehaviorException> exceptions) throws CLIException {
      final List<PropertyException> exceptions) throws CLIException {
    ValidationCallback<ManagedObject<? extends C>> validator =
      new ValidationCallback<ManagedObject<? extends C>>() {
@@ -1293,8 +1291,8 @@
        namingPropertyDefinition, propertyArgs);
    ManagedObject<? extends C> child;
    List<DefaultBehaviorException> exceptions =
      new LinkedList<DefaultBehaviorException>();
    List<PropertyException> exceptions =
      new LinkedList<PropertyException>();
    boolean isNameProvidedInteractively = false;
    String providedNamingArgName = null;
    if (relation instanceof InstantiableRelationDefinition) {
opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/HelpSubCommandHandler.java
@@ -63,7 +63,7 @@
import org.opends.server.admin.StringPropertyDefinition;
import org.opends.server.admin.Tag;
import org.opends.server.admin.UndefinedDefaultBehaviorProvider;
import org.opends.server.admin.UnknownPropertyDefinitionException;
import org.opends.server.admin.PropertyException;
import org.opends.server.tools.ClientException;
import org.opends.server.util.args.ArgumentException;
import org.opends.server.util.args.BooleanArgument;
@@ -305,7 +305,7 @@
       */
      @Override
      public <T> Void visitUnknown(PropertyDefinition<T> d, PrintStream p)
          throws UnknownPropertyDefinitionException {
          throws PropertyException {
        PropertyDefinitionUsageBuilder usageBuilder =
          new PropertyDefinitionUsageBuilder(true);
        displayUsage(p, usageBuilder.getUsage(d));
opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/PropertyValueEditor.java
@@ -53,8 +53,7 @@
import org.opends.server.admin.DefinedDefaultBehaviorProvider;
import org.opends.server.admin.DefinitionDecodingException;
import org.opends.server.admin.EnumPropertyDefinition;
import org.opends.server.admin.IllegalPropertyValueException;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.InstantiableRelationDefinition;
import org.opends.server.admin.ManagedObjectDefinition;
import org.opends.server.admin.ManagedObjectNotFoundException;
@@ -62,13 +61,9 @@
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyDefinitionUsageBuilder;
import org.opends.server.admin.PropertyDefinitionVisitor;
import org.opends.server.admin.PropertyIsMandatoryException;
import org.opends.server.admin.PropertyIsReadOnlyException;
import org.opends.server.admin.PropertyIsSingleValuedException;
import org.opends.server.admin.PropertyOption;
import org.opends.server.admin.RelativeInheritedDefaultBehaviorProvider;
import org.opends.server.admin.UndefinedDefaultBehaviorProvider;
import org.opends.server.admin.UnknownPropertyDefinitionException;
import org.opends.server.admin.client.AuthorizationException;
import org.opends.server.admin.client.CommunicationException;
import org.opends.server.admin.client.ManagedObject;
@@ -652,7 +647,7 @@
     */
    @Override
    public <T> MenuResult<Void> visitUnknown(PropertyDefinition<T> d,
        Void p) throws UnknownPropertyDefinitionException {
        Void p) throws PropertyException {
      app.println();
      displayPropertySyntax(app, d);
@@ -1951,9 +1946,9 @@
    // Common menu processing.
    private <T> MenuResult<Boolean> runMenu(final PropertyDefinition<T> d,
        MenuBuilder<T> builder) throws IllegalPropertyValueException,
        PropertyIsSingleValuedException, PropertyIsReadOnlyException,
        PropertyIsMandatoryException, IllegalArgumentException {
        MenuBuilder<T> builder) throws PropertyException,
        PropertyException, PropertyException,
        PropertyException, IllegalArgumentException {
      builder.addHelpOption(new PropertyHelpCallback(mo
          .getManagedObjectDefinition(), d));
      builder.addQuitOption();
@@ -2169,7 +2164,7 @@
          }
          break;
        } catch (IllegalPropertyValueStringException e) {
        } catch (PropertyException e) {
          app.println();
          app.println(ArgumentExceptionFactory.adaptPropertyException(e, d)
              .getMessageObject());
@@ -2197,7 +2192,7 @@
          } else {
            values.add(value);
          }
        } catch (IllegalPropertyValueStringException e) {
        } catch (PropertyException e) {
          app.println();
          app.println(ArgumentExceptionFactory.adaptPropertyException(e, d)
              .getMessageObject());
opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/SetPropSubCommandHandler.java
@@ -41,7 +41,7 @@
import org.opends.messages.Message;
import org.opends.server.admin.AggregationPropertyDefinition;
import org.opends.server.admin.DefinitionDecodingException;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.InstantiableRelationDefinition;
import org.opends.server.admin.ManagedObjectAlreadyExistsException;
import org.opends.server.admin.ManagedObjectDefinition;
@@ -49,7 +49,6 @@
import org.opends.server.admin.ManagedObjectPath;
import org.opends.server.admin.OptionalRelationDefinition;
import org.opends.server.admin.PropertyDefinition;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.PropertyOption;
import org.opends.server.admin.RelationDefinition;
import org.opends.server.admin.SetRelationDefinition;
@@ -934,7 +933,7 @@
      T value;
      try {
        value = pd.decodeValue(s);
      } catch (IllegalPropertyValueStringException e) {
      } catch (PropertyException e) {
        throw ArgumentExceptionFactory.adaptPropertyException(e, mo
            .getManagedObjectDefinition());
      }
opendj3-server-dev/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java
@@ -7576,7 +7576,7 @@
        ReplicationSynchronizationProviderCfgDefn.getInstance();
      sync = root.createSynchronizationProvider(provider,
          "Multimaster Synchronization",
          new ArrayList<DefaultBehaviorException>());
          new ArrayList<PropertyException>());
      sync.setJavaClass(
          org.opends.server.replication.plugin.MultimasterReplication.class.
          getName());
@@ -7610,7 +7610,7 @@
      usedReplicationServerIds.add(id);
      replicationServer = sync.createReplicationServer(
          ReplicationServerCfgDefn.getInstance(),
          new ArrayList<DefaultBehaviorException>());
          new ArrayList<PropertyException>());
      replicationServer.setReplicationServerId(id);
      replicationServer.setReplicationPort(replicationPort);
      replicationServer.setReplicationServer(replicationServers);
@@ -7789,7 +7789,7 @@
          InstallerHelper.getDomainName(domainNames, domainId, baseDN);
      domain = sync.createReplicationDomain(
          ReplicationDomainCfgDefn.getInstance(), domainName,
          new ArrayList<DefaultBehaviorException>());
          new ArrayList<PropertyException>());
      domain.setServerId(domainId);
      domain.setBaseDN(DN.valueOf(baseDN));
      domain.setReplicationServer(replicationServers);
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/AttributeTypePropertyDefinitionTest.java
@@ -130,7 +130,7 @@
   * @param value
   *          to decode
   */
  @Test(dataProvider = "testDecodeValueIllegalData", expectedExceptions = { IllegalPropertyValueStringException.class })
  @Test(dataProvider = "testDecodeValueIllegalData", expectedExceptions = { PropertyException.class })
  public void testDecodeValue2(String value) {
    AttributeTypePropertyDefinition.setCheckSchema(true);
    AttributeTypePropertyDefinition d = createPropertyDefinition();
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/BooleanPropertyDefinitionTest.java
@@ -114,7 +114,7 @@
   * @param value to decode
   */
  @Test(dataProvider = "testDecodeValueData2",
          expectedExceptions = {NullPointerException.class,IllegalPropertyValueStringException.class})
          expectedExceptions = {NullPointerException.class,PropertyException.class})
  public void testDecodeValue2(String value) {
    BooleanPropertyDefinition d = createPropertyDefinition();
    d.decodeValue(value);
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/ClassPropertyDefinitionTest.java
@@ -185,7 +185,7 @@
  }
  @Test(dataProvider = "testLoadClassData2",
          expectedExceptions = {IllegalPropertyValueException.class})
          expectedExceptions = {PropertyException.class})
  public <T> void testLoadClass2(String interfaceName, String loadClassName,
                            Class<T> instanceOfClass, Class expectedClass) {
    ClassPropertyDefinition.Builder localBuilder =
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/DNPropertyDefinitionTest.java
@@ -171,7 +171,7 @@
   * @throws DirectoryException
   *           If the DN could not be decoded.
   */
  @Test(dataProvider = "testIllegalValues", expectedExceptions = IllegalPropertyValueException.class)
  @Test(dataProvider = "testIllegalValues", expectedExceptions = PropertyException.class)
  public void testValidateIllegalValues(String baseDN, String value)
      throws DirectoryException {
    DNPropertyDefinition.Builder localBuilder = DNPropertyDefinition
@@ -210,7 +210,7 @@
   * @param value
   *          The value to be validated.
   */
  @Test(dataProvider = "testIllegalValues", expectedExceptions = IllegalPropertyValueStringException.class)
  @Test(dataProvider = "testIllegalValues", expectedExceptions = PropertyException.class)
  public void testDecodeIllegalValues(String baseDN, String value) {
    DNPropertyDefinition.Builder localBuilder = DNPropertyDefinition
        .createBuilder(RootCfgDefn.getInstance(), "test-property");
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/DurationPropertyDefinitionTest.java
@@ -206,7 +206,7 @@
  /**
   * Tests the allowUnlimited property
   */
  @Test(expectedExceptions = IllegalPropertyValueStringException.class)
  @Test(expectedExceptions = PropertyException.class)
  public void testIsAllowUnlimited2() {
    DurationPropertyDefinition.Builder builder = createTestBuilder();
    builder.setAllowUnlimited(false);
@@ -217,7 +217,7 @@
  /**
   * Tests the allowUnlimited property
   */
  @Test(expectedExceptions = IllegalPropertyValueException.class)
  @Test(expectedExceptions = PropertyException.class)
  public void testIsAllowUnlimited3() {
    DurationPropertyDefinition.Builder builder = createTestBuilder();
    builder.setAllowUnlimited(false);
@@ -279,7 +279,7 @@
   * @param value to validate
   */
  @Test(dataProvider = "illegalValidateValueData",
          expectedExceptions = {AssertionError.class,NullPointerException.class,IllegalPropertyValueException.class})
          expectedExceptions = {AssertionError.class,NullPointerException.class,PropertyException.class})
  public void testValidateValue2(Long low, Long high, boolean allowUnlimited, Long value) {
    DurationPropertyDefinition.Builder builder = createTestBuilder();
    builder.setLowerLimit(low);
@@ -340,7 +340,7 @@
      }
      public Boolean visitUnknown(PropertyDefinition d, Void o)
          throws UnknownPropertyDefinitionException {
          throws PropertyException {
        return false;
      }
@@ -484,7 +484,7 @@
   * @param value to decode
   */
  @Test(dataProvider = "decodeValueData2",
          expectedExceptions = {IllegalPropertyValueStringException.class})
          expectedExceptions = {PropertyException.class})
  public void testDecodeValue(String value) {
    DurationPropertyDefinition.Builder builder = createTestBuilder();
    builder.setAllowUnlimited(false);
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/EnumPropertyDefinitionTest.java
@@ -118,7 +118,7 @@
   */
  @Test(dataProvider = "decodeValueData2",
          expectedExceptions = {NullPointerException.class,
                  IllegalPropertyValueStringException.class} )
                  PropertyException.class} )
  public void testDecodeValue2(String value) {
    EnumPropertyDefinition epd = builder.getInstance();
    epd.decodeValue(value);
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/IntegerPropertyDefinitionTest.java
@@ -154,7 +154,7 @@
  /**
   * Tests the allowUnlimited property
   */
  @Test(expectedExceptions = IllegalPropertyValueStringException.class)
  @Test(expectedExceptions = PropertyException.class)
  public void testIsAllowUnlimited2() {
    IntegerPropertyDefinition.Builder builder = createTestBuilder();
    builder.setAllowUnlimited(false);
@@ -165,7 +165,7 @@
  /**
   * Tests the allowUnlimited property
   */
  @Test(expectedExceptions = IllegalPropertyValueException.class)
  @Test(expectedExceptions = PropertyException.class)
  public void testIsAllowUnlimited3() {
    IntegerPropertyDefinition.Builder builder = createTestBuilder();
    builder.setAllowUnlimited(false);
@@ -227,7 +227,7 @@
   * @param allowUnlimited when true allows unlimited
   */
  @Test(dataProvider = "illegalValidateValueData",
          expectedExceptions = {AssertionError.class,NullPointerException.class,IllegalPropertyValueException.class})
          expectedExceptions = {AssertionError.class,NullPointerException.class,PropertyException.class})
  public void testValidateValue2(Integer low, Integer high, boolean allowUnlimited, Integer value) {
    IntegerPropertyDefinition.Builder builder = createTestBuilder();
    builder.setLowerLimit(low);
@@ -278,7 +278,7 @@
      }
      public Boolean visitUnknown(PropertyDefinition d, Void o)
          throws UnknownPropertyDefinitionException {
          throws PropertyException {
        return false;
      }
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/SizePropertyDefinitionTest.java
@@ -169,7 +169,7 @@
  /**
   * Tests the allowUnlimited property
   */
  @Test(expectedExceptions = IllegalPropertyValueStringException.class)
  @Test(expectedExceptions = PropertyException.class)
  public void testIsAllowUnlimited2() {
    SizePropertyDefinition.Builder builder = createTestBuilder();
    builder.setAllowUnlimited(false);
@@ -180,7 +180,7 @@
  /**
   * Tests the allowUnlimited property
   */
  @Test(expectedExceptions = IllegalPropertyValueException.class)
  @Test(expectedExceptions = PropertyException.class)
  public void testIsAllowUnlimited3() {
    SizePropertyDefinition.Builder builder = createTestBuilder();
    builder.setAllowUnlimited(false);
@@ -242,7 +242,7 @@
   * @param allowUnlimited when true allows unlimited
   */
  @Test(dataProvider = "illegalValidateValueData",
          expectedExceptions = {AssertionError.class,NullPointerException.class,IllegalPropertyValueException.class})
          expectedExceptions = {AssertionError.class,NullPointerException.class,PropertyException.class})
  public void testValidateValue2(Long low, Long high, boolean allowUnlimited, Long value) {
    SizePropertyDefinition.Builder builder = createTestBuilder();
    builder.setLowerLimit(low);
@@ -306,7 +306,7 @@
      }
      public Boolean visitUnknown(PropertyDefinition d, Void o)
          throws UnknownPropertyDefinitionException {
          throws PropertyException {
        return false;
      }
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/StringPropertyDefinitionTest.java
@@ -66,7 +66,7 @@
  /**
   * Tests validateValue() with invalid data and a pattern.
   */
  @Test(expectedExceptions = IllegalPropertyValueException.class)
  @Test(expectedExceptions = PropertyException.class)
  public void testValidateValue3() {
    StringPropertyDefinition d = getDefinition(true, "^[a-z]+$");
    d.validateValue("abc123");
@@ -88,7 +88,7 @@
  /**
   * Tests decodeValue() with invalid data and a pattern.
   */
  @Test(expectedExceptions = IllegalPropertyValueStringException.class)
  @Test(expectedExceptions = PropertyException.class)
  public void testDecodeValue2() {
    StringPropertyDefinition d = getDefinition(true, "^[a-z]+$");
    d.decodeValue("abc123");
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/TestChildCfgClient.java
@@ -30,9 +30,8 @@
import java.util.Collection;
import java.util.SortedSet;
import org.opends.server.admin.ConfigurationClient;
import org.opends.server.admin.IllegalPropertyValueException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.ManagedObjectDefinition;
import org.opends.server.admin.PropertyIsReadOnlyException;
import org.opends.server.admin.TestChildCfg;
import org.opends.server.types.AttributeType;
import org.opends.server.types.DN;
@@ -75,10 +74,10 @@
   * An aggregation property which references connection handlers.
   *
   * @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;
@@ -99,10 +98,10 @@
   * A mandatory boolean property.
   *
   * @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;
@@ -123,10 +122,10 @@
   * A mandatory Java-class property requiring a component restart.
   *
   * @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;
@@ -150,12 +149,12 @@
   * creation of a Test Child.
   *
   * @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;
@@ -178,10 +177,10 @@
   * from optional-multi-valued-dn-property in the parent.
   *
   * @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;
@@ -204,9 +203,9 @@
   * from optional-multi-valued-dn-property1.
   *
   * @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;
}
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/TestChildCfgDefn.java
@@ -38,7 +38,7 @@
import org.opends.server.admin.DefinedDefaultBehaviorProvider;
import org.opends.server.admin.ManagedObjectAlreadyExistsException;
import org.opends.server.admin.ManagedObjectDefinition;
import org.opends.server.admin.PropertyIsReadOnlyException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.PropertyOption;
import org.opends.server.admin.PropertyProvider;
import org.opends.server.admin.RelativeInheritedDefaultBehaviorProvider;
@@ -400,7 +400,7 @@
    /**
     * {@inheritDoc}
     */
    public void setMandatoryReadOnlyAttributeTypeProperty(AttributeType value) throws PropertyIsReadOnlyException {
    public void setMandatoryReadOnlyAttributeTypeProperty(AttributeType value) throws PropertyException {
      impl.setPropertyValue(INSTANCE.getMandatoryReadOnlyAttributeTypePropertyPropertyDefinition(), value);
    }
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/TestParentCfgClient.java
@@ -36,12 +36,10 @@
import org.opends.server.admin.client.ManagedObjectDecodingException;
import org.opends.server.admin.client.OperationRejectedException;
import org.opends.server.admin.ConfigurationClient;
import org.opends.server.admin.DefaultBehaviorException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.DefinitionDecodingException;
import org.opends.server.admin.IllegalPropertyValueException;
import org.opends.server.admin.ManagedObjectDefinition;
import org.opends.server.admin.ManagedObjectNotFoundException;
import org.opends.server.admin.PropertyIsReadOnlyException;
import org.opends.server.types.AttributeType;
import org.opends.server.types.DN;
@@ -82,10 +80,10 @@
   * A mandatory boolean property.
   *
   * @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;
@@ -106,10 +104,10 @@
   * A mandatory Java-class property requiring a component restart.
   *
   * @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;
@@ -133,12 +131,12 @@
   * creation of a Test Parent.
   *
   * @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;
@@ -161,10 +159,10 @@
   * behavior.
   *
   * @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;
@@ -235,7 +233,7 @@
   *          The name of the new Test Child.
   * @param exceptions
   *          An optional collection in which to place any {@link
   *          DefaultBehaviorException}s that occurred whilst
   *          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.
@@ -243,7 +241,7 @@
   *          If the name is invalid.
   */
  <C extends TestChildCfgClient> C createTestChild(
      ManagedObjectDefinition<C, ? extends TestChildCfg> d, String name, Collection<DefaultBehaviorException> exceptions) throws IllegalManagedObjectNameException;
      ManagedObjectDefinition<C, ? extends TestChildCfg> d, String name, Collection<PropertyException> exceptions) throws IllegalManagedObjectNameException;
@@ -336,13 +334,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
   *          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);
      ManagedObjectDefinition<C, ? extends TestChildCfg> d, Collection<PropertyException> exceptions);
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/TestParentCfgDefn.java
@@ -41,7 +41,7 @@
import org.opends.server.admin.client.ManagedObjectDecodingException;
import org.opends.server.admin.client.MissingMandatoryPropertiesException;
import org.opends.server.admin.client.OperationRejectedException;
import org.opends.server.admin.DefaultBehaviorException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.DefaultBehaviorProvider;
import org.opends.server.admin.DefinedDefaultBehaviorProvider;
import org.opends.server.admin.DefinitionDecodingException;
@@ -51,7 +51,6 @@
import org.opends.server.admin.ManagedObjectDefinition;
import org.opends.server.admin.ManagedObjectNotFoundException;
import org.opends.server.admin.OptionalRelationDefinition;
import org.opends.server.admin.PropertyIsReadOnlyException;
import org.opends.server.admin.PropertyOption;
import org.opends.server.admin.PropertyProvider;
import org.opends.server.admin.server.ConfigurationAddListener;
@@ -376,7 +375,7 @@
    /**
     * {@inheritDoc}
     */
    public void setMandatoryReadOnlyAttributeTypeProperty(AttributeType value) throws PropertyIsReadOnlyException {
    public void setMandatoryReadOnlyAttributeTypeProperty(AttributeType value) throws PropertyException {
      impl.setPropertyValue(INSTANCE.getMandatoryReadOnlyAttributeTypePropertyPropertyDefinition(), value);
    }
@@ -426,7 +425,7 @@
     * {@inheritDoc}
     */
    public <M extends TestChildCfgClient> M createTestChild(
        ManagedObjectDefinition<M, ? extends TestChildCfg> d, String name, Collection<DefaultBehaviorException> exceptions) throws IllegalManagedObjectNameException {
        ManagedObjectDefinition<M, ? extends TestChildCfg> d, String name, Collection<PropertyException> exceptions) throws IllegalManagedObjectNameException {
      return impl.createChild(INSTANCE.getTestChildrenRelationDefinition(), d, name, exceptions).getConfiguration();
    }
@@ -469,7 +468,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();
    }
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/client/ldap/AggregationClientTest.java
@@ -36,9 +36,8 @@
import org.opends.server.TestCaseUtils;
import org.opends.server.admin.AdminTestCase;
import org.opends.server.admin.DefinitionDecodingException;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.ManagedObjectNotFoundException;
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.ManagedObjectNotFoundException;
import org.opends.server.admin.TestCfg;
import org.opends.server.admin.TestChildCfgClient;
import org.opends.server.admin.TestChildCfgDefn;
@@ -289,12 +288,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;
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/admin/server/AggregationServerTest.java
@@ -370,12 +370,10 @@
        Assert.assertEquals(causes.size(), 1);
        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;