From 609077ed606e3b094e303f298e8dca10567bc3e2 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 05 Aug 2016 18:42:07 +0000
Subject: [PATCH] Partial OPENDJ-2625 Convert all code that uses JNDI to use the SDK instead
---
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/AuthenticationData.java | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/AuthenticationData.java b/opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/AuthenticationData.java
index 7f689c7..5414f5a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/AuthenticationData.java
+++ b/opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/AuthenticationData.java
@@ -16,7 +16,10 @@
*/
package org.opends.quicksetup.installer;
+import static org.opends.admin.ads.util.PreferredConnection.Type.*;
+
import org.forgerock.opendj.ldap.DN;
+import org.opends.admin.ads.util.PreferredConnection.Type;
import org.opends.server.types.HostPort;
/**
@@ -30,7 +33,7 @@
private HostPort hostPort = new HostPort(null, 0);
private DN dn;
private String pwd;
- private boolean useSecureConnection;
+ private Type connectionType;
/**
* Sets the server LDAP port.
@@ -106,12 +109,11 @@
/**
* Returns whether to use a secure connection or not.
- * @return <CODE>true</CODE> if we must use a secure connection and
- * <CODE>false</CODE> otherwise.
+ * @return {@code true} if we must use a secure connection, {@code false} otherwise.
*/
public boolean useSecureConnection()
{
- return useSecureConnection;
+ return connectionType == LDAPS;
}
/**
@@ -120,13 +122,11 @@
*/
public void setUseSecureConnection(boolean useSecureConnection)
{
- this.useSecureConnection = useSecureConnection;
+ connectionType = useSecureConnection ? LDAPS : LDAP;
}
- String getLdapUrl()
+ Type getConnectionType()
{
- HostPort hostPort = getHostPort();
- String scheme = useSecureConnection() ? "ldaps" : "ldap";
- return scheme + "://" + hostPort.getHost() + ":" + hostPort.getPort();
+ return connectionType;
}
}
--
Gitblit v1.10.0