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

matthew_swift
01.04.2010 6439bba5cc09d6febc59bdc9e0d9bc25f1f1eb18
sdk/src/org/opends/sdk/LDAPOptions.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2009-2010 Sun Microsystems, Inc.
 */
package org.opends.sdk;
@@ -50,6 +50,16 @@
  private DecodeOptions decodeOptions;
  /**
   * The list of cipher suite
   */
  private String[] enabledCipherSuites = null;
  /**
   * the list of protocols
   */
  private String[] enabledProtocols = null;
  /**
@@ -80,6 +90,8 @@
    this.timeoutInMillis = options.timeoutInMillis;
    this.useStartTLS = options.useStartTLS;
    this.decodeOptions = new DecodeOptions(options.decodeOptions);
    this.enabledCipherSuites = options.enabledCipherSuites;
    this.enabledProtocols = options.enabledProtocols;
  }
@@ -224,4 +236,66 @@
    return useStartTLS;
  }
  /**
   * Set the protocol versions enabled for secure connections with the
   * Directory Server.
   *
   * The protocols must be supported by the SSLContext specified in
   * {@link #setSSLContext(SSLContext)}. Following a successful call to
   * this method, only the protocols listed in the protocols parameter are
   * enabled for use.
   *
   * @param protocols Names of all the protocols to enable or {@code null} to
   *                  use the default protocols.
   * @return A reference to this LDAP connection options.
   */
  public final LDAPOptions setEnabledProtocols(String[] protocols)
  {
    this.enabledProtocols = protocols;
    return this;
  }
  /**
   * Set the cipher suites enabled for secure connections with the
   * Directory Server.
   *
   * The suites must be supported by the SSLContext specified in
   * {@link #setSSLContext(SSLContext)}. Following a successful call to
   * this method, only the suites listed in the protocols parameter are
   * enabled for use.
   *
   * @param suites Names of all the suites to enable or {@code null} to
   *                  use the default cipher suites.
   * @return A reference to this LDAP connection options.
   */
  public final LDAPOptions setEnabledCipherSuites(String[] suites)
  {
    this.enabledCipherSuites = suites;
    return this;
  }
  /**
   * Returns the names of the protocol versions which are currently enabled
   * for secure connections with the Directory Server.
   *
   * @return an array of protocols or {@code null} if the default protocols
   * are to be used.
   */
  public final String[] getEnabledProtocols()
  {
    return this.enabledProtocols;
  }
  /**
   * Returns the names of the protocol versions which are currently enabled
   * for secure connections with the Directory Server.
   *
   * @return an array of protocols or {@code null} if the default protocols
   * are to be used.
   */
  public final  String[] getEnabledCipherSuites()
  {
    return this.enabledCipherSuites;
  }
}