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

Nicolas Capponi
02.07.2013 19f32e8b95817bcc2ef0a73bbcb4be16e101c989
OpenDJ 3 : config framework

Reducing compilation errors in org.opends.server.admin packages :
all classes in package org.opends.server.admin.client compile

* Simple changes in org.opends.server.admin.client package
** replace Message class by LocalizableMessage
** use Validator class from SDK
** other minor changes
14 files modified
1187 ■■■■■ changed files
opendj-admin/src/main/java/org/opends/server/admin/client/AdminClientException.java 30 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/AdminSecurityException.java 21 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/AuthenticationException.java 29 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/AuthenticationNotSupportedException.java 38 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/AuthorizationException.java 31 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/CommunicationException.java 8 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/ConcurrentModificationException.java 8 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/IllegalManagedObjectNameException.java 6 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/ManagedObjectDecodingException.java 20 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/ManagementContext.java 342 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/MissingMandatoryPropertiesException.java 21 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/OperationRejectedException.java 115 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/package-info.java 4 ●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/spi/Driver.java 514 ●●●●● patch | view | raw | blame | history
opendj-admin/src/main/java/org/opends/server/admin/client/AdminClientException.java
@@ -27,22 +27,17 @@
package org.opends.server.admin.client;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.admin.AdminException;
/**
 * Administration client exceptions represent non-operational problems
 * which occur whilst interacting with the administration framework.
 * They provide clients with a transport independent interface for
 * handling transport related exceptions.
 * Administration client exceptions represent non-operational problems which
 * occur whilst interacting with the administration framework. They provide
 * clients with a transport independent interface for handling transport related
 * exceptions.
 * <p>
 * Client exceptions represent communications problems, security
 * problems, and service related problems.
 * Client exceptions represent communications problems, security problems, and
 * service related problems.
 */
