From d0d27dbc1cd64b2ef276a3b280b21d9d6e1081db Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Fri, 22 May 2015 08:34:57 +0000
Subject: [PATCH] OPENDJ-2017 Code cleanup

---
 opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/InstallerHelper.java |   37 ++++++++++++++++++-------------------
 1 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/InstallerHelper.java b/opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/InstallerHelper.java
index 66edee4..6013883 100644
--- a/opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/InstallerHelper.java
+++ b/opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/InstallerHelper.java
@@ -53,14 +53,15 @@
 import java.util.Set;
 import java.util.TreeSet;
 
+import javax.naming.directory.DirContext;
 import javax.naming.ldap.InitialLdapContext;
 
 import org.forgerock.i18n.LocalizableMessage;
 import org.forgerock.i18n.slf4j.LocalizedLogger;
 import org.forgerock.opendj.config.server.ConfigException;
 import org.opends.guitools.controlpanel.util.Utilities;
-import org.opends.messages.CoreMessages;
 import org.opends.messages.BackendMessages;
+import org.opends.messages.CoreMessages;
 import org.opends.messages.ReplicationMessages;
 import org.opends.quicksetup.Application;
 import org.opends.quicksetup.ApplicationException;
@@ -363,26 +364,26 @@
 
   /**
    * Creates a local database backend on the server.
-   * @param ctx the connection to the server.
-   * @param backendName the name of the backend to be created.
-   * @param baseDNs the list of base DNs to be defined on the server.
-   * @param serverDisplay the server display.
-   * @throws ApplicationException if something goes wrong.
+   *
+   * @param ctx
+   *          the connection to the server.
+   * @param backendName
+   *          the name of the backend to be created.
+   * @param baseDNs
+   *          the list of base DNs to be defined on the server.
+   * @param serverDisplay
+   *          the server display.
+   * @throws ApplicationException
+   *           if something goes wrong.
    */
-  public void createLocalDBBackend(InitialLdapContext ctx,
-      String backendName,
-      Set<String> baseDNs,
-      String serverDisplay)
-  throws ApplicationException
+  public void createLocalDBBackend(DirContext ctx, String backendName, Set<String> baseDNs, String serverDisplay)
+      throws ApplicationException
   {
     try
     {
-      ManagementContext mCtx = LDAPManagementContext.createFromContext(
-          JNDIDirContextAdaptor.adapt(ctx));
+      ManagementContext mCtx = LDAPManagementContext.createFromContext(JNDIDirContextAdaptor.adapt(ctx));
       RootCfgClient root = mCtx.getRootConfiguration();
-      LocalDBBackendCfgDefn provider = LocalDBBackendCfgDefn.getInstance();
-      LocalDBBackendCfgClient backend = root.createBackend(provider,
-          backendName, null);
+      LocalDBBackendCfgClient backend = root.createBackend(LocalDBBackendCfgDefn.getInstance(), backendName, null);
       backend.setEnabled(true);
       Set<DN> setBaseDNs = new HashSet<DN>();
       for (String baseDN : baseDNs)
@@ -397,9 +398,7 @@
     catch (Throwable t)
     {
       throw new ApplicationException(
-          ReturnCode.CONFIGURATION_ERROR,
-          INFO_ERROR_CONFIGURING_REMOTE_GENERIC.get(serverDisplay, t),
-          t);
+          ReturnCode.CONFIGURATION_ERROR, INFO_ERROR_CONFIGURING_REMOTE_GENERIC.get(serverDisplay, t), t);
     }
   }
 

--
Gitblit v1.10.0