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

Ludovic Poitou
18.41.2010 1734229125e7bad5f85dfe11d076eeda206236a9
sdk/src/org/opends/sdk/requests/StartTLSExtendedRequestImpl.java
@@ -37,6 +37,7 @@
import com.sun.opends.sdk.util.Validator;
import java.util.*;
/**
@@ -55,7 +56,8 @@
        throws DecodeException
    {
      // TODO: Check the OID and that the value is not present.
      final StartTLSExtendedRequest newRequest = new StartTLSExtendedRequestImpl();
      final StartTLSExtendedRequest newRequest =
          new StartTLSExtendedRequestImpl();
      for (final Control control : request.getControls())
      {
        newRequest.addControl(control);
@@ -95,15 +97,16 @@
  /**
   * The list of cipher suite
   */
  private String[] enabledCipherSuites = null;
  private List<String> enabledCipherSuites = new LinkedList<String>();
  /**
   * the list of protocols
   */
  private String[] enabledProtocols = null;
  private List<String> enabledProtocols = new LinkedList<String>();
  // No need to expose this.
  private static final ExtendedResultDecoder<ExtendedResult> RESULT_DECODER = new ResultDecoder();
  private static final ExtendedResultDecoder<ExtendedResult> RESULT_DECODER =
      new ResultDecoder();
@@ -115,6 +118,28 @@
  /**
   * Creates a new startTLS extended request that is an exact copy of the
   * provided request.
   *
   * @param startTLSExtendedRequest
   *          The startTLS extended request to be copied.
   * @throws NullPointerException
   *           If {@code startTLSExtendedRequest} was {@code null} .
   */
  StartTLSExtendedRequestImpl(
      final StartTLSExtendedRequest startTLSExtendedRequest)
      throws NullPointerException
  {
    super(startTLSExtendedRequest);
    this.sslContext = startTLSExtendedRequest.getSSLContext();
    this.enabledCipherSuites.addAll(
        startTLSExtendedRequest.getEnabledCipherSuites());
    this.enabledProtocols.addAll(startTLSExtendedRequest.getEnabledProtocols());
  }
  // Prevent instantiation.
  private StartTLSExtendedRequestImpl()
  {
@@ -158,9 +183,12 @@
  /**
   * {@inheritDoc}}
   */
  public StartTLSExtendedRequest setEnabledProtocols(String[] protocols)
  public StartTLSExtendedRequest addEnabledProtocol(String... protocols)
  {
    this.enabledProtocols = protocols;
    for (final String protocol : protocols)
    {
      this.enabledProtocols.add(Validator.ensureNotNull(protocol));
    }
    return this;
  }
@@ -169,9 +197,12 @@
  /**
   * {@inheritDoc}}
   */
  public StartTLSExtendedRequest setEnabledCipherSuites(String[] suites)
  public StartTLSExtendedRequest addEnabledCipherSuite(String... suites)
  {
    this.enabledCipherSuites = suites;
    for (final String suite : suites)
    {
      this.enabledCipherSuites.add(Validator.ensureNotNull(suite));
    }
    return this;
  }
@@ -180,7 +211,7 @@
  /**
   * {@inheritDoc}}
   */
  public String[] getEnabledProtocols()
  public List<String> getEnabledProtocols()
  {
    return this.enabledProtocols;
  }
@@ -190,7 +221,7 @@
  /**
   * {@inheritDoc}}
   */
  public String[] getEnabledCipherSuites()
  public List<String> getEnabledCipherSuites()
  {
    return this.enabledCipherSuites;
  }