public abstract class AdminClientException extends AdminException {
@@ -51,30 +46,25 @@
   */
  private static final long serialVersionUID = 4044747533980824456L;
  /**
   * Create an administration client exception with a message and
   * cause.
     * Create an administration client exception with a message and cause.
   *
   * @param message
   *          The message.
   * @param cause
   *          The cause.
   */
  protected AdminClientException(Message message, Throwable cause) {
    protected AdminClientException(LocalizableMessage message, Throwable cause) {
    super(message, cause);
  }
  /**
   * Create an administration client exception with a message.
   *
   * @param message
   *          The message.
   */
  protected AdminClientException(Message message) {
    protected AdminClientException(LocalizableMessage message) {
    super(message);
  }
}
opendj-admin/src/main/java/org/opends/server/admin/client/AdminSecurityException.java
@@ -27,17 +27,12 @@
package org.opends.server.admin.client;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
/**
 * This exception is thrown when a security related problem occurs
 * whilst interacting with the Directory Server. These fall broadly
 * into two categories: authentication problems and authorization
 * problems.
 * This exception is thrown when a security related problem occurs whilst
 * interacting with the Directory Server. These fall broadly into two
 * categories: authentication problems and authorization problems.
 */
public abstract class AdminSecurityException extends AdminClientException {
@@ -46,8 +41,6 @@
   */
  private static final long serialVersionUID = 1L;
  /**
   * Create a security exception with a message and cause.
   *
@@ -56,19 +49,17 @@
   * @param cause
   *          The cause.
   */
  protected AdminSecurityException(Message message, Throwable cause) {
    protected AdminSecurityException(LocalizableMessage message, Throwable cause) {
    super(message, cause);
  }
  /**
   * Create a security exception with a message.
   *
   * @param message
   *          The message.
   */
  protected AdminSecurityException(Message message) {
    protected AdminSecurityException(LocalizableMessage message) {
    super(message);
  }
}
opendj-admin/src/main/java/org/opends/server/admin/client/AuthenticationException.java
@@ -27,18 +27,14 @@
package org.opends.server.admin.client;
import org.forgerock.i18n.LocalizableMessage;
import static org.opends.messages.AdminMessages.*;
import org.opends.messages.Message;
import static com.forgerock.opendj.ldap.AdminMessages.*;
/**
 * This exception is thrown when an authentication error occurs while
 * connecting to the Directory Server. An authentication error can
 * happen, for example, when the client credentials are invalid.
 * This exception is thrown when an authentication error occurs while connecting
 * to the Directory Server. An authentication error can happen, for example,
 * when the client credentials are invalid.
 */
public class AuthenticationException extends AdminSecurityException {
@@ -47,8 +43,6 @@
   */
  private static final long serialVersionUID = 3544797197747686958L;
  /**
   * Creates an authentication exception with a default message.
   */
@@ -56,11 +50,8 @@
    super(ERR_AUTHENTICATION_EXCEPTION_DEFAULT.get());
  }
  /**
   * Create an authentication exception with a cause and a default
   * message.
     * Create an authentication exception with a cause and a default message.
   *
   * @param cause
   *          The cause.
@@ -69,8 +60,6 @@
    super(ERR_AUTHENTICATION_EXCEPTION_DEFAULT.get(), cause);
  }
  /**
   * Create an authentication exception with a message and cause.
   *
@@ -79,19 +68,17 @@
   * @param cause
   *          The cause.
   */
  public AuthenticationException(Message message, Throwable cause) {
    public AuthenticationException(LocalizableMessage message, Throwable cause) {
    super(message, cause);
  }
  /**
   * Create an authentication exception with a message.
   *
   * @param message
   *          The message.
   */
  public AuthenticationException(Message message) {
    public AuthenticationException(LocalizableMessage message) {
    super(message);
  }
}
opendj-admin/src/main/java/org/opends/server/admin/client/AuthenticationNotSupportedException.java
@@ -27,41 +27,31 @@
package org.opends.server.admin.client;
import org.forgerock.i18n.LocalizableMessage;
import static org.opends.messages.AdminMessages.*;
import org.opends.messages.Message;
import static com.forgerock.opendj.ldap.AdminMessages.*;
/**
 * This exception is thrown when the particular flavor of
 * authentication requested is not supported by the Directory Server.
 * This exception is thrown when the particular flavor of authentication
 * requested is not supported by the Directory Server.
 */
public class AuthenticationNotSupportedException
    extends AdminSecurityException {
public class AuthenticationNotSupportedException extends AdminSecurityException {
  /**
   * Serialization ID.
   */
  private static final long serialVersionUID = 7387834052676291793L;
  /**
   * Creates an authentication not supported exception with a default
   * message.
     * Creates an authentication not supported exception with a default message.
   */
  public AuthenticationNotSupportedException() {
    super(ERR_AUTHENTICATION_NOT_SUPPORTED_EXCEPTION_DEFAULT.get());
  }
  /**
   * Creates an authentication not supported exception with a cause
   * and a default message.
     * Creates an authentication not supported exception with a cause and a
     * default message.
   *
   * @param cause
   *          The cause.
@@ -70,30 +60,26 @@
    super(ERR_AUTHENTICATION_NOT_SUPPORTED_EXCEPTION_DEFAULT.get(), cause);
  }
  /**
   * Create an authentication not supported exception with a message
   * and cause.
     * Create an authentication not supported exception with a message and
     * cause.
   *
   * @param message
   *          The message.
   * @param cause
   *          The cause.
   */
  public AuthenticationNotSupportedException(Message message, Throwable cause) {
    public AuthenticationNotSupportedException(LocalizableMessage message, Throwable cause) {
    super(message, cause);
  }
  /**
   * Create an authentication not supported exception with a message.
   *
   * @param message
   *          The message.
   */
  public AuthenticationNotSupportedException(Message message) {
    public AuthenticationNotSupportedException(LocalizableMessage message) {
    super(message);
  }
}
opendj-admin/src/main/java/org/opends/server/admin/client/AuthorizationException.java
@@ -27,19 +27,15 @@
package org.opends.server.admin.client;
import org.forgerock.i18n.LocalizableMessage;
import static org.opends.messages.AdminMessages.*;
import org.opends.messages.Message;
import static com.forgerock.opendj.ldap.AdminMessages.*;
/**
 * This exception is thrown when an authorization error occurs while
 * interacting with the Directory Server. Authorization errors can
 * occur when a client attempts to perform an administrative operation
 * which they are not permitted to perform.
 * This exception is thrown when an authorization error occurs while interacting
 * with the Directory Server. Authorization errors can occur when a client
 * attempts to perform an administrative operation which they are not permitted
 * to perform.
 */
public class AuthorizationException extends AdminSecurityException {
@@ -48,8 +44,6 @@
   */
  private static final long serialVersionUID = 8414248362572933814L;
  /**
   * Create an authorization exception with a default message.
   */
@@ -57,11 +51,8 @@
    super(ERR_AUTHORIZATION_EXCEPTION_DEFAULT.get());
  }
  /**
   * Create an authorization exception with a cause and a default
   * message.
     * Create an authorization exception with a cause and a default message.
   *
   * @param cause
   *          The cause.
@@ -70,8 +61,6 @@
    super(ERR_AUTHORIZATION_EXCEPTION_DEFAULT.get(), cause);
  }
  /**
   * Create an authorization exception with a message and cause.
   *
@@ -80,19 +69,17 @@
   * @param cause
   *          The cause.
   */
  public AuthorizationException(Message message, Throwable cause) {
    public AuthorizationException(LocalizableMessage message, Throwable cause) {
    super(message, cause);
  }
  /**
   * Create an authorization exception with a message.
   *
   * @param message
   *          The message.
   */
  public AuthorizationException(Message message) {
    public AuthorizationException(LocalizableMessage message) {
    super(message);
  }
}
opendj-admin/src/main/java/org/opends/server/admin/client/CommunicationException.java
@@ -29,9 +29,9 @@
import static org.opends.messages.AdminMessages.*;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.messages.Message;
import static com.forgerock.opendj.ldap.AdminMessages.*;
@@ -82,7 +82,7 @@
   * @param cause
   *          The cause.
   */
  public CommunicationException(Message message, Throwable cause) {
  public CommunicationException(LocalizableMessage message, Throwable cause) {
    super(message, cause);
  }
@@ -94,7 +94,7 @@
   * @param message
   *          The message.
   */
  public CommunicationException(Message message) {
  public CommunicationException(LocalizableMessage message) {
    super(message);
  }
}
opendj-admin/src/main/java/org/opends/server/admin/client/ConcurrentModificationException.java
@@ -29,9 +29,9 @@
import static org.opends.messages.AdminMessages.*;
import static com.forgerock.opendj.ldap.AdminMessages.*;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.admin.OperationsException;
@@ -82,7 +82,7 @@
   * @param cause
   *          The cause.
   */
  public ConcurrentModificationException(Message message, Throwable cause) {
  public ConcurrentModificationException(LocalizableMessage message, Throwable cause) {
    super(message, cause);
  }
@@ -94,7 +94,7 @@
   * @param message
   *          The message.
   */
  public ConcurrentModificationException(Message message) {
  public ConcurrentModificationException(LocalizableMessage message) {
    super(message);
  }
}
opendj-admin/src/main/java/org/opends/server/admin/client/IllegalManagedObjectNameException.java
@@ -29,9 +29,9 @@
import static org.opends.messages.AdminMessages.*;
import static com.forgerock.opendj.ldap.AdminMessages.*;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.admin.IllegalPropertyValueStringException;
import org.opends.server.admin.OperationsException;
import org.opends.server.admin.PropertyDefinition;
@@ -58,7 +58,7 @@
  // Create the message
  private static Message createMessage(String illegalName,
  private static LocalizableMessage createMessage(String illegalName,
      PropertyDefinition<?> namingPropertyDefinition) {
    if (illegalName.length() == 0) {
      return ERR_ILLEGAL_MANAGED_OBJECT_NAME_EXCEPTION_EMPTY.get();
opendj-admin/src/main/java/org/opends/server/admin/client/ManagedObjectDecodingException.java
@@ -29,19 +29,19 @@
import static org.opends.messages.AdminMessages.*;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import static com.forgerock.opendj.ldap.AdminMessages.*;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.opends.server.admin.DecodingException;
import org.opends.server.admin.ManagedObjectDefinition;
import org.opends.server.admin.PropertyException;
import org.opends.server.util.Validator;
import com.forgerock.opendj.util.Validator;
@@ -59,25 +59,25 @@
  // Create the message.
  private static Message createMessage(ManagedObject<?> partialManagedObject,
  private static LocalizableMessage createMessage(ManagedObject<?> partialManagedObject,
      Collection<PropertyException> causes) {
    Validator.ensureNotNull(causes);
    Validator.ensureTrue(!causes.isEmpty());
    Validator.ensureTrue(!causes.isEmpty(), "causes should not be empty");
    ManagedObjectDefinition<?, ?> d = partialManagedObject
        .getManagedObjectDefinition();
    if (causes.size() == 1) {
      return ERR_MANAGED_OBJECT_DECODING_EXCEPTION_SINGLE.get(d
          .getUserFriendlyName(), causes.iterator().next().getMessageObject());
          .getUserFriendlyName(), causes.iterator().next().getLocalizableMessageObject());
    } else {
      MessageBuilder builder = new MessageBuilder();
      LocalizableMessageBuilder builder = new LocalizableMessageBuilder();
      boolean isFirst = true;
      for (PropertyException cause : causes) {
        if (!isFirst) {
          builder.append("; ");
        }
        builder.append(cause.getMessageObject());
        builder.append(cause.getLocalizableMessageObject());
        isFirst = false;
      }
opendj-admin/src/main/java/org/opends/server/admin/client/ManagementContext.java
@@ -27,11 +27,10 @@
package org.opends.server.admin.client;
import java.util.Set;
import java.util.SortedSet;
import org.forgerock.opendj.admin.client.RootCfgClient;
import org.opends.server.admin.AbstractManagedObjectDefinition;
import org.opends.server.admin.Configuration;
import org.opends.server.admin.ConfigurationClient;
@@ -44,9 +43,6 @@
import org.opends.server.admin.PropertyException;
import org.opends.server.admin.SetRelationDefinition;
import org.opends.server.admin.client.spi.Driver;
import org.opends.server.admin.std.client.RootCfgClient;
/**
 * Client management connection context.
@@ -60,11 +56,9 @@
    // No implementation required.
  }
  /**
   * Deletes the named instantiable child managed object from the
   * named parent managed object.
     * Deletes the named instantiable child managed object from the named parent
     * managed object.
   *
   * @param <C>
   *          The type of client managed object configuration that the
@@ -78,12 +72,11 @@
   *          The instantiable relation definition.
   * @param name
   *          The name of the child managed object to be removed.
   * @return Returns <code>true</code> if the named instantiable
   *         child managed object was found, or <code>false</code>
   *         if it was not found.
     * @return Returns <code>true</code> if the named instantiable child managed
     *         object was found, or <code>false</code> if it was not found.
   * @throws IllegalArgumentException
   *           If the relation definition is not associated with the
   *           parent managed object's definition.
     *             If the relation definition is not associated with the parent
     *             managed object's definition.
   * @throws ManagedObjectNotFoundException
   *           If the parent managed object could not be found.
   * @throws OperationRejectedException
@@ -92,27 +85,22 @@
   *           satisfied (for example, if it is referenced by another
   *           managed object).
   * @throws AuthorizationException
   *           If the server refuses to remove the managed objects
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to remove the managed objects because
     *             the client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public final <C extends ConfigurationClient, S extends Configuration>
  boolean deleteManagedObject(
      ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd,
      String name) throws IllegalArgumentException,
      ManagedObjectNotFoundException, OperationRejectedException,
    public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject(
            ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd, String name)
            throws IllegalArgumentException, ManagedObjectNotFoundException, OperationRejectedException,
      AuthorizationException, CommunicationException {
    return getDriver().deleteManagedObject(parent, rd, name);
  }
  /**
   * Deletes the optional child managed object from the named parent
   * managed object.
     * Deletes the optional child managed object from the named parent managed
     * object.
   *
   * @param <C>
   *          The type of client managed object configuration that the
@@ -124,12 +112,11 @@
   *          The path of the parent managed object.
   * @param rd
   *          The optional relation definition.
   * @return Returns <code>true</code> if the optional child managed
   *         object was found, or <code>false</code> if it was not
   *         found.
     * @return Returns <code>true</code> if the optional child managed object
     *         was found, or <code>false</code> if it was not found.
   * @throws IllegalArgumentException
   *           If the relation definition is not associated with the
   *           parent managed object's definition.
     *             If the relation definition is not associated with the parent
     *             managed object's definition.
   * @throws ManagedObjectNotFoundException
   *           If the parent managed object could not be found.
   * @throws OperationRejectedException
@@ -138,27 +125,20 @@
   *           satisfied (for example, if it is referenced by another
   *           managed object).
   * @throws AuthorizationException
   *           If the server refuses to remove the managed objects
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to remove the managed objects because
     *             the client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public final <C extends ConfigurationClient, S extends Configuration>
  boolean deleteManagedObject(
      ManagedObjectPath<?, ?> parent, OptionalRelationDefinition<C, S> rd)
      throws IllegalArgumentException, ManagedObjectNotFoundException,
      OperationRejectedException, AuthorizationException,
      CommunicationException {
    public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject(
            ManagedObjectPath<?, ?> parent, OptionalRelationDefinition<C, S> rd) throws IllegalArgumentException,
            ManagedObjectNotFoundException, OperationRejectedException, AuthorizationException, CommunicationException {
    return getDriver().deleteManagedObject(parent, rd);
  }
  /**
   * Deletes s set child managed object from the
   * named parent managed object.
     * Deletes s set child managed object from the named parent managed object.
   *
   * @param <C>
   *          The type of client managed object configuration that the
@@ -172,12 +152,11 @@
   *          The set relation definition.
   * @param name
   *          The name of the child managed object to be removed.
   * @return Returns <code>true</code> if the set
   *         child managed object was found, or <code>false</code>
   *         if it was not found.
     * @return Returns <code>true</code> if the set child managed object was
     *         found, or <code>false</code> if it was not found.
   * @throws IllegalArgumentException
   *           If the relation definition is not associated with the
   *           parent managed object's definition.
     *             If the relation definition is not associated with the parent
     *             managed object's definition.
   * @throws ManagedObjectNotFoundException
   *           If the parent managed object could not be found.
   * @throws OperationRejectedException
@@ -186,59 +165,51 @@
   *           satisfied (for example, if it is referenced by another
   *           managed object).
   * @throws AuthorizationException
   *           If the server refuses to remove the managed objects
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to remove the managed objects because
     *             the client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public final <C extends ConfigurationClient, S extends Configuration>
  boolean deleteManagedObject(
      ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd,
      String name) throws IllegalArgumentException,
      ManagedObjectNotFoundException, OperationRejectedException,
    public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject(
            ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd, String name)
            throws IllegalArgumentException, ManagedObjectNotFoundException, OperationRejectedException,
      AuthorizationException, CommunicationException {
    return getDriver().deleteManagedObject(parent, rd, name);
  }
  /**
   * Gets the named managed object.
   *
   * @param <C>
   *          The type of client managed object configuration that the
   *          path definition refers to.
     *            The type of client managed object configuration that the path
     *            definition refers to.
   * @param <S>
   *          The type of server managed object configuration that the
   *          path definition refers to.
     *            The type of server managed object configuration that the path
     *            definition refers to.
   * @param path
   *          The path of the managed object.
   * @return Returns the named managed object.
   * @throws DefinitionDecodingException
   *           If the managed object was found but its type could not
   *           be determined.
     *             If the managed object was found but its type could not be
     *             determined.
   * @throws ManagedObjectDecodingException
   *           If the managed object was found but one or more of its
   *           properties could not be decoded.
   * @throws ManagedObjectNotFoundException
   *           If the requested managed object could not be found on
   *           the server.
     *             If the requested managed object could not be found on the
     *             server.
   * @throws AuthorizationException
   *           If the server refuses to retrieve the managed object
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to retrieve the managed object because
     *             the client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  @SuppressWarnings("unchecked")
  public final <C extends ConfigurationClient, S extends Configuration>
  ManagedObject<? extends C> getManagedObject(
      ManagedObjectPath<C, S> path) throws DefinitionDecodingException,
      ManagedObjectDecodingException, ManagedObjectNotFoundException,
      AuthorizationException, CommunicationException {
    public final <C extends ConfigurationClient, S extends Configuration> ManagedObject<? extends C> getManagedObject(
            ManagedObjectPath<C, S> path) throws DefinitionDecodingException, ManagedObjectDecodingException,
            ManagedObjectNotFoundException, AuthorizationException, CommunicationException {
    // Be careful to handle the root configuration.
    if (path.isEmpty()) {
      return (ManagedObject<C>) getRootConfigurationManagedObject();
@@ -247,11 +218,8 @@
    return getDriver().getManagedObject(path);
  }
  /**
   * Gets the effective value of a property in the named managed
   * object.
     * Gets the effective value of a property in the named managed object.
   *
   * @param <PD>
   *          The type of the property to be retrieved.
@@ -259,33 +227,30 @@
   *          The path of the managed object containing the property.
   * @param pd
   *          The property to be retrieved.
   * @return Returns the property's effective value, or
   *         <code>null</code> if there are no values defined.
     * @return Returns the property's effective value, or <code>null</code> if
     *         there are no values defined.
   * @throws IllegalArgumentException
   *           If the property definition is not associated with the
   *           referenced managed object's definition.
   * @throws DefinitionDecodingException
   *           If the managed object was found but its type could not
   *           be determined.
     *             If the managed object was found but its type could not be
     *             determined.
   * @throws PropertyException
   *           If the managed object was found but the requested
   *           property could not be decoded.
     *             If the managed object was found but the requested property
     *             could not be decoded.
   * @throws ManagedObjectNotFoundException
   *           If the requested managed object could not be found on
   *           the server.
     *             If the requested managed object could not be found on the
     *             server.
   * @throws AuthorizationException
   *           If the server refuses to retrieve the managed object
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to retrieve the managed object because
     *             the client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public final <PD> PD getPropertyValue(ManagedObjectPath<?, ?> path,
      PropertyDefinition<PD> pd) throws IllegalArgumentException,
      DefinitionDecodingException, AuthorizationException,
      ManagedObjectNotFoundException, CommunicationException,
      PropertyException {
    public final <PD> PD getPropertyValue(ManagedObjectPath<?, ?> path, PropertyDefinition<PD> pd)
            throws IllegalArgumentException, DefinitionDecodingException, AuthorizationException,
            ManagedObjectNotFoundException, CommunicationException, PropertyException {
    Set<PD> values = getPropertyValues(path, pd);
    if (values.isEmpty()) {
      return null;
@@ -294,11 +259,8 @@
    }
  }
  /**
   * Gets the effective values of a property in the named managed
   * object.
     * Gets the effective values of a property in the named managed object.
   *
   * @param <PD>
   *          The type of the property to be retrieved.
@@ -306,68 +268,57 @@
   *          The path of the managed object containing the property.
   * @param pd
   *          The property to be retrieved.
   * @return Returns the property's effective values, or an empty set
   *         if there are no values defined.
     * @return Returns the property's effective values, or an empty set if there
     *         are no values defined.
   * @throws IllegalArgumentException
   *           If the property definition is not associated with the
   *           referenced managed object's definition.
   * @throws DefinitionDecodingException
   *           If the managed object was found but its type could not
   *           be determined.
     *             If the managed object was found but its type could not be
     *             determined.
   * @throws PropertyException
   *           If the managed object was found but the requested
   *           property could not be decoded.
     *             If the managed object was found but the requested property
     *             could not be decoded.
   * @throws ManagedObjectNotFoundException
   *           If the requested managed object could not be found on
   *           the server.
     *             If the requested managed object could not be found on the
     *             server.
   * @throws AuthorizationException
   *           If the server refuses to retrieve the managed object
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to retrieve the managed object because
     *             the client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public final <PD> SortedSet<PD> getPropertyValues(
      ManagedObjectPath<?, ?> path, PropertyDefinition<PD> pd)
      throws IllegalArgumentException, DefinitionDecodingException,
      AuthorizationException, ManagedObjectNotFoundException,
      CommunicationException, PropertyException {
    public final <PD> SortedSet<PD> getPropertyValues(ManagedObjectPath<?, ?> path, PropertyDefinition<PD> pd)
            throws IllegalArgumentException, DefinitionDecodingException, AuthorizationException,
            ManagedObjectNotFoundException, CommunicationException, PropertyException {
    return getDriver().getPropertyValues(path, pd);
  }
  /**
   * Gets the root configuration client associated with this
   * management context.
     * Gets the root configuration client associated with this management
     * context.
   *
   * @return Returns the root configuration client associated with
   *         this management context.
     * @return Returns the root configuration client associated with this
     *         management context.
   */
  public final RootCfgClient getRootConfiguration() {
    return getRootConfigurationManagedObject().getConfiguration();
  }
  /**
   * Gets the root configuration managed object associated with this
   * management context.
   *
   * @return Returns the root configuration managed object associated
   *         with this management context.
     * @return Returns the root configuration managed object associated with
     *         this management context.
   */
  public final
  ManagedObject<RootCfgClient> getRootConfigurationManagedObject() {
    public final ManagedObject<RootCfgClient> getRootConfigurationManagedObject() {
    return getDriver().getRootConfigurationManagedObject();
  }
  /**
   * Lists the child managed objects of the named parent managed
   * object.
     * Lists the child managed objects of the named parent managed object.
   *
   * @param <C>
   *          The type of client managed object configuration that the
@@ -381,32 +332,26 @@
   *          The instantiable relation definition.
   * @return Returns the names of the child managed objects.
   * @throws IllegalArgumentException
   *           If the relation definition is not associated with the
   *           parent managed object's definition.
     *             If the relation definition is not associated with the parent
     *             managed object's definition.
   * @throws ManagedObjectNotFoundException
   *           If the parent managed object could not be found.
   * @throws AuthorizationException
   *           If the server refuses to list the managed objects
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to list the managed objects because the
     *             client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public final <C extends ConfigurationClient, S extends Configuration>
  String[] listManagedObjects(
      ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd)
      throws IllegalArgumentException, ManagedObjectNotFoundException,
      AuthorizationException, CommunicationException {
    public final <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects(
            ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd) throws IllegalArgumentException,
            ManagedObjectNotFoundException, AuthorizationException, CommunicationException {
    return listManagedObjects(parent, rd, rd.getChildDefinition());
  }
  /**
   * Lists the child managed objects of the named parent managed
   * object which are a sub-type of the specified managed object
   * definition.
     * Lists the child managed objects of the named parent managed object which
     * are a sub-type of the specified managed object definition.
   *
   * @param <C>
   *          The type of client managed object configuration that the
@@ -420,35 +365,29 @@
   *          The instantiable relation definition.
   * @param d
   *          The managed object definition.
   * @return Returns the names of the child managed objects which are
   *         a sub-type of the specified managed object definition.
     * @return Returns the names of the child managed objects which are a
     *         sub-type of the specified managed object definition.
   * @throws IllegalArgumentException
   *           If the relation definition is not associated with the
   *           parent managed object's definition.
     *             If the relation definition is not associated with the parent
     *             managed object's definition.
   * @throws ManagedObjectNotFoundException
   *           If the parent managed object could not be found.
   * @throws AuthorizationException
   *           If the server refuses to list the managed objects
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to list the managed objects because the
     *             client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public final <C extends ConfigurationClient, S extends Configuration>
  String[] listManagedObjects(
    public final <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects(
      ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd,
      AbstractManagedObjectDefinition<? extends C, ? extends S> d)
      throws IllegalArgumentException, ManagedObjectNotFoundException,
      AuthorizationException, CommunicationException {
            AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws IllegalArgumentException,
            ManagedObjectNotFoundException, AuthorizationException, CommunicationException {
    return getDriver().listManagedObjects(parent, rd, d);
  }
  /**
   * Lists the child managed objects of the named parent managed
   * object.
     * Lists the child managed objects of the named parent managed object.
   *
   * @param <C>
   *          The type of client managed object configuration that the
@@ -462,62 +401,51 @@
   *          The set relation definition.
   * @return Returns the names of the child managed objects.
   * @throws IllegalArgumentException
   *           If the relation definition is not associated with the
   *           parent managed object's definition.
     *             If the relation definition is not associated with the parent
     *             managed object's definition.
   * @throws ManagedObjectNotFoundException
   *           If the parent managed object could not be found.
   * @throws AuthorizationException
   *           If the server refuses to list the managed objects
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to list the managed objects because the
     *             client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public final <C extends ConfigurationClient, S extends Configuration>
  String[] listManagedObjects(
      ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd)
      throws IllegalArgumentException, ManagedObjectNotFoundException,
      AuthorizationException, CommunicationException {
    public final <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects(
            ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd) throws IllegalArgumentException,
            ManagedObjectNotFoundException, AuthorizationException, CommunicationException {
    return getDriver().listManagedObjects(parent, rd, rd.getChildDefinition());
  }
  /**
   * Determines whether or not the named managed object exists.
   *
   * @param path
   *          The path of the named managed object.
   * @return Returns <code>true</code> if the named managed object
   *         exists, <code>false</code> otherwise.
     * @return Returns <code>true</code> if the named managed object exists,
     *         <code>false</code> otherwise.
   * @throws ManagedObjectNotFoundException
   *           If the parent managed object could not be found.
   * @throws AuthorizationException
   *           If the server refuses to make the determination because
   *           the client does not have the correct privileges.
     *             If the server refuses to make the determination because the
     *             client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public final boolean managedObjectExists(ManagedObjectPath<?, ?> path)
      throws ManagedObjectNotFoundException, AuthorizationException,
      CommunicationException {
    public final boolean managedObjectExists(ManagedObjectPath<?, ?> path) throws ManagedObjectNotFoundException,
            AuthorizationException, CommunicationException {
    return getDriver().managedObjectExists(path);
  }
  /**
   * Gets the driver associated with this management context.
   *
   * @return Returns the driver associated with this management
   *         context.
     * @return Returns the driver associated with this management context.
   */
  protected abstract Driver getDriver();
  /**
   * Closes this management context.
   */
opendj-admin/src/main/java/org/opends/server/admin/client/MissingMandatoryPropertiesException.java
@@ -29,17 +29,18 @@
import static org.opends.messages.AdminMessages.*;
import static com.forgerock.opendj.ldap.AdminMessages.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.opends.server.admin.OperationsException;
import org.opends.server.admin.PropertyIsMandatoryException;
import org.opends.server.util.Validator;
import com.forgerock.opendj.util.Validator;
@@ -58,16 +59,16 @@
  // Create the message.
  private static Message createMessage(
  private static LocalizableMessage createMessage(
      Collection<PropertyIsMandatoryException> causes) {
    Validator.ensureNotNull(causes);
    Validator.ensureTrue(!causes.isEmpty());
    Validator.ensureTrue(!causes.isEmpty(), "causes should not be empty");
    if (causes.size() == 1) {
      return ERR_MISSING_MANDATORY_PROPERTIES_EXCEPTION_SINGLE.get(causes
          .iterator().next().getPropertyDefinition().getName());
    } else {
      MessageBuilder builder = new MessageBuilder();
      LocalizableMessageBuilder builder = new LocalizableMessageBuilder();
      boolean isFirst = true;
      for (PropertyIsMandatoryException cause : causes) {
@@ -92,7 +93,7 @@
  // The user friendly name of the component that caused this
  // exception.
  private final Message ufn;
  private final LocalizableMessage ufn;
@@ -110,7 +111,7 @@
   *          Indicates whether the exception occurred during managed
   *          object creation.
   */
  public MissingMandatoryPropertiesException(Message ufn,
  public MissingMandatoryPropertiesException(LocalizableMessage ufn,
      Collection<PropertyIsMandatoryException> causes, boolean isCreate) {
    super(createMessage(causes));
@@ -153,7 +154,7 @@
   * @return Returns the user friendly name of the component that
   *         caused this exception.
   */
  public Message getUserFriendlyName() {
  public LocalizableMessage getUserFriendlyName() {
    return ufn;
  }
opendj-admin/src/main/java/org/opends/server/admin/client/OperationRejectedException.java
@@ -27,32 +27,27 @@
package org.opends.server.admin.client;
import static org.opends.messages.AdminMessages.*;
import static com.forgerock.opendj.ldap.AdminMessages.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.opends.server.util.Validator;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import com.forgerock.opendj.util.Validator;
/**
 * This exception is thrown when the client or server refuses to
 * create, delete, or modify a managed object due to one or more
 * constraints that cannot be satisfied.
 * This exception is thrown when the client or server refuses to create, delete,
 * or modify a managed object due to one or more constraints that cannot be
 * satisfied.
 * <p>
 * Operations can be rejected either by a client-side constraint
 * violation triggered by {@link ClientConstraintHandler}, or by a
 * server-side error.
 * Operations can be rejected either by a client-side constraint violation
 * triggered by {@link ClientConstraintHandler}, or by a server-side error.
 * <p>
 * For example, the Directory Server might not be able perform an
 * operation due to some OS related problem, such as lack of disk
 * space, or missing files.
 * For example, the Directory Server might not be able perform an operation due
 * to some OS related problem, such as lack of disk space, or missing files.
 */
public class OperationRejectedException extends AdminClientException {
@@ -81,33 +76,27 @@
   */
  private static final long serialVersionUID = 8547688890613079044L;
  // Gets the default message.
  private static Message getDefaultMessage(Collection<Message> messages) {
    private static LocalizableMessage getDefaultMessage(Collection<LocalizableMessage> messages) {
    Validator.ensureNotNull(messages);
    Validator.ensureTrue(!messages.isEmpty());
        Validator.ensureTrue(!messages.isEmpty(), "Messages should not be empty");
    if (messages.size() == 1) {
      return ERR_OPERATION_REJECTED_EXCEPTION_SINGLE.get(messages.iterator()
          .next());
            return ERR_OPERATION_REJECTED_EXCEPTION_SINGLE.get(messages.iterator().next());
    } else {
      return ERR_OPERATION_REJECTED_EXCEPTION_PLURAL
          .get(getSingleMessage(messages));
            return ERR_OPERATION_REJECTED_EXCEPTION_PLURAL.get(getSingleMessage(messages));
    }
  }
  // Merge the messages into a single message.
  private static Message getSingleMessage(Collection<Message> messages) {
    private static LocalizableMessage getSingleMessage(Collection<LocalizableMessage> messages) {
    if (messages.size() == 1) {
      return messages.iterator().next();
    } else {
      MessageBuilder builder = new MessageBuilder();
            LocalizableMessageBuilder builder = new LocalizableMessageBuilder();
      boolean isFirst = true;
      for (Message m : messages) {
            for (LocalizableMessage m : messages) {
        if (!isFirst) {
          builder.append(";  ");
        }
@@ -120,20 +109,17 @@
  }
  // The messages describing the constraint violations that occurred.
  private final Collection<Message> messages;
    private final Collection<LocalizableMessage> messages;
  // The type of operation that caused this exception.
  private final OperationType type;
  // The user friendly name of the component that caused this
  // exception.
  private final Message ufn;
    private final LocalizableMessage ufn;
  /**
   * Creates a new operation rejected exception with a default
   * message.
     * Creates a new operation rejected exception with a default message.
   *
   * @param type
   *          The type of operation that caused this exception.
@@ -141,15 +127,12 @@
   *          The user friendly name of the component that caused this
   *          exception.
   */
  public OperationRejectedException(OperationType type, Message ufn) {
    public OperationRejectedException(OperationType type, LocalizableMessage ufn) {
    this(type, ufn, ERR_OPERATION_REJECTED_DEFAULT.get());
  }
  /**
   * Creates a new operation rejected exception with the provided
   * messages.
     * Creates a new operation rejected exception with the provided messages.
   *
   * @param type
   *          The type of operation that caused this exception.
@@ -158,23 +141,18 @@
   *          exception.
   * @param messages
   *          The messages describing the constraint violations that
   *          occurred (must be non-<code>null</code> and
   *          non-empty).
     *            occurred (must be non-<code>null</code> and non-empty).
   */
  public OperationRejectedException(OperationType type, Message ufn,
      Collection<Message> messages) {
    public OperationRejectedException(OperationType type, LocalizableMessage ufn, Collection<LocalizableMessage> messages) {
    super(getDefaultMessage(messages));
    this.messages = new ArrayList<Message>(messages);
        this.messages = new ArrayList<LocalizableMessage>(messages);
    this.type = type;
    this.ufn = ufn;
  }
  /**
   * Creates a new operation rejected exception with the provided
   * message.
     * Creates a new operation rejected exception with the provided message.
   *
   * @param type
   *          The type of operation that caused this exception.
@@ -182,42 +160,34 @@
   *          The user friendly name of the component that caused this
   *          exception.
   * @param message
   *          The message describing the constraint violation that
   *          occurred.
     *            The message describing the constraint violation that occurred.
   */
  public OperationRejectedException(OperationType type, Message ufn,
      Message message) {
    public OperationRejectedException(OperationType type, LocalizableMessage ufn, LocalizableMessage message) {
    this(type, ufn, Collections.singleton(message));
  }
  /**
   * Gets an unmodifiable collection view of the messages describing
   * the constraint violations that occurred.
     * Gets an unmodifiable collection view of the messages describing the
     * constraint violations that occurred.
   *
   * @return Returns an unmodifiable collection view of the messages
   *         describing the constraint violations that occurred.
   */
  public Collection<Message> getMessages() {
    public Collection<LocalizableMessage> getMessages() {
    return Collections.unmodifiableCollection(messages);
  }
  /**
   * Creates a single message listing all the messages combined into a
   * single list separated by semi-colons.
     * Creates a single message listing all the messages combined into a single
     * list separated by semi-colons.
   *
   * @return Returns a single message listing all the messages
   *         combined into a single list separated by semi-colons.
     * @return Returns a single message listing all the messages combined into a
     *         single list separated by semi-colons.
   */
  public Message getMessagesAsSingleMessage() {
    public LocalizableMessage getMessagesAsSingleMessage() {
    return getSingleMessage(messages);
  }
  /**
   * Gets the type of operation that caused this exception.
   *
@@ -227,16 +197,13 @@
    return type;
  }
  /**
   * Gets the user friendly name of the component that caused this
   * exception.
     * Gets the user friendly name of the component that caused this exception.
   *
   * @return Returns the user friendly name of the component that
   *         caused this exception.
     * @return Returns the user friendly name of the component that caused this
     *         exception.
   */
  public Message getUserFriendlyName() {
    public LocalizableMessage getUserFriendlyName() {
    return ufn;
  }
opendj-admin/src/main/java/org/opends/server/admin/client/package-info.java
@@ -25,15 +25,11 @@
 *      Copyright 2008 Sun Microsystems, Inc.
 */
/**
 * Common client-side administration classes.
 * <p>
 * This package contains classes which client applications are
 * expected to use.
 */
@org.opends.server.types.PublicAPI(
     stability=org.opends.server.types.StabilityLevel.PRIVATE)
package org.opends.server.admin.client;
opendj-admin/src/main/java/org/opends/server/admin/client/spi/Driver.java
@@ -27,8 +27,6 @@
package org.opends.server.admin.client.spi;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -36,7 +34,8 @@
import java.util.List;
import java.util.SortedSet;
import org.opends.messages.Message;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.admin.client.RootCfgClient;
import org.opends.server.admin.AbsoluteInheritedDefaultBehaviorProvider;
import org.opends.server.admin.AbstractManagedObjectDefinition;
import org.opends.server.admin.AliasDefaultBehaviorProvider;
@@ -70,25 +69,21 @@
import org.opends.server.admin.client.ManagementContext;
import org.opends.server.admin.client.OperationRejectedException;
import org.opends.server.admin.client.OperationRejectedException.OperationType;
import org.opends.server.admin.std.client.RootCfgClient;
/**
 * An abstract management connection context driver which should form
 * the basis of driver implementations.
 * An abstract management connection context driver which should form the basis
 * of driver implementations.
 */
public abstract class Driver {
  /**
   * A default behavior visitor used for retrieving the default values
   * of a property.
     * A default behavior visitor used for retrieving the default values of a
     * property.
   *
   * @param <T>
   *          The type of the property.
   */
  private class DefaultValueFinder<T> implements
      DefaultBehaviorProviderVisitor<T, Collection<T>, Void> {
    private class DefaultValueFinder<T> implements DefaultBehaviorProviderVisitor<T, Collection<T>, Void> {
    // Any exception that occurred whilst retrieving inherited default
    // values.
@@ -106,32 +101,25 @@
    // The next property whose default values were required.
    private PropertyDefinition<T> nextProperty = null;
    // Private constructor.
    private DefaultValueFinder(ManagedObjectPath<?, ?> p, boolean isCreate) {
      this.firstPath = p;
      this.isCreate = isCreate;
    }
    /**
     * {@inheritDoc}
     */
    public Collection<T> visitAbsoluteInherited(
        AbsoluteInheritedDefaultBehaviorProvider<T> d, Void p) {
        public Collection<T> visitAbsoluteInherited(AbsoluteInheritedDefaultBehaviorProvider<T> d, Void p) {
      try {
        return getInheritedProperty(d.getManagedObjectPath(), d
            .getManagedObjectDefinition(), d.getPropertyName());
                return getInheritedProperty(d.getManagedObjectPath(), d.getManagedObjectDefinition(),
                        d.getPropertyName());
      } catch (DefaultBehaviorException e) {
        exception = e;
        return Collections.emptySet();
      }
    }
    /**
     * {@inheritDoc}
     */
@@ -139,13 +127,10 @@
      return Collections.emptySet();
    }
    /**
     * {@inheritDoc}
     */
    public Collection<T> visitDefined(DefinedDefaultBehaviorProvider<T> d,
        Void p) {
        public Collection<T> visitDefined(DefinedDefaultBehaviorProvider<T> d, Void p) {
      Collection<String> stringValues = d.getDefaultValues();
      List<T> values = new ArrayList<T>(stringValues.size());
@@ -161,69 +146,53 @@
      return values;
    }
    /**
     * {@inheritDoc}
     */
    public Collection<T> visitRelativeInherited(
        RelativeInheritedDefaultBehaviorProvider<T> d, Void p) {
        public Collection<T> visitRelativeInherited(RelativeInheritedDefaultBehaviorProvider<T> d, Void p) {
      try {
        return getInheritedProperty(d.getManagedObjectPath(nextPath), d
            .getManagedObjectDefinition(), d.getPropertyName());
                return getInheritedProperty(d.getManagedObjectPath(nextPath), d.getManagedObjectDefinition(),
                        d.getPropertyName());
      } catch (DefaultBehaviorException e) {
        exception = e;
        return Collections.emptySet();
      }
    }
    /**
     * {@inheritDoc}
     */
    public Collection<T> visitUndefined(UndefinedDefaultBehaviorProvider<T> d,
        Void p) {
        public Collection<T> visitUndefined(UndefinedDefaultBehaviorProvider<T> d, Void p) {
      return Collections.emptySet();
    }
    // Find the default values for the next path/property.
    private Collection<T> find(ManagedObjectPath<?, ?> p,
        PropertyDefinition<T> pd) throws DefaultBehaviorException {
        private Collection<T> find(ManagedObjectPath<?, ?> p, PropertyDefinition<T> pd) throws DefaultBehaviorException {
      this.nextPath = p;
      this.nextProperty = pd;
      Collection<T> values = nextProperty.getDefaultBehaviorProvider().accept(
          this, null);
            Collection<T> values = nextProperty.getDefaultBehaviorProvider().accept(this, null);
      if (exception != null) {
        throw exception;
      }
      if (values.size() > 1 && !pd.hasOption(PropertyOption.MULTI_VALUED)) {
        throw new DefaultBehaviorException(pd,
            new PropertyIsSingleValuedException(pd));
                throw new DefaultBehaviorException(pd, new PropertyIsSingleValuedException(pd));
      }
      return values;
    }
    // Get an inherited property value.
    @SuppressWarnings("unchecked")
    private Collection<T> getInheritedProperty(ManagedObjectPath target,
        AbstractManagedObjectDefinition<?, ?> d, String propertyName)
        throws DefaultBehaviorException {
        private Collection<T> getInheritedProperty(ManagedObjectPath target, AbstractManagedObjectDefinition<?, ?> d,
                String propertyName) throws DefaultBehaviorException {
      // First check that the requested type of managed object
      // corresponds to the path.
      AbstractManagedObjectDefinition<?, ?> supr = target
          .getManagedObjectDefinition();
            AbstractManagedObjectDefinition<?, ?> supr = target.getManagedObjectDefinition();
      if (!supr.isParentOf(d)) {
        throw new DefaultBehaviorException(
            nextProperty, new DefinitionDecodingException(supr,
                throw new DefaultBehaviorException(nextProperty, new DefinitionDecodingException(supr,
                Reason.WRONG_TYPE_INFORMATION));
      }
@@ -260,8 +229,10 @@
          }
          return values;
        } else {
          // FIXME: issue 2481 - this is broken if the referenced property
          // inherits its defaults from the newly created managed object.
                    // FIXME: issue 2481 - this is broken if the referenced
                    // property
                    // inherits its defaults from the newly created managed
                    // object.
          return getPropertyValues(target, pd2);
        }
      } catch (DefaultBehaviorException e) {
@@ -283,8 +254,6 @@
    }
  };
  /**
   * Creates a new abstract management context.
   */
@@ -292,70 +261,15 @@
    // No implementation required.
  }
  /**
   * Closes any context associated with this management context
   * driver.
     * Closes any context associated with this management context driver.
   */
  public void close() {
    // do nothing by default
  }
  /**
   * Deletes the named instantiable child managed object from the
   * named parent managed object.
   *
   * @param <C>
   *          The type of client managed object configuration that the
   *          relation definition refers to.
   * @param <S>
   *          The type of server managed object configuration that the
   *          relation definition refers to.
   * @param parent
   *          The path of the parent managed object.
   * @param rd
   *          The instantiable relation definition.
   * @param name
   *          The name of the child managed object to be removed.
   * @return Returns <code>true</code> if the named instantiable
   *         child managed object was found, or <code>false</code>
   *         if it was not found.
   * @throws IllegalArgumentException
   *           If the relation definition is not associated with the
   *           parent managed object's definition.
   * @throws ManagedObjectNotFoundException
   *           If the parent managed object could not be found.
   * @throws OperationRejectedException
   *           If the managed object cannot be removed due to some
   *           client-side or server-side constraint which cannot be
   *           satisfied (for example, if it is referenced by another
   *           managed object).
   * @throws AuthorizationException
   *           If the server refuses to remove the managed objects
   *           because the client does not have the correct
   *           privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
   */
  public final <C extends ConfigurationClient, S extends Configuration>
  boolean deleteManagedObject(
      ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd,
      String name) throws IllegalArgumentException,
      ManagedObjectNotFoundException, OperationRejectedException,
      AuthorizationException, CommunicationException {
    validateRelationDefinition(parent, rd);
    ManagedObjectPath<?, ?> child = parent.child(rd, name);
    return doDeleteManagedObject(child);
  }
  /**
   * Deletes the optional child managed object from the named parent
     * Deletes the named instantiable child managed object from the named parent
   * managed object.
   *
   * @param <C>
@@ -367,13 +281,14 @@
   * @param parent
   *          The path of the parent managed object.
   * @param rd
   *          The optional relation definition.
   * @return Returns <code>true</code> if the optional child managed
   *         object was found, or <code>false</code> if it was not
   *         found.
     *            The instantiable relation definition.
     * @param name
     *            The name of the child managed object to be removed.
     * @return Returns <code>true</code> if the named instantiable child managed
     *         object was found, or <code>false</code> if it was not found.
   * @throws IllegalArgumentException
   *           If the relation definition is not associated with the
   *           parent managed object's definition.
     *             If the relation definition is not associated with the parent
     *             managed object's definition.
   * @throws ManagedObjectNotFoundException
   *           If the parent managed object could not be found.
   * @throws OperationRejectedException
@@ -382,29 +297,65 @@
   *           satisfied (for example, if it is referenced by another
   *           managed object).
   * @throws AuthorizationException
   *           If the server refuses to remove the managed objects
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to remove the managed objects because
     *             the client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public final <C extends ConfigurationClient, S extends Configuration>
  boolean deleteManagedObject(
      ManagedObjectPath<?, ?> parent, OptionalRelationDefinition<C, S> rd)
      throws IllegalArgumentException, ManagedObjectNotFoundException,
      OperationRejectedException, AuthorizationException,
      CommunicationException {
    public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject(
            ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd, String name)
            throws IllegalArgumentException, ManagedObjectNotFoundException, OperationRejectedException,
            AuthorizationException, CommunicationException {
        validateRelationDefinition(parent, rd);
        ManagedObjectPath<?, ?> child = parent.child(rd, name);
        return doDeleteManagedObject(child);
    }
    /**
     * Deletes the optional child managed object from the named parent managed
     * object.
     *
     * @param <C>
     *            The type of client managed object configuration that the
     *            relation definition refers to.
     * @param <S>
     *            The type of server managed object configuration that the
     *            relation definition refers to.
     * @param parent
     *            The path of the parent managed object.
     * @param rd
     *            The optional relation definition.
     * @return Returns <code>true</code> if the optional child managed object
     *         was found, or <code>false</code> if it was not found.
     * @throws IllegalArgumentException
     *             If the relation definition is not associated with the parent
     *             managed object's definition.
     * @throws ManagedObjectNotFoundException
     *             If the parent managed object could not be found.
     * @throws OperationRejectedException
     *             If the managed object cannot be removed due to some
     *             client-side or server-side constraint which cannot be
     *             satisfied (for example, if it is referenced by another
     *             managed object).
     * @throws AuthorizationException
     *             If the server refuses to remove the managed objects because
     *             the client does not have the correct privileges.
     * @throws CommunicationException
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
     */
    public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject(
            ManagedObjectPath<?, ?> parent, OptionalRelationDefinition<C, S> rd) throws IllegalArgumentException,
            ManagedObjectNotFoundException, OperationRejectedException, AuthorizationException, CommunicationException {
    validateRelationDefinition(parent, rd);
    ManagedObjectPath<?, ?> child = parent.child(rd);
    return doDeleteManagedObject(child);
  }
  /**
   * Deletes the named instantiable child managed object from the
   * named parent managed object.
     * Deletes the named instantiable child managed object from the named parent
     * managed object.
   *
   * @param <C>
   *          The type of client managed object configuration that the
@@ -418,12 +369,11 @@
   *          The instantiable relation definition.
   * @param name
   *          The name of the child managed object to be removed.
   * @return Returns <code>true</code> if the named instantiable
   *         child managed object was found, or <code>false</code>
   *         if it was not found.
     * @return Returns <code>true</code> if the named instantiable child managed
     *         object was found, or <code>false</code> if it was not found.
   * @throws IllegalArgumentException
   *           If the relation definition is not associated with the
   *           parent managed object's definition.
     *             If the relation definition is not associated with the parent
     *             managed object's definition.
   * @throws ManagedObjectNotFoundException
   *           If the parent managed object could not be found.
   * @throws OperationRejectedException
@@ -432,137 +382,115 @@
   *           satisfied (for example, if it is referenced by another
   *           managed object).
   * @throws AuthorizationException
   *           If the server refuses to remove the managed objects
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to remove the managed objects because
     *             the client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public final <C extends ConfigurationClient, S extends Configuration>
  boolean deleteManagedObject(
      ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd,
      String name) throws IllegalArgumentException,
      ManagedObjectNotFoundException, OperationRejectedException,
    public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject(
            ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd, String name)
            throws IllegalArgumentException, ManagedObjectNotFoundException, OperationRejectedException,
      AuthorizationException, CommunicationException {
    validateRelationDefinition(parent, rd);
    ManagedObjectPath<?, ?> child = parent.child(rd, name);
    return doDeleteManagedObject(child);
  }
  /**
   * Gets the named managed object. The path is guaranteed to be
   * non-empty, so implementations do not need to worry about handling
   * this special case.
     * Gets the named managed object. The path is guaranteed to be non-empty, so
     * implementations do not need to worry about handling this special case.
   *
   * @param <C>
   *          The type of client managed object configuration that the
   *          path definition refers to.
     *            The type of client managed object configuration that the path
     *            definition refers to.
   * @param <S>
   *          The type of server managed object configuration that the
   *          path definition refers to.
     *            The type of server managed object configuration that the path
     *            definition refers to.
   * @param path
   *          The non-empty path of the managed object.
   * @return Returns the named managed object.
   * @throws DefinitionDecodingException
   *           If the managed object was found but its type could not
   *           be determined.
     *             If the managed object was found but its type could not be
     *             determined.
   * @throws ManagedObjectDecodingException
   *           If the managed object was found but one or more of its
   *           properties could not be decoded.
   * @throws ManagedObjectNotFoundException
   *           If the requested managed object could not be found on
   *           the server.
     *             If the requested managed object could not be found on the
     *             server.
   * @throws AuthorizationException
   *           If the server refuses to retrieve the managed object
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to retrieve the managed object because
     *             the client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public abstract <C extends ConfigurationClient, S extends Configuration>
  ManagedObject<? extends C> getManagedObject(
      ManagedObjectPath<C, S> path) throws DefinitionDecodingException,
      ManagedObjectDecodingException, ManagedObjectNotFoundException,
      AuthorizationException, CommunicationException;
    public abstract <C extends ConfigurationClient, S extends Configuration> ManagedObject<? extends C> getManagedObject(
            ManagedObjectPath<C, S> path) throws DefinitionDecodingException, ManagedObjectDecodingException,
            ManagedObjectNotFoundException, AuthorizationException, CommunicationException;
  /**
   * Gets the effective values of a property in the named managed
   * object.
     * Gets the effective values of a property in the named managed object.
   * <p>
   * Implementations MUST NOT not use
   * {@link #getManagedObject(ManagedObjectPath)} to read the
   * referenced managed object in its entirety. Specifically,
   * implementations MUST only attempt to resolve the default values
   * for the requested property and its dependencies (if it uses
   * inherited defaults). This is to avoid infinite recursion where a
   * managed object contains a property which inherits default values
   * from another property in the same managed object.
     * {@link #getManagedObject(ManagedObjectPath)} to read the referenced
     * managed object in its entirety. Specifically, implementations MUST only
     * attempt to resolve the default values for the requested property and its
     * dependencies (if it uses inherited defaults). This is to avoid infinite
     * recursion where a managed object contains a property which inherits
     * default values from another property in the same managed object.
   *
   * @param <C>
   *          The type of client managed object configuration that the
   *          path definition refers to.
     *            The type of client managed object configuration that the path
     *            definition refers to.
   * @param <S>
   *          The type of server managed object configuration that the
   *          path definition refers to.
     *            The type of server managed object configuration that the path
     *            definition refers to.
   * @param <PD>
   *          The type of the property to be retrieved.
   * @param path
   *          The path of the managed object containing the property.
   * @param pd
   *          The property to be retrieved.
   * @return Returns the property's effective values, or an empty set
   *         if there are no values defined.
     * @return Returns the property's effective values, or an empty set if there
     *         are no values defined.
   * @throws IllegalArgumentException
   *           If the property definition is not associated with the
   *           referenced managed object's definition.
   * @throws DefinitionDecodingException
   *           If the managed object was found but its type could not
   *           be determined.
     *             If the managed object was found but its type could not be
     *             determined.
   * @throws PropertyException
   *           If the managed object was found but the requested
   *           property could not be decoded.
     *             If the managed object was found but the requested property
     *             could not be decoded.
   * @throws ManagedObjectNotFoundException
   *           If the requested managed object could not be found on
   *           the server.
     *             If the requested managed object could not be found on the
     *             server.
   * @throws AuthorizationException
   *           If the server refuses to retrieve the managed object
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to retrieve the managed object because
     *             the client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public abstract <C extends ConfigurationClient, S extends Configuration, PD>
  SortedSet<PD> getPropertyValues(
      ManagedObjectPath<C, S> path, PropertyDefinition<PD> pd)
      throws IllegalArgumentException, DefinitionDecodingException,
      AuthorizationException, ManagedObjectNotFoundException,
    public abstract <C extends ConfigurationClient, S extends Configuration, PD> SortedSet<PD> getPropertyValues(
            ManagedObjectPath<C, S> path, PropertyDefinition<PD> pd) throws IllegalArgumentException,
            DefinitionDecodingException, AuthorizationException, ManagedObjectNotFoundException,
      CommunicationException, PropertyException;
  /**
   * Gets the root configuration managed object associated with this
   * management context driver.
   *
   * @return Returns the root configuration managed object associated
   *         with this management context driver.
     * @return Returns the root configuration managed object associated with
     *         this management context driver.
   */
  public abstract
  ManagedObject<RootCfgClient> getRootConfigurationManagedObject();
    public abstract ManagedObject<RootCfgClient> getRootConfigurationManagedObject();
  /**
   * Lists the child managed objects of the named parent managed
   * object which are a sub-type of the specified managed object
   * definition.
     * Lists the child managed objects of the named parent managed object which
     * are a sub-type of the specified managed object definition.
   *
   * @param <C>
   *          The type of client managed object configuration that the
@@ -576,34 +504,28 @@
   *          The instantiable relation definition.
   * @param d
   *          The managed object definition.
   * @return Returns the names of the child managed objects which are
   *         a sub-type of the specified managed object definition.
     * @return Returns the names of the child managed objects which are a
     *         sub-type of the specified managed object definition.
   * @throws IllegalArgumentException
   *           If the relation definition is not associated with the
   *           parent managed object's definition.
     *             If the relation definition is not associated with the parent
     *             managed object's definition.
   * @throws ManagedObjectNotFoundException
   *           If the parent managed object could not be found.
   * @throws AuthorizationException
   *           If the server refuses to list the managed objects
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to list the managed objects because the
     *             client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public abstract <C extends ConfigurationClient, S extends Configuration>
  String[] listManagedObjects(
    public abstract <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects(
      ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd,
      AbstractManagedObjectDefinition<? extends C, ? extends S> d)
      throws IllegalArgumentException, ManagedObjectNotFoundException,
      AuthorizationException, CommunicationException;
            AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws IllegalArgumentException,
            ManagedObjectNotFoundException, AuthorizationException, CommunicationException;
  /**
   * Lists the child managed objects of the named parent managed
   * object which are a sub-type of the specified managed object
   * definition.
     * Lists the child managed objects of the named parent managed object which
     * are a sub-type of the specified managed object definition.
   *
   * @param <C>
   *          The type of client managed object configuration that the
@@ -617,60 +539,52 @@
   *          The set relation definition.
   * @param d
   *          The managed object definition.
   * @return Returns the names of the child managed objects which are
   *         a sub-type of the specified managed object definition.
     * @return Returns the names of the child managed objects which are a
     *         sub-type of the specified managed object definition.
   * @throws IllegalArgumentException
   *           If the relation definition is not associated with the
   *           parent managed object's definition.
     *             If the relation definition is not associated with the parent
     *             managed object's definition.
   * @throws ManagedObjectNotFoundException
   *           If the parent managed object could not be found.
   * @throws AuthorizationException
   *           If the server refuses to list the managed objects
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to list the managed objects because the
     *             client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public abstract <C extends ConfigurationClient, S extends Configuration>
  String[] listManagedObjects(
    public abstract <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects(
      ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd,
      AbstractManagedObjectDefinition<? extends C, ? extends S> d)
      throws IllegalArgumentException, ManagedObjectNotFoundException,
      AuthorizationException, CommunicationException;
            AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws IllegalArgumentException,
            ManagedObjectNotFoundException, AuthorizationException, CommunicationException;
  /**
   * Determines whether or not the named managed object exists.
   * <p>
   * Implementations should always return <code>true</code> when the
   * provided path is empty.
     * Implementations should always return <code>true</code> when the provided
     * path is empty.
   *
   * @param path
   *          The path of the named managed object.
   * @return Returns <code>true</code> if the named managed object
   *         exists, <code>false</code> otherwise.
     * @return Returns <code>true</code> if the named managed object exists,
     *         <code>false</code> otherwise.
   * @throws ManagedObjectNotFoundException
   *           If the parent managed object could not be found.
   * @throws AuthorizationException
   *           If the server refuses to make the determination because
   *           the client does not have the correct privileges.
     *             If the server refuses to make the determination because the
     *             client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  public abstract boolean managedObjectExists(ManagedObjectPath<?, ?> path)
      throws ManagedObjectNotFoundException, AuthorizationException,
      CommunicationException;
    public abstract boolean managedObjectExists(ManagedObjectPath<?, ?> path) throws ManagedObjectNotFoundException,
            AuthorizationException, CommunicationException;
  /**
   * Deletes the named managed object.
   * <p>
   * Implementations do not need check whether the named managed
   * object exists, nor do they need to enforce client constraints.
     * Implementations do not need check whether the named managed object
     * exists, nor do they need to enforce client constraints.
   *
   * @param <C>
   *          The type of client managed object configuration that the
@@ -683,22 +597,17 @@
   * @throws OperationRejectedException
   *           If the managed object cannot be removed due to some
   *           server-side constraint which cannot be satisfied (for
   *           example, if it is referenced by another managed
   *           object).
     *             example, if it is referenced by another managed object).
   * @throws AuthorizationException
   *           If the server refuses to remove the managed objects
   *           because the client does not have the correct
   *           privileges.
     *             If the server refuses to remove the managed objects because
     *             the client does not have the correct privileges.
   * @throws CommunicationException
   *           If the client cannot contact the server due to an
   *           underlying communication problem.
     *             If the client cannot contact the server due to an underlying
     *             communication problem.
   */
  protected abstract <C extends ConfigurationClient, S extends Configuration>
  void deleteManagedObject(
      ManagedObjectPath<C, S> path) throws OperationRejectedException,
      AuthorizationException, CommunicationException;
    protected abstract <C extends ConfigurationClient, S extends Configuration> void deleteManagedObject(
            ManagedObjectPath<C, S> path) throws OperationRejectedException, AuthorizationException,
            CommunicationException;
  /**
   * Gets the default values for the specified property.
@@ -710,32 +619,25 @@
   * @param pd
   *          The property definition.
   * @param isCreate
   *          Indicates whether the managed object has been created
   *          yet.
     *            Indicates whether the managed object has been created yet.
   * @return Returns the default values for the specified property.
   * @throws DefaultBehaviorException
   *           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 {
    protected final <PD> Collection<PD> findDefaultValues(ManagedObjectPath<?, ?> p, PropertyDefinition<PD> pd,
            boolean isCreate) throws DefaultBehaviorException {
    DefaultValueFinder<PD> v = new DefaultValueFinder<PD>(p, isCreate);
    return v.find(p, pd);
  }
  /**
   * Gets the management context associated with this driver.
   *
   * @return Returns the management context associated with this
   *         driver.
     * @return Returns the management context associated with this driver.
   */
  protected abstract ManagementContext getManagementContext();
  /**
   * Validate that a relation definition belongs to the managed object
   * referenced by the provided path.
@@ -745,29 +647,25 @@
   * @param rd
   *          The relation definition.
   * @throws IllegalArgumentException
   *           If the relation definition does not belong to the
   *           managed object definition.
     *             If the relation definition does not belong to the managed
     *             object definition.
   */
  protected final void validateRelationDefinition(ManagedObjectPath<?, ?> path,
      RelationDefinition<?, ?> rd) throws IllegalArgumentException {
    protected final void validateRelationDefinition(ManagedObjectPath<?, ?> path, RelationDefinition<?, ?> rd)
            throws IllegalArgumentException {
    AbstractManagedObjectDefinition<?, ?> d = path.getManagedObjectDefinition();
    RelationDefinition<?, ?> tmp = d.getRelationDefinition(rd.getName());
    if (tmp != rd) {
      throw new IllegalArgumentException("The relation " + rd.getName()
          + " is not associated with a " + d.getName());
            throw new IllegalArgumentException("The relation " + rd.getName() + " is not associated with a "
                    + d.getName());
    }
  }
  // Remove a managed object, first ensuring that the parent exists,
  // then ensuring that the child exists, before ensuring that any
  // constraints are satisfied.
  private <C extends ConfigurationClient, S extends Configuration>
  boolean doDeleteManagedObject(
      ManagedObjectPath<C, S> path) throws ManagedObjectNotFoundException,
      OperationRejectedException, AuthorizationException,
      CommunicationException {
    private <C extends ConfigurationClient, S extends Configuration> boolean doDeleteManagedObject(
            ManagedObjectPath<C, S> path) throws ManagedObjectNotFoundException, OperationRejectedException,
            AuthorizationException, CommunicationException {
    // First make sure that the parent exists.
    if (!managedObjectExists(path.parent())) {
      throw new ManagedObjectNotFoundException();
@@ -781,12 +679,11 @@
    // The targeted managed object is guaranteed to exist, so enforce
    // any constraints.
    AbstractManagedObjectDefinition<?, ?> d = path.getManagedObjectDefinition();
    List<Message> messages = new LinkedList<Message>();
        List<LocalizableMessage> messages = new LinkedList<LocalizableMessage>();
    boolean isAcceptable = true;
    for (Constraint constraint : d.getAllConstraints()) {
      for (ClientConstraintHandler handler : constraint
          .getClientConstraintHandlers()) {
            for (ClientConstraintHandler handler : constraint.getClientConstraintHandlers()) {
        ManagementContext context = getManagementContext();
        if (!handler.isDeleteAcceptable(context, path, messages)) {
          isAcceptable = false;
@@ -798,8 +695,7 @@
    }
    if (!isAcceptable) {
      throw new OperationRejectedException(OperationType.DELETE, d
          .getUserFriendlyName(), messages);
            throw new OperationRejectedException(OperationType.DELETE, d.getUserFriendlyName(), messages);
    }
    deleteManagedObject(path);