| | |
| | | |
| | | import com.sun.opends.sdk.util.Validator; |
| | | |
| | | import java.util.*; |
| | | |
| | | |
| | | /** |
| | |
| | | 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); |
| | |
| | | /** |
| | | * 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(); |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 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() |
| | | { |
| | |
| | | /** |
| | | * {@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; |
| | | } |
| | | |
| | |
| | | /** |
| | | * {@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; |
| | | } |
| | | |
| | |
| | | /** |
| | | * {@inheritDoc}} |
| | | */ |
| | | public String[] getEnabledProtocols() |
| | | public List<String> getEnabledProtocols() |
| | | { |
| | | return this.enabledProtocols; |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc}} |
| | | */ |
| | | public String[] getEnabledCipherSuites() |
| | | public List<String> getEnabledCipherSuites() |
| | | { |
| | | return this.enabledCipherSuites; |
| | | } |