From ccd66a6d38f7d3a55a4fddd2945d8ab8920b007e Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Mon, 07 Nov 2016 15:05:30 +0000
Subject: [PATCH] OPENDJ-3417 Move management of backends and listeners from DirectoryServer to BackendConfigManager

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/ConfigurationBackend.java |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/ConfigurationBackend.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/ConfigurationBackend.java
index 62866be..96ec891 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/ConfigurationBackend.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/ConfigurationBackend.java
@@ -50,7 +50,6 @@
 import org.opends.server.config.ConfigurationHandler;
 import org.opends.server.core.AddOperation;
 import org.opends.server.core.DeleteOperation;
-import org.opends.server.core.DirectoryServer;
 import org.opends.server.core.ModifyDNOperation;
 import org.opends.server.core.ModifyOperation;
 import org.opends.server.core.SearchOperation;
@@ -192,6 +191,9 @@
    */
   private final Object configLock = new Object();
 
+  /** The server context. */
+  private final ServerContext serverContext;
+
   /**
    * Creates and initializes a new instance of this backend.
    *
@@ -205,6 +207,7 @@
   public ConfigurationBackend(ServerContext serverContext, ConfigurationHandler configurationHandler)
       throws InitializationException
   {
+    this.serverContext = serverContext;
     this.configurationHandler = configurationHandler;
     this.configRootEntry = Converters.to(configurationHandler.getRootEntry());
     baseDNs = Collections.singleton(configRootEntry.getName());
@@ -227,7 +230,7 @@
   {
     try
     {
-      DirectoryServer.deregisterBaseDN(configRootEntry.getName());
+      serverContext.getBackendConfigManager().deregisterBaseDN(configRootEntry.getName());
     }
     catch (Exception e)
     {
@@ -247,7 +250,7 @@
     DN baseDN = configRootEntry.getName();
     try
     {
-      DirectoryServer.registerBaseDN(baseDN, this, true);
+      serverContext.getBackendConfigManager().registerBaseDN(baseDN, this, true);
     }
     catch (DirectoryException e)
     {

--
Gitblit v1.10.0