From 83e546caf028133b97f01534b9fab108bd44910b Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Fri, 22 May 2015 13:24:06 +0000
Subject: [PATCH] OPENDJ-1932 Code cleanup

---
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java
index 26a396d..68e9879 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java
@@ -110,6 +110,7 @@
 import org.opends.server.tools.makeldif.MakeLDIF;
 import org.opends.server.types.DN;
 import org.opends.server.types.OpenDsException;
+import org.opends.server.util.RemoveOnceNewConfigFrameworkIsUsed;
 import org.opends.server.util.SetupUtils;
 
 import com.forgerock.opendj.cli.CommandBuilder;
@@ -968,16 +969,7 @@
         return;
       }
 
-      //FIXME GB This could be replaced by a call to BackendCreationHelper.createBackend(...)
-      // once the new configuration framework migration will be done
-      final RootCfgClient root = getRootConfigurationClient();
-      final BackendCfgClient backend =
-          root.createBackend(getSelectedBackendType().getLegacyConfigurationFrameworkBackend(), backendName, null);
-      backend.setEnabled(true);
-      backend.setBaseDN(Collections.singleton(DN.valueOf(newBaseDN)));
-      backend.setBackendId(backendName);
-      backend.setWritabilityMode(BackendCfgDefn.WritabilityMode.ENABLED);
-      backend.commit();
+      createBackendOnline(backendName);
     }
 
     private void createBackendOffline(String backendName) throws OpenDsException
@@ -993,6 +985,19 @@
       }
     }
 
+    @RemoveOnceNewConfigFrameworkIsUsed("Use BackendCreationHelper.createBackend(...)")
+    private void createBackendOnline(String backendName) throws OpenDsException
+    {
+      final RootCfgClient root = getRootConfigurationClient();
+      final BackendCfgClient backend =
+          root.createBackend(getSelectedBackendType().getLegacyConfigurationFrameworkBackend(), backendName, null);
+      backend.setEnabled(true);
+      backend.setBaseDN(Collections.singleton(DN.valueOf(newBaseDN)));
+      backend.setBackendId(backendName);
+      backend.setWritabilityMode(BackendCfgDefn.WritabilityMode.ENABLED);
+      backend.commit();
+    }
+
     private RootCfgClient getRootConfigurationClient()
     {
       final JNDIDirContextAdaptor jndiContext = JNDIDirContextAdaptor.adapt(getInfo().getDirContext());

--
Gitblit v1.10.0