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

Ludovic Poitou
22.52.2010 90405b8f9778a5a266307ef27c43d7484bc1fb91
opendj-sdk/sdk/src/org/opends/sdk/LDAPOptions.java
@@ -29,11 +29,14 @@
import java.util.*;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLContext;
import org.glassfish.grizzly.nio.transport.TCPNIOTransport;
import com.sun.opends.sdk.util.Validator;
@@ -41,7 +44,7 @@
/**
 * Common options for LDAP client connections.
 */
public class LDAPOptions
public final class LDAPOptions
{
  private SSLContext sslContext;
@@ -61,6 +64,8 @@
   */
  private List<String> enabledProtocols = new LinkedList<String>();
  private TCPNIOTransport transport;
  /**
@@ -69,11 +74,11 @@
   */
  public LDAPOptions()
  {
    super();
    this.sslContext = null;
    this.timeoutInMillis = 0;
    this.useStartTLS = false;
    this.decodeOptions = new DecodeOptions();
    this.transport = null;
  }
@@ -93,6 +98,7 @@
    this.decodeOptions = new DecodeOptions(options.decodeOptions);
    this.enabledCipherSuites.addAll(options.getEnabledCipherSuites());
    this.enabledProtocols.addAll(options.getEnabledProtocols());
    this.transport = options.transport;
  }
@@ -130,6 +136,23 @@
  /**
   * Returns the Grizzly TCP transport which will be used when initiating
   * connections with the Directory Server. By default this method will return
   * {@code null} indicating that the default transport factory should be used
   * to obtain a TCP transport.
   *
   * @return The Grizzly TCP transport which will be used when initiating
   *         connections with the Directory Server, or {@code null} if the
   *         default transport factory should be used to obtain a TCP transport.
   */
  public final TCPNIOTransport getTCPNIOTransport()
  {
    return transport;
  }
  /**
   * Returns the operation timeout in the specified unit.
   *
   * @param unit
@@ -186,6 +209,27 @@
  /**
   * Sets the Grizzly TCP transport which will be used when initiating
   * connections with the Directory Server. By default this method will return
   * {@code null} indicating that the default transport factory will be used to
   * obtain a TCP transport.
   *
   * @param transport
   *          The Grizzly TCP transport which will be used when initiating
   *          connections with the Directory Server, or {@code null} if the
   *          default transport factory should be used to obtain a TCP
   *          transport.
   * @return A reference to this LDAP connection options.
   */
  public final LDAPOptions setTCPNIOTransport(final TCPNIOTransport transport)
  {
    this.transport = transport;
    return this;
  }
  /**
   * Sets the operation timeout. If the response is not received from the
   * Directory Server in the timeout period, the operation will be abandoned and
   * an error result returned. A timeout setting of 0 disables timeout limits.