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

matthew_swift
12.12.2007 7b618f78599b78c4b9085b938dd84a30fa5dc1a9
Handle special case where the requested managed object is the root configuration.
3 files modified
18 ■■■■ changed files
opends/src/server/org/opends/server/admin/client/ManagementContext.java 6 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/admin/client/spi/Driver.java 6 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/admin/server/ServerManagementContext.java 6 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/admin/client/ManagementContext.java
@@ -183,11 +183,17 @@
   *           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 {
    // Be careful to handle the root configuration.
    if (path.isEmpty()) {
      return (ManagedObject<C>) getRootConfigurationManagedObject();
    }
    return getDriver().getManagedObject(path);
  }
opends/src/server/org/opends/server/admin/client/spi/Driver.java
@@ -390,7 +390,9 @@
  /**
   * Gets the named managed object.
   * 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
@@ -399,7 +401,7 @@
   *          The type of server managed object configuration that the
   *          path definition refers to.
   * @param path
   *          The path of the managed object.
   *          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
opends/src/server/org/opends/server/admin/server/ServerManagementContext.java
@@ -449,9 +449,15 @@
   *           If the named managed object could not be found or if it
   *           could not be decoded.
   */
  @SuppressWarnings("unchecked")
  public <C extends ConfigurationClient, S extends Configuration>
  ServerManagedObject<? extends S> getManagedObject(
      ManagedObjectPath<C, S> path) throws ConfigException {
    // Be careful to handle the root configuration.
    if (path.isEmpty()) {
      return (ServerManagedObject<S>) getRootConfigurationManagedObject();
    }
    // Get the configuration entry.
    DN targetDN = DNBuilder.create(path);
    ConfigEntry configEntry = getManagedObjectConfigEntry(targetDN);