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

gbellato
26.17.2007 5c47ab553c1fa329dbad90f5ecfd98b84e518cac
opendj-sdk/opends/src/server/org/opends/server/tasks/ImportTask.java
@@ -32,7 +32,6 @@
import static org.opends.server.loggers.debug.DebugLogger.debugCaught;
import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
import org.opends.server.types.DebugLogLevel;
import static org.opends.server.loggers.Error.logError;
import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.core.DirectoryServer.getAttributeType;
@@ -473,6 +472,11 @@
    DN[] baseDNs = new DN[defaultIncludeBranches.size()];
    defaultIncludeBranches.toArray(baseDNs);
    // Notify the task listeners that an import is going to start
    // this must be done before disabling the backend to allow
    // listeners to get access to the backend configuration
    // and to take appropriate actions.
    DirectoryServer.notifyImportBeginning(backend, importConfig);
    // Disable the backend.
    try
@@ -528,9 +532,7 @@
      // Launch the import.
      try
      {
        DirectoryServer.notifyImportBeginning(backend, importConfig);
        backend.importLDIF(configEntry, baseDNs, importConfig);
        DirectoryServer.notifyImportEnded(backend, importConfig, true);
      }
      catch (DirectoryException de)
      {
@@ -600,6 +602,10 @@
      try
      {
        TaskUtils.setBackendEnabled(configEntry, true);
        // It is necessary to retrieve the backend structure again
        // because disabling and enabling it again may have resulted
        // in a new backend being registered to the server.
        backend = DirectoryServer.getBackend(backendID);
      }
      catch (DirectoryException e)
      {
@@ -612,6 +618,7 @@
                 e.getErrorMessage(), e.getErrorMessageID());
        return TaskState.STOPPED_BY_ERROR;
      }
      DirectoryServer.notifyImportEnded(backend, importConfig, true);
    }