From 5d0ceeba98f7bfd2cf17a1f2970e4c8be3130388 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Sun, 26 Aug 2007 17:43:55 +0000
Subject: [PATCH] Fix for issues 2104 and 2162.

---
 opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromLDAP.java |   80 ---------------------------------------
 1 files changed, 1 insertions(+), 79 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromLDAP.java b/opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromLDAP.java
index ee770d6..b4bd6a3 100644
--- a/opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromLDAP.java
+++ b/opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromLDAP.java
@@ -124,7 +124,7 @@
     this.trustManager = trustManager;
     this.offlineConf = offlineConf;
     this.policy = policy;
-    String ldapUrl = getURL(offlineConf, policy);
+    String ldapUrl = offlineConf.getURL(policy);
 
     if (!Utils.areDnsEqual(dn, this.dn) ||
         !pwd.equals(this.pwd) ||
@@ -1003,82 +1003,4 @@
   {
     return ConfigFromFile.isConfigBackend(id);
   }
-
-  private String getURL(ConfigFromFile offlineConf,
-      ConnectionProtocolPolicy policy) throws ConfigException
-  {
-    String url;
-    String ldapUrl = offlineConf.getLDAPURL();
-    String startTlsUrl = offlineConf.getStartTLSURL();
-    String ldapsUrl = offlineConf.getLDAPSURL();
-    switch (policy)
-    {
-    case USE_STARTTLS:
-      if (startTlsUrl != null)
-      {
-        url = startTlsUrl;
-      }
-      else
-      {
-        throw new ConfigException(ERR_COULD_NOT_FIND_VALID_LDAPURL.get());
-      }
-      break;
-    case USE_LDAPS:
-      if (ldapsUrl != null)
-      {
-        url = ldapsUrl;
-      }
-      else
-      {
-        throw new ConfigException(ERR_COULD_NOT_FIND_VALID_LDAPURL.get());
-      }
-      break;
-    case USE_LDAP:
-      if (ldapUrl != null)
-      {
-        url = ldapUrl;
-      }
-      else
-      {
-        throw new ConfigException(ERR_COULD_NOT_FIND_VALID_LDAPURL.get());
-      }
-      break;
-    case USE_MOST_SECURE_AVAILABLE:
-      if (ldapsUrl != null)
-      {
-        url = ldapsUrl;
-      }
-      else if (startTlsUrl != null)
-      {
-        url = startTlsUrl;
-      }
-      else if (ldapUrl != null)
-      {
-        url = ldapUrl;
-      }
-      else
-      {
-        throw new ConfigException(ERR_COULD_NOT_FIND_VALID_LDAPURL.get());
-      }
-      break;
-    case USE_LESS_SECURE_AVAILABLE:
-      if (ldapUrl != null)
-      {
-        url = ldapUrl;
-      }
-      else if (ldapsUrl != null)
-      {
-        url = ldapsUrl;
-      }
-      else
-      {
-        throw new ConfigException(ERR_COULD_NOT_FIND_VALID_LDAPURL.get());
-      }
-      break;
-      default:
-        throw new IllegalStateException("Unknown connection policy: "+
-            policy);
-    }
-    return url;
-  }
 }

--
Gitblit v1.10.0