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

neil_a_wilson
05.41.2006 5be072c20e46f0921bb00401ff26d0defb3e8991
opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
@@ -63,6 +63,7 @@
import org.opends.server.types.ResultCode;
import org.opends.server.util.LDIFException;
import static org.opends.server.messages.BackendMessages.*;
import static org.opends.server.messages.MessageHandler.*;
import static org.opends.server.messages.JebMessages.*;
import static org.opends.server.loggers.Error.logError;
@@ -293,10 +294,21 @@
    config = new Config();
    config.initializeConfig(configEntry, baseDNs);
    // FIXME: Currently assuming every base DN is also a suffix.
    for (DN dn : baseDNs)
    {
      DirectoryServer.registerSuffix(dn, this);
      try
      {
        DirectoryServer.registerBaseDN(dn, this, false, false);
      }
      catch (Exception e)
      {
        assert debugException(CLASS_NAME, "initializeBackend", e);
        int    msgID   = MSGID_BACKEND_CANNOT_REGISTER_BASEDN;
        String message = getMessage(msgID, String.valueOf(dn),
                                    String.valueOf(e));
        throw new InitializationException(msgID, message, e);
      }
    }
/*
@@ -402,9 +414,9 @@
    {
      try
      {
        DirectoryServer.deregisterSuffix(dn);
        DirectoryServer.deregisterBaseDN(dn, false);
      }
      catch (ConfigException e)
      catch (Exception e)
      {
        assert debugException(CLASS_NAME, "finalizeBackend", e);
      }
@@ -571,23 +583,6 @@
  /**
   * Indicates whether this backend supports the specified feature.
   *
   * @param featureOID The OID of the feature for which to make the
   *                   determination.
   * @return <CODE>true</CODE> if this backend does support the requested
   *         feature, or <CODE>false</CODE>
   */
  public boolean supportsFeature(String featureOID)
  {
    assert debugEnter(CLASS_NAME, "supportsFeature");
    return false;  //NYI
  }
  /**
   * Retrieves the OIDs of the controls that may be supported by this backend.
   *
   * @return The OIDs of the controls that may be supported by this backend.
@@ -602,23 +597,6 @@
  /**
   * Indicates whether this backend supports the specified control.
   *
   * @param controlOID The OID of the control for which to make the
   *                   determination.
   * @return <CODE>true</CODE> if this backend does support the requested
   *         control, or <CODE>false</CODE>
   */
  public boolean supportsControl(String controlOID)
  {
    assert debugEnter(CLASS_NAME, "supportsControl");
    return supportedControls.contains(controlOID);
  }
  /**
   * Retrieves the set of base-level DNs that may be used within this backend.
   *
   * @return The set of base-level DNs that may be used within this backend.
@@ -1365,6 +1343,8 @@
    assert debugEnter(CLASS_NAME, "applyNewConfiguration");
    ConfigChangeResult ccr;
    ResultCode resultCode = ResultCode.SUCCESS;
    ArrayList<String> messages = new ArrayList<String>();
    try
    {
@@ -1397,7 +1377,7 @@
          // Even though access to the entry container map is safe, there may be
          // operation threads with a handle on the entry container being
          // closed.
          DirectoryServer.deregisterSuffix(baseDN);
          DirectoryServer.deregisterBaseDN(baseDN, false);
          rootContainer.removeEntryContainer(baseDN);
        }
      }
@@ -1406,9 +1386,24 @@
      {
        if (!rootContainer.getBaseDNs().contains(baseDN))
        {
          // The base DN was added.
          rootContainer.openEntryContainer(baseDN);
          DirectoryServer.registerSuffix(baseDN, this);
          try
          {
            // The base DN was added.
            rootContainer.openEntryContainer(baseDN);
            DirectoryServer.registerBaseDN(baseDN, this, false, false);
          }
          catch (Exception e)
          {
            assert debugException(CLASS_NAME, "applyNewConfiguration", e);
            resultCode = DirectoryServer.getServerErrorResultCode();
            int msgID   = MSGID_BACKEND_CANNOT_REGISTER_BASEDN;
            messages.add(getMessage(msgID, String.valueOf(baseDN),
                                    String.valueOf(e)));
            ccr = new ConfigChangeResult(resultCode, false, messages);
            return ccr;
          }
        }
      }
@@ -1420,14 +1415,13 @@
    }
    catch (Exception e)
    {
      ArrayList<String> messages = new ArrayList<String>();
      messages.add(e.getMessage());
      ccr = new ConfigChangeResult(DirectoryServer.getServerErrorResultCode(),
                                   false, messages);
      return ccr;
    }
    ccr = new ConfigChangeResult(ResultCode.SUCCESS, false);
    ccr = new ConfigChangeResult(resultCode, false, messages);
    return ccr;
  }