From f73b655466092169abac34833fb628fce1fcdebe Mon Sep 17 00:00:00 2001
From: jcduff <jcduff@localhost>
Date: Thu, 23 Oct 2008 14:04:24 +0000
Subject: [PATCH] The commit will bring the following features : - An updated version of the underlying database. BDB JE 3.3 is now used. - Attribute API refactoring providing a better abstraction and offering improved performances. - A new GUI called the Control-Panel to replace the Status-Panel: the specifications for this GUI are available on OpenDS Wiki and contains a link to a mockup. See <https://www.opends.org/wiki/page/ControlPanelUISpecification>. - Some changes in the replication protocol to implement "Assured Replication Mode". The specifications are on OpenDS Wiki at <https://www.opends.org/wiki/page/AssuredMode> and section 7 described some of the replication changes required to support this. Assured Replication is not finished, but the main replication protocol changes to support it are done. As explained by Gilles on an email on the Dev mailing list (http://markmail.org/message/46rgo3meq3vriy4a), with these changes the newer versions of OpenDS may not be able to replicate with OpenDS 1.0 instances. - Support for Service Tags on the platforms where the functionality is available and enabled. Specifications are published at <https://www.opends.org/wiki/page/OpenDSServiceTagEnabled>. For more information on Service Tags see <http://wikis.sun.com/display/ServiceTag/Sun+Service+Tag+FAQ>. - The Admin Connector service. In order to provide agentry of the OpenDS server at any time, a new service has been added, dedicated to the administration, configuration and monitoring of the server. An overview of the Admin Connector service and it's use is available on the OpenDS wiki <https://www.opends.org/wiki/page/ManagingAdministrationTrafficToTheServer> - Updates to the various command line tools to support the Admin Connector service. - Some internal re-architecting of the server to put the foundation of future developments such as virtual directory services. The new NetworkGroups and WorkFlow internal services which have been specified in <https://www.opends.org/wiki/page/BasicOperationRoutingThroughNetworkGroup> are now implemented. - Many bug fixes...
---
opends/src/ads/org/opends/admin/ads/util/ConnectionUtils.java | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/opends/src/ads/org/opends/admin/ads/util/ConnectionUtils.java b/opends/src/ads/org/opends/admin/ads/util/ConnectionUtils.java
index 8b41a68..7d7880f 100644
--- a/opends/src/ads/org/opends/admin/ads/util/ConnectionUtils.java
+++ b/opends/src/ads/org/opends/admin/ads/util/ConnectionUtils.java
@@ -44,6 +44,7 @@
import javax.naming.directory.Attributes;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
+import javax.naming.ldap.Control;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.StartTlsRequest;
import javax.naming.ldap.StartTlsResponse;
@@ -230,6 +231,60 @@
}
/**
+ * Clones the provided InitialLdapContext and returns a connection using
+ * the same parameters.
+ * @param ctx hte connection to be cloned.
+ * @param timeout the timeout to establish the connection.
+ * @param trustManager the trust manager to be used to connect.
+ * @param keyManager the key manager to be used to connect.
+ * @return the new InitialLdapContext connected to the server.
+ * @throws NamingException if there was an error creating the new connection.
+ */
+ public static InitialLdapContext cloneInitialLdapContext(
+ final InitialLdapContext ctx, int timeout, TrustManager trustManager,
+ KeyManager keyManager) throws NamingException
+ {
+ Hashtable<?, ?> env = ctx.getEnvironment();
+ Hashtable<?, ?> newEnv = new Hashtable<Object, Object>(env);
+ Control[] ctls = ctx.getConnectControls();
+ Control[] newCtls = null;
+ if (ctls != null)
+ {
+ newCtls = new Control[ctls.length];
+ for (int i=0; i<ctls.length; i++)
+ {
+ newCtls[i] = ctls[i];
+ }
+ }
+ /* Contains the DirContext and the Exception if any */
+ final Object[] pair = new Object[] {null, null};
+ final Hashtable fEnv = env;
+ final TrustManager fTrustManager = trustManager;
+ final KeyManager fKeyManager = keyManager;
+ final Control[] fNewCtls = newCtls;
+
+ Thread t = new Thread(new Runnable() {
+ public void run() {
+ try {
+ if (isSSL(ctx) || isStartTLS(ctx))
+ {
+ TrustedSocketFactory.setCurrentThreadTrustManager(fTrustManager,
+ fKeyManager);
+ }
+ pair[0] = new InitialLdapContext(fEnv, fNewCtls);
+
+ } catch (NamingException ne) {
+ pair[1] = ne;
+
+ } catch (RuntimeException re) {
+ pair[1] = re;
+ }
+ }
+ });
+ return getInitialLdapContext(t, pair, timeout);
+ }
+
+ /**
* Creates an LDAP+StartTLS connection and returns the corresponding
* LdapContext.
* This method first creates an LdapContext with anonymous bind. Then it
--
Gitblit v1.10.0