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/ServerDescriptor.java | 105 +++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 98 insertions(+), 7 deletions(-)
diff --git a/opends/src/ads/org/opends/admin/ads/ServerDescriptor.java b/opends/src/ads/org/opends/admin/ads/ServerDescriptor.java
index c954372..d6b39d4 100644
--- a/opends/src/ads/org/opends/admin/ads/ServerDescriptor.java
+++ b/opends/src/ads/org/opends/admin/ads/ServerDescriptor.java
@@ -76,6 +76,10 @@
*/
LDAPS_PORT,
/**
+ * The associated value is an Integer.
+ */
+ ADMIN_PORT,
+ /**
* The associated value is an ArrayList of Boolean.
*/
LDAP_ENABLED,
@@ -86,6 +90,10 @@
/**
* The associated value is an ArrayList of Boolean.
*/
+ ADMIN_ENABLED,
+ /**
+ * The associated value is an ArrayList of Boolean.
+ */
STARTTLS_ENABLED,
/**
* The associated value is an ArrayList of Integer.
@@ -375,9 +383,46 @@
}
/**
+ * Returns the URL to access this server using the administration connector.
+ * Returns <CODE>null</CODE> if the server cannot get the administration
+ * connector.
+ * @return the URL to access this server using the administration connector.
+ */
+ public String getAdminConnectorURL()
+ {
+ String adminConnectorUrl = null;
+ String host = getHostName();
+ int port = -1;
+
+ if (!serverProperties.isEmpty())
+ {
+ ArrayList s = (ArrayList)serverProperties.get(
+ ServerProperty.ADMIN_ENABLED);
+ ArrayList p = (ArrayList)serverProperties.get(
+ ServerProperty.ADMIN_PORT);
+ if (s != null)
+ {
+ for (int i=0; i<s.size(); i++)
+ {
+ if (Boolean.TRUE.equals(s.get(i)))
+ {
+ port = (Integer)p.get(i);
+ break;
+ }
+ }
+ }
+ }
+ if (port != -1)
+ {
+ adminConnectorUrl = ConnectionUtils.getLDAPUrl(host, port, true);
+ }
+ return adminConnectorUrl;
+ }
+
+ /**
* Returns a String of type host-name:port-number for the server. If
* the provided securePreferred is set to true the port that will be used
- * (if LDAPS is enabled) will be the LDAPS port.
+ * will be the administration connector port.
* @param securePreferred whether to try to use the secure port as part
* of the returning String or not.
* @return a String of type host-name:port-number for the server.
@@ -407,8 +452,8 @@
if (securePreferred)
{
s = (ArrayList)serverProperties.get(
- ServerProperty.LDAPS_ENABLED);
- p = (ArrayList)serverProperties.get(ServerProperty.LDAPS_PORT);
+ ServerProperty.ADMIN_ENABLED);
+ p = (ArrayList)serverProperties.get(ServerProperty.ADMIN_PORT);
if (s != null)
{
for (int i=0; i<s.size(); i++)
@@ -426,14 +471,14 @@
{
boolean secure;
- Object v = adsProperties.get(ADSContext.ServerProperty.LDAPS_ENABLED);
+ Object v = adsProperties.get(ADSContext.ServerProperty.ADMIN_ENABLED);
secure = securePreferred && "true".equalsIgnoreCase(String.valueOf(v));
try
{
if (secure)
{
port = Integer.parseInt((String)adsProperties.get(
- ADSContext.ServerProperty.LDAPS_PORT));
+ ADSContext.ServerProperty.ADMIN_PORT));
}
else
{
@@ -462,7 +507,9 @@
ServerProperty [] props =
{
ServerProperty.LDAP_PORT, ServerProperty.LDAPS_PORT,
- ServerProperty.LDAP_ENABLED, ServerProperty.LDAPS_ENABLED
+ ServerProperty.ADMIN_PORT,
+ ServerProperty.LDAP_ENABLED, ServerProperty.LDAPS_ENABLED,
+ ServerProperty.ADMIN_ENABLED
};
for (ServerProperty prop : props) {
ArrayList s = (ArrayList) serverProperties.get(prop);
@@ -478,8 +525,10 @@
ADSContext.ServerProperty.HOST_NAME,
ADSContext.ServerProperty.LDAP_PORT,
ADSContext.ServerProperty.LDAPS_PORT,
+ ADSContext.ServerProperty.ADMIN_PORT,
ADSContext.ServerProperty.LDAP_ENABLED,
- ADSContext.ServerProperty.LDAPS_ENABLED
+ ADSContext.ServerProperty.LDAPS_ENABLED,
+ ADSContext.ServerProperty.ADMIN_ENABLED
};
for (int i=0; i<props.length; i++)
{
@@ -550,6 +599,7 @@
{
{ServerProperty.LDAP_ENABLED, ServerProperty.LDAP_PORT},
{ServerProperty.LDAPS_ENABLED, ServerProperty.LDAPS_PORT},
+ {ServerProperty.ADMIN_ENABLED, ServerProperty.ADMIN_PORT},
{ServerProperty.JMX_ENABLED, ServerProperty.JMX_PORT},
{ServerProperty.JMXS_ENABLED, ServerProperty.JMXS_PORT}
};
@@ -559,6 +609,8 @@
ADSContext.ServerProperty.LDAP_PORT},
{ADSContext.ServerProperty.LDAPS_ENABLED,
ADSContext.ServerProperty.LDAPS_PORT},
+ {ADSContext.ServerProperty.ADMIN_ENABLED,
+ ADSContext.ServerProperty.ADMIN_PORT},
{ADSContext.ServerProperty.JMX_ENABLED,
ADSContext.ServerProperty.JMX_PORT},
{ADSContext.ServerProperty.JMXS_ENABLED,
@@ -644,6 +696,7 @@
updateLdapConfiguration(desc, ctx, filter);
+ updateAdminConnectorConfiguration(desc, ctx, filter);
updateJmxConfiguration(desc, ctx, filter);
updateReplicas(desc, ctx, filter);
updateReplication(desc, ctx, filter);
@@ -715,6 +768,44 @@
}
}
+ private static void updateAdminConnectorConfiguration(ServerDescriptor desc,
+ InitialLdapContext ctx, TopologyCacheFilter cacheFilter)
+ throws NamingException
+ {
+ SearchControls ctls = new SearchControls();
+ ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
+ ctls.setReturningAttributes(
+ new String[] {
+ "ds-cfg-listen-port",
+ "objectclass"
+ });
+ String filter = "(objectclass=ds-cfg-administration-connector)";
+
+ LdapName jndiName = new LdapName("cn=config");
+ NamingEnumeration listeners = ctx.search(jndiName, filter, ctls);
+
+ Integer adminConnectorPort = null;
+
+ // we should have a single administration connector
+ if (listeners.hasMore()) {
+ SearchResult sr = (SearchResult) listeners.next();
+ String port = getFirstValue(sr, "ds-cfg-listen-port");
+ adminConnectorPort = new Integer(port);
+ }
+
+ // Even if we have a single port, use an array to be consistent with
+ // other protocols.
+ ArrayList<Integer> adminPorts = new ArrayList<Integer>();
+ ArrayList<Boolean> adminEnabled = new ArrayList<Boolean>();
+ if (adminConnectorPort != null)
+ {
+ adminPorts.add(adminConnectorPort);
+ adminEnabled.add(Boolean.TRUE);
+ }
+ desc.serverProperties.put(ServerProperty.ADMIN_PORT, adminPorts);
+ desc.serverProperties.put(ServerProperty.ADMIN_ENABLED, adminEnabled);
+ }
+
private static void updateJmxConfiguration(ServerDescriptor desc,
InitialLdapContext ctx, TopologyCacheFilter cacheFilter)
throws NamingException
--
Gitblit v1.10.0