From e38f6f28245cc16aa183e923039dfaef931080c3 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Sun, 26 Jul 2009 22:25:18 +0000
Subject: [PATCH] dsreplication allowed an infinite number of password tries for the administrator.  This is inconsistent with what is done elsewhere.

---
 opendj-sdk/opends/src/ads/org/opends/admin/ads/util/PreferredConnection.java |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/opendj-sdk/opends/src/ads/org/opends/admin/ads/util/PreferredConnection.java b/opendj-sdk/opends/src/ads/org/opends/admin/ads/util/PreferredConnection.java
index 5b8b5ed..f856354 100644
--- a/opendj-sdk/opends/src/ads/org/opends/admin/ads/util/PreferredConnection.java
+++ b/opendj-sdk/opends/src/ads/org/opends/admin/ads/util/PreferredConnection.java
@@ -22,11 +22,13 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2008 Sun Microsystems, Inc.
+ *      Copyright 2008-2009 Sun Microsystems, Inc.
  */
 
 package org.opends.admin.ads.util;
 
+import java.util.LinkedHashSet;
+
 import javax.naming.ldap.InitialLdapContext;
 
 /**
@@ -144,4 +146,22 @@
     PreferredConnection cnx = new PreferredConnection(ldapUrl, type);
     return cnx;
   }
+
+
+
+  /**
+   * Commodity method that generates a list of preferred connection (of just
+   * one) with the information on a given InitialLdapContext.
+   * @param ctx the connection we retrieve the inforamtion from.
+   * @return a list containing the preferred connection object.
+   */
+  public static LinkedHashSet<PreferredConnection> getPreferredConnections(
+      InitialLdapContext ctx)
+  {
+    PreferredConnection cnx = PreferredConnection.getPreferredConnection(ctx);
+    LinkedHashSet<PreferredConnection> returnValue =
+      new LinkedHashSet<PreferredConnection>();
+    returnValue.add(cnx);
+    return returnValue;
+  }
 }

--
Gitblit v1.10.0