From 6439bba5cc09d6febc59bdc9e0d9bc25f1f1eb18 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Wed, 01 Sep 2010 09:04:15 +0000
Subject: [PATCH] Various improvements:

---
 sdk/src/org/opends/sdk/LDAPOptions.java |   76 +++++++++++++++++++++++++++++++++++++
 1 files changed, 75 insertions(+), 1 deletions(-)

diff --git a/sdk/src/org/opends/sdk/LDAPOptions.java b/sdk/src/org/opends/sdk/LDAPOptions.java
index 0c17217..f58cbfa 100644
--- a/sdk/src/org/opends/sdk/LDAPOptions.java
+++ b/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;
+  }
+
 }

--
Gitblit v1.10.0