| | |
| | | // Get the DN of the backend configuration entry from the backup. |
| | | DN configEntryDN = backupDir.getConfigEntryDN(); |
| | | |
| | | // Get the backend configuration entry. |
| | | ConfigEntry configEntry; |
| | | try |
| | | { |
| | | // Get the backend configuration entry. |
| | | configEntry = DirectoryServer.getConfigEntry(configEntryDN); |
| | | } |
| | | catch (ConfigException e) |
| | |
| | | // Disable the backend. |
| | | try |
| | | { |
| | | TaskUtils.setBackendEnabled(configEntry, false); |
| | | TaskUtils.disableBackend(backendID); |
| | | } |
| | | catch (DirectoryException e) |
| | | { |
| | |
| | | // Perform the restore. |
| | | try |
| | | { |
| | | backend.restoreBackup(configEntry, restoreConfig); |
| | | backend.restoreBackup(restoreConfig); |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | |
| | | // Enable the backend. |
| | | try |
| | | { |
| | | TaskUtils.setBackendEnabled(configEntry, true); |
| | | TaskUtils.enableBackend(backendID); |
| | | // 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. |