From 0df071f4aab05eb5aee458d2aafb48c0dc65b309 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Mon, 21 Jan 2008 12:10:39 +0000
Subject: [PATCH] Fix issues 2831 and 1948.

---
 opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java |   48 ++++++++++++++++++++++++++++++------------------
 1 files changed, 30 insertions(+), 18 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
index bbdb7a8..f1fc614 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/BackendImpl.java
@@ -119,8 +119,8 @@
   /**
    * A list of monitor providers created for this backend instance.
    */
-  private ArrayList<MonitorProvider> monitorProviders =
-      new ArrayList<MonitorProvider>();
+  private ArrayList<MonitorProvider<?>> monitorProviders =
+      new ArrayList<MonitorProvider<?>>();
 
   /**
    * The base DNs defined for this backend instance.
@@ -132,13 +132,6 @@
    */
   private static HashSet<String> supportedControls;
 
-  /**
-   * The features supported by this backend.
-   */
-  private static HashSet<String> supportedFeatures = new HashSet<String>(0);
-
-
-
   static
   {
     // Set our supported controls.
@@ -150,6 +143,18 @@
     supportedControls.add(OID_VLV_REQUEST_CONTROL);
   }
 
+  /**
+   * The features supported by this backend.
+   */
+  private static HashSet<String> supportedFeatures;
+
+  static {
+    // Set our supported features.
+    supportedFeatures = new HashSet<String>();
+
+    //NYI
+  }
+
 
 
   /**
@@ -226,7 +231,9 @@
    */
   private long checksumDbEnv() {
 
-    File backendDirectory = getFileForPath(cfg.getDBDirectory());
+    File parentDirectory = getFileForPath(cfg.getDBDirectory());
+    File backendDirectory = new File(parentDirectory, cfg.getBackendId());
+
     List<File> jdbFiles = new ArrayList<File>();
     if(backendDirectory.isDirectory())
     {
@@ -391,12 +398,12 @@
     }
 
     // Deregister our monitor providers.
-    for (MonitorProvider monitor : monitorProviders)
+    for (MonitorProvider<?> monitor : monitorProviders)
     {
       DirectoryServer.deregisterMonitorProvider(
            monitor.getMonitorInstanceName().toLowerCase());
     }
-    monitorProviders = new ArrayList<MonitorProvider>();
+    monitorProviders = new ArrayList<MonitorProvider<?>>();
 
     // We presume the server will prevent more operations coming into this
     // backend, but there may be existing operations already in the
@@ -561,7 +568,7 @@
   @Override()
   public HashSet<String> getSupportedFeatures()
   {
-    return new HashSet<String>();  //NYI
+    return supportedFeatures;
   }
 
 
@@ -1179,8 +1186,8 @@
         // environment and re-open it. Only do this when we are
         // importing to all the base DNs in the backend or if the backend only
         // have one base DN.
-
-        File backendDirectory = getFileForPath(cfg.getDBDirectory());
+        File parentDirectory = getFileForPath(cfg.getDBDirectory());
+        File backendDirectory = new File(parentDirectory, cfg.getBackendId());
         EnvManager.removeFiles(backendDirectory.getPath());
         envConfig.setReadOnly(false);
         envConfig.setAllowCreate(true);
@@ -1440,7 +1447,9 @@
   {
     BackupManager backupManager =
         new BackupManager(getBackendID());
-    backupManager.createBackup(cfg, backupConfig);
+    File parentDir = getFileForPath(cfg.getDBDirectory());
+    File backendDir = new File(parentDir, cfg.getBackendId());
+    backupManager.createBackup(backendDir, backupConfig);
   }
 
 
@@ -1468,7 +1477,9 @@
   {
     BackupManager backupManager =
         new BackupManager(getBackendID());
-    backupManager.restoreBackup(cfg, restoreConfig);
+    File parentDir = getFileForPath(cfg.getDBDirectory());
+    File backendDir = new File(parentDir, cfg.getBackendId());
+    backupManager.restoreBackup(backendDir, restoreConfig);
   }
 
 
@@ -1656,7 +1667,8 @@
       throws ConfigException, JebException
   {
     // Determine the backend database directory.
-    File backendDirectory = getFileForPath(cfg.getDBDirectory());
+    File parentDirectory = getFileForPath(cfg.getDBDirectory());
+    File backendDirectory = new File(parentDirectory, cfg.getBackendId());
     EnvManager.removeFiles(backendDirectory.getPath());
   }
 

--
Gitblit v1.10.0