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

matthew_swift
02.30.2007 1c67282f3df6ce5ae04d2c750367e52582e78d09
opends/src/server/org/opends/server/admin/client/ldap/LDAPDriver.java
@@ -119,7 +119,7 @@
      AuthorizationException, CommunicationException {
    validateRelationDefinition(parent, rd);
    if (!entryExists(parent)) {
    if (!managedObjectExists(parent)) {
      throw new ManagedObjectNotFoundException();
    }
@@ -140,7 +140,7 @@
      CommunicationException {
    validateRelationDefinition(parent, rd);
    if (!entryExists(parent)) {
    if (!managedObjectExists(parent)) {
      throw new ManagedObjectNotFoundException();
    }
@@ -158,7 +158,7 @@
      ManagedObjectPath<C, S> path) throws DefinitionDecodingException,
      ManagedObjectDecodingException, ManagedObjectNotFoundException,
      AuthorizationException, CommunicationException {
    if (!entryExists(path)) {
    if (!managedObjectExists(path)) {
      throw new ManagedObjectNotFoundException();
    }
@@ -232,7 +232,7 @@
      DefinitionDecodingException, AuthorizationException,
      ManagedObjectNotFoundException, CommunicationException,
      PropertyException {
    if (!entryExists(path)) {
    if (!managedObjectExists(path)) {
      throw new ManagedObjectNotFoundException();
    }
@@ -290,26 +290,6 @@
   */
  @Override
  public <C extends ConfigurationClient, S extends Configuration>
  boolean hasManagedObject(
      ManagedObjectPath<?, ?> parent, OptionalRelationDefinition<C, S> rd)
      throws IllegalArgumentException, ManagedObjectNotFoundException,
      AuthorizationException, CommunicationException {
    validateRelationDefinition(parent, rd);
    if (!entryExists(parent)) {
      throw new ManagedObjectNotFoundException();
    }
    return entryExists(parent.child(rd));
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public <C extends ConfigurationClient, S extends Configuration>
  String[] listManagedObjects(
      ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd,
      AbstractManagedObjectDefinition<? extends C, ? extends S> d)
@@ -317,7 +297,7 @@
      AuthorizationException, CommunicationException {
    validateRelationDefinition(parent, rd);
    if (!entryExists(parent)) {
    if (!managedObjectExists(parent)) {
      throw new ManagedObjectNotFoundException();
    }
@@ -351,6 +331,29 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public boolean managedObjectExists(ManagedObjectPath<?, ?> path)
      throws ManagedObjectNotFoundException, AuthorizationException,
      CommunicationException {
    if (path.isEmpty()) {
      return true;
    }
    ManagedObjectPath<?,?> parent = path.parent();
    LdapName dn = LDAPNameBuilder.create(parent, profile);
    if (!entryExists(dn)) {
      throw new ManagedObjectNotFoundException();
    }
    dn = LDAPNameBuilder.create(path, profile);
    return entryExists(dn);
  }
  /**
   * Adapts a naming exception to an appropriate admin client
   * exception.
   *
@@ -499,20 +502,6 @@
  // Determines whether the LDAP entry associated with the managed
  // object path exists.
  private boolean entryExists(ManagedObjectPath<?, ?> path)
      throws CommunicationException, AuthorizationException {
    if (path.isEmpty()) {
      return true;
    }
    LdapName dn = LDAPNameBuilder.create(path, profile);
    return entryExists(dn);
  }
  // Determine the type of managed object associated with the named
  // entry.
  private <C extends ConfigurationClient, S extends Configuration>
@@ -561,7 +550,7 @@
  private boolean removeManagedObject(ManagedObjectPath<?, ?> path)
      throws CommunicationException, AuthorizationException,
      OperationRejectedException, ManagedObjectNotFoundException {
    if (!entryExists(path)) {
    if (!managedObjectExists(path)) {
      return false;
    }