mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
27.25.2009 e38f6f28245cc16aa183e923039dfaef931080c3
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;
  }
}