| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package com.sun.opends.sdk.ldap; |
| | |
| | | implements ConnectionFactory |
| | | { |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | @SuppressWarnings("rawtypes") |
| | | private final class FutureResultImpl implements CompletionHandler<Connection> |
| | | { |
| | | private final FutureResultTransformer<Result, AsynchronousConnection> futureStartTLSResult; |
| | |
| | | { |
| | | final StartTLSExtendedRequest startTLS = Requests |
| | | .newStartTLSExtendedRequest(options.getSSLContext()); |
| | | startTLS.setEnabledCipherSuites(options.getEnabledCipherSuites()); |
| | | startTLS.setEnabledProtocols(options.getEnabledProtocols()); |
| | | return connection.extendedRequest(startTLS, handler); |
| | | } |
| | | |
| | |
| | | try |
| | | { |
| | | connection.startTLS(options.getSSLContext(), |
| | | options.getEnabledProtocols(), |
| | | options.getEnabledCipherSuites(), |
| | | new EmptyCompletionHandler<SSLEngine>() |
| | | { |
| | | @Override |
| | |
| | | */ |
| | | @Override |
| | | public FutureResult<AsynchronousConnection> getAsynchronousConnection( |
| | | final ResultHandler<AsynchronousConnection> handler) |
| | | final ResultHandler<? super AsynchronousConnection> handler) |
| | | { |
| | | final FutureResultImpl future = new FutureResultImpl(handler); |
| | | |