From 01bf9b6a5d324d45355659581e9ebbd1280834fe Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 25 Apr 2016 14:41:26 +0000
Subject: [PATCH] Improvements suggested by UCDetector: remove dead code, add final keywords, change visibilities
---
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/InstallerHelper.java | 54 ++----------------------------------------------------
1 files changed, 2 insertions(+), 52 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 7318f2c..54c3c2b 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
@@ -301,29 +301,6 @@
}
/**
- * Deletes a backend on the server.
- * @param connWrapper the connection to the server.
- * @param backendName the name of the backend to be deleted.
- * @param serverDisplay the server display.
- * @throws ApplicationException if something goes wrong.
- */
- public void deleteBackend(ConnectionWrapper connWrapper, String backendName, String serverDisplay)
- throws ApplicationException
- {
- try
- {
- connWrapper.getRootConfiguration().removeBackend(backendName);
- }
- catch (Throwable t)
- {
- throw new ApplicationException(
- ReturnCode.CONFIGURATION_ERROR,
- INFO_ERROR_CONFIGURING_REMOTE_GENERIC.get(serverDisplay, t),
- t);
- }
- }
-
- /**
* Deletes a backend on the server. It assumes the server is stopped.
* @param backendName the name of the backend to be deleted.
* @throws ApplicationException if something goes wrong.
@@ -367,7 +344,7 @@
RootCfgClient root = conn.getRootConfiguration();
BackendCfgClient backend = root.createBackend(backendType, backendName, null);
backend.setEnabled(true);
- backend.setBaseDN(toByteStrings(baseDNs));
+ backend.setBaseDN(toDNs(baseDNs));
backend.setBackendId(backendName);
backend.setWritabilityMode(BackendCfgDefn.WritabilityMode.ENABLED);
backend.commit();
@@ -379,7 +356,7 @@
}
}
- private Set<DN> toByteStrings(Set<String> strings) throws DirectoryException
+ private Set<DN> toDNs(Set<String> strings) throws DirectoryException
{
Set<DN> results = new HashSet<>();
for (String s : strings)
@@ -390,33 +367,6 @@
}
/**
- * Sets the base DNs on a given backend.
- * @param connWrapper the connection to the server.
- * @param backendName the name of the backend where the base Dns must be
- * defined.
- * @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 setBaseDns(ConnectionWrapper connWrapper, String backendName, Set<String> baseDNs, String serverDisplay)
- throws ApplicationException
- {
- try
- {
- BackendCfgClient backend = connWrapper.getRootConfiguration().getBackend(backendName);
- backend.setBaseDN(toByteStrings(baseDNs));
- backend.commit();
- }
- catch (Throwable t)
- {
- throw new ApplicationException(
- ReturnCode.CONFIGURATION_ERROR,
- INFO_ERROR_CONFIGURING_REMOTE_GENERIC.get(serverDisplay, t),
- t);
- }
- }
-
- /**
* Configures the replication on a given server.
* @param conn the connection to the server where we want to configure
* the replication.
--
Gitblit v1.10.0