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

jvergara
10.07.2007 de6b43647b6a50cb786016d9b5593d6d7e0631de
Add two missing properties to the LDIF backend when it is created.
2 files modified
16 ■■■■ changed files
opends/src/ads/org/opends/admin/ads/ADSContext.java 9 ●●●●● patch | view | raw | blame | history
opends/src/ads/org/opends/admin/ads/ADSContextHelper.java 7 ●●●● patch | view | raw | blame | history
opends/src/ads/org/opends/admin/ads/ADSContext.java
@@ -2078,6 +2078,15 @@
    return "adminRoot";
  }
  /**
   * Returns the LDIF file of the administration data.
   * @return the LDIF file of the administration data.
   */
  public static String getAdminLDIFFile()
  {
    return "config/admin-backend.ldif";
  }
  /*
opends/src/ads/org/opends/admin/ads/ADSContextHelper.java
@@ -135,7 +135,7 @@
      String backendName)
  throws ADSContextException
  {
      try
    try
    {
      ManagementContext mCtx = LDAPManagementContext.createFromContext(
          JNDIDirContextAdaptor.adapt(ctx));
@@ -153,13 +153,16 @@
        throw new ADSContextException(
            ADSContextException.ErrorType.UNEXPECTED_ADS_BACKEND_TYPE, cce);
      }
      if (backend == null)
      {
        LDIFBackendCfgDefn provider = LDIFBackendCfgDefn.getInstance();
        backend = root.createBackend(provider, backendName, null);
        backend.setEnabled(true);
        backend.setLDIFFile(ADSContext.getAdminLDIFFile());
        backend.setBackendId(backendName);
        backend.setWritabilityMode(BackendCfgDefn.WritabilityMode.ENABLED);
        backend.setIsPrivateBackend(true);
      }
      SortedSet<DN> suffixes = backend.getBaseDN();
      if (suffixes == null)
@@ -167,7 +170,7 @@
        suffixes = new TreeSet<DN>();
      }
      DN newDN = DN.decode(ADSContext.getAdministrationSuffixDN());
      if (suffixes.contains(newDN))
      if (!suffixes.contains(newDN))
      {
        suffixes.add(newDN);
        backend.setBaseDN(suffixes);