From 35af51f9683f5ef8cec66baca7b89aa1e1cbc44e Mon Sep 17 00:00:00 2001
From: coulbeck <coulbeck@localhost>
Date: Fri, 11 May 2007 23:27:30 +0000
Subject: [PATCH] Issue 1532: Remove ConfigEntry from Backend API. (DS-1532)

---
 opends/src/server/org/opends/server/tools/RestoreDB.java |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/opends/src/server/org/opends/server/tools/RestoreDB.java b/opends/src/server/org/opends/server/tools/RestoreDB.java
index cb9798a..a8f0d6d 100644
--- a/opends/src/server/org/opends/server/tools/RestoreDB.java
+++ b/opends/src/server/org/opends/server/tools/RestoreDB.java
@@ -36,7 +36,6 @@
 import java.util.List;
 
 import org.opends.server.api.Backend;
-import org.opends.server.config.ConfigEntry;
 import org.opends.server.config.ConfigException;
 import org.opends.server.core.CoreConfigManager;
 import org.opends.server.core.DirectoryServer;
@@ -65,7 +64,7 @@
 import static org.opends.server.util.StaticUtils.*;
 import org.opends.server.util.StaticUtils;
 import static org.opends.server.tools.ToolConstants.*;
-
+import org.opends.server.admin.std.server.BackendCfg;
 
 
 /**
@@ -231,8 +230,8 @@
     {
       try
       {
-        directoryServer.bootstrapClient();
-        directoryServer.initializeJMX();
+        DirectoryServer.bootstrapClient();
+        DirectoryServer.initializeJMX();
       }
       catch (Exception e)
       {
@@ -369,7 +368,7 @@
 
 
     // Open the backup directory and make sure it is valid.
-    BackupDirectory backupDir = null;
+    BackupDirectory backupDir;
     try
     {
       backupDir = BackupDirectory.readBackupDirectoryDescriptor(
@@ -454,7 +453,7 @@
 
     // If a backup ID was specified, then make sure it is valid.  If none was
     // provided, then choose the latest backup from the archive.
-    String backupID = null;
+    String backupID;
     if (backupIDString.isPresent())
     {
       backupID = backupIDString.getValue();
@@ -495,22 +494,20 @@
     // Get information about the backends defined in the server and determine
     // which to use for the restore.
     ArrayList<Backend>     backendList = new ArrayList<Backend>();
-    ArrayList<ConfigEntry> entryList   = new ArrayList<ConfigEntry>();
+    ArrayList<BackendCfg> entryList   = new ArrayList<BackendCfg>();
     ArrayList<List<DN>>    dnList      = new ArrayList<List<DN>>();
     BackendToolUtils.getBackends(backendList, entryList, dnList);
 
 
     Backend     backend     = null;
-    ConfigEntry configEntry = null;
     int         numBackends = backendList.size();
     for (int i=0; i < numBackends; i++)
     {
       Backend     b = backendList.get(i);
-      ConfigEntry e = entryList.get(i);
-      if (e.getDN().equals(configEntryDN))
+      BackendCfg e = entryList.get(i);
+      if (e.dn().equals(configEntryDN))
       {
         backend     = b;
-        configEntry = e;
         break;
       }
     }
@@ -568,7 +565,7 @@
     // Perform the restore.
     try
     {
-      backend.restoreBackup(configEntry, restoreConfig);
+      backend.restoreBackup(restoreConfig);
     }
     catch (DirectoryException de)
     {

--
Gitblit v1.10.0