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

coulbeck
30.38.2007 4a261fe8cd3300751284740534c91099604198f6
opends/src/server/org/opends/server/backends/SchemaBackend.java
@@ -246,12 +246,19 @@
  }
  /**
   * {@inheritDoc}
   * Initialization shared by multiple backend methods.
   * @param  configEntry  The configuration entry that contains the
   *                      information to use to initialize this
   *                      backend.
   * @param  baseDNs      The set of base DNs that have been
   *                      configured for this backend.
   * @throws  ConfigException  If an unrecoverable problem arises in
   *                           the process of performing the
   *                           initialization.
   */
  public void initializeBackend(ConfigEntry configEntry, DN[] baseDNs)
         throws ConfigException, InitializationException
  private void initializeCommon(ConfigEntry configEntry, DN[] baseDNs)
       throws ConfigException
  {
    // Make sure that a configuration entry was provided.  If not, then we will
    // not be able to complete initialization.
@@ -262,8 +269,8 @@
      throw new ConfigException(msgID, message);
    }
    configEntryDN = configEntry.getDN();
    SchemaBackendCfg cfg = getSchemaBackendCfg(configEntry);
    configEntryDN = configEntry.getDN();
    // Get all of the attribute types that we will use for schema elements.
    attributeTypesType =
@@ -295,6 +302,27 @@
    modifyTimestampType =
         DirectoryServer.getAttributeType(OP_ATTR_MODIFY_TIMESTAMP_LC, true);
    // Construct the set of objectclasses to include in the schema entry.
    schemaObjectClasses = new LinkedHashMap<ObjectClass,String>(3);
    schemaObjectClasses.put(DirectoryServer.getTopObjectClass(), OC_TOP);
    ObjectClass subentryOC = DirectoryServer.getObjectClass(OC_LDAP_SUBENTRY_LC,
                                                            true);
    schemaObjectClasses.put(subentryOC, OC_LDAP_SUBENTRY);
    ObjectClass subschemaOC = DirectoryServer.getObjectClass(OC_SUBSCHEMA,
                                                             true);
    schemaObjectClasses.put(subschemaOC, OC_SUBSCHEMA);
    // Define empty sets for the supported controls and features.
    supportedControls = new HashSet<String>(0);
    supportedFeatures = new HashSet<String>(0);
    configEntryDN = configEntry.getDN();
    this.baseDNs = baseDNs;
    creatorsName  = new AttributeValue(creatorsNameType, baseDNs[0].toString());
    modifiersName =
         new AttributeValue(modifiersNameType, baseDNs[0].toString());
@@ -340,9 +368,20 @@
    showAllAttributes = cfg.isShowAllAttributes();
    currentConfig = cfg;
  }
  /**
   * {@inheritDoc}
   */
  public void initializeBackend(ConfigEntry configEntry, DN[] baseDNs)
         throws ConfigException, InitializationException
  {
    initializeCommon(configEntry, baseDNs);
    // Register each of the suffixes with the Directory Server.  Also, register
    // the first one as the schema base.
    this.baseDNs = baseDNs;
    DirectoryServer.setSchemaDN(baseDNs[0]);
    for (int i=0; i < baseDNs.length; i++)
    {
@@ -365,24 +404,6 @@
    }
    // Construct the set of objectclasses to include in the schema entry.
    schemaObjectClasses = new LinkedHashMap<ObjectClass,String>(3);
    schemaObjectClasses.put(DirectoryServer.getTopObjectClass(), OC_TOP);
    ObjectClass subentryOC = DirectoryServer.getObjectClass(OC_LDAP_SUBENTRY_LC,
                                                            true);
    schemaObjectClasses.put(subentryOC, OC_LDAP_SUBENTRY);
    ObjectClass subschemaOC = DirectoryServer.getObjectClass(OC_SUBSCHEMA,
                                                             true);
    schemaObjectClasses.put(subschemaOC, OC_SUBSCHEMA);
    // Define an empty sets for the supported controls and features.
    supportedControls = new HashSet<String>(0);
    supportedFeatures = new HashSet<String>(0);
    // Identify any differences that may exist between the concatenated schema
    // file from the last online modification and the current schema files.  If
    // there are any differences, then they should be from making changes to the
@@ -494,8 +515,7 @@
    // Register with the Directory Server as a configurable component.
    currentConfig = cfg;
    cfg.addSchemaChangeListener(this);
    currentConfig.addSchemaChangeListener(this);
  }
@@ -4134,6 +4154,16 @@
                         LDIFExportConfig exportConfig)
         throws DirectoryException
  {
    try
    {
      initializeCommon(configEntry, baseDNs);
    }
    catch (ConfigException e)
    {
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
                                   e.getMessage(), e.getMessageID());
    }
    // Create the LDIF writer.
    LDIFWriter ldifWriter;
    try