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/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java | 40 ++++++++++++++++++++++++++++++++++------
1 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
index 6f39879..e1093f0 100644
--- a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
+++ b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
@@ -34,7 +34,10 @@
import org.opends.messages.Message;
import org.opends.server.admin.server.ConfigurationChangeListener;
+import org.opends.server.admin.server.ServerManagementContext;
+import org.opends.server.admin.std.server.BackendCfg;
import org.opends.server.admin.std.server.LocalBackendWorkflowElementCfg;
+import org.opends.server.admin.std.server.RootCfg;
import org.opends.server.api.Backend;
import org.opends.server.config.ConfigException;
import org.opends.server.core.AddOperation;
@@ -48,11 +51,14 @@
import org.opends.server.types.*;
import org.opends.server.workflowelement.LeafWorkflowElement;
+import static org.opends.server.config.ConfigConstants.*;
+
+
/**
* This class defines a local backend workflow element; e-g an entity that
- * handle the processing of an operation aginst a local backend.
+ * handle the processing of an operation against a local backend.
*/
public class LocalBackendWorkflowElement extends
LeafWorkflowElement<LocalBackendWorkflowElementCfg>
@@ -73,6 +79,10 @@
private static Object registeredLocalBackendsLock = new Object();
+ // A string indicating the type of the workflow element.
+ private final String BACKEND_WORKFLOW_ELEMENT = "Backend";
+
+
/**
* Creates a new instance of the local backend workflow element.
*/
@@ -95,7 +105,7 @@
private void initialize(String workflowElementID, Backend backend)
{
// Initialize the workflow ID
- super.initialize(workflowElementID);
+ super.initialize(workflowElementID, BACKEND_WORKFLOW_ELEMENT);
this.backend = backend;
@@ -142,7 +152,7 @@
{
// null all fields so that any use of the finalized object will raise
// an NPE
- super.initialize(null);
+ super.initialize(null, null);
backend = null;
}
@@ -197,17 +207,35 @@
boolean isAcceptable = true;
// If the workflow element is disabled then do nothing. Note that the
- // config manager could have finalized the object right before.
+ // configuration manager could have finalized the object right before.
if (configuration.isEnabled())
{
// Read configuration.
String newBackendID = configuration.getBackend();
Backend newBackend = DirectoryServer.getBackend(newBackendID);
- // Get the new config
+ // If the backend is null (i.e. not found in the list of
+ // registered backends, this is probably because we are looking
+ // for the config backend
+ if (newBackend == null) {
+ ServerManagementContext context = ServerManagementContext.getInstance();
+ RootCfg root = context.getRootConfiguration();
+ try {
+ BackendCfg backendCfg = root.getBackend(newBackendID);
+ if (backendCfg.getBaseDN().contains(DN.decode(DN_CONFIG_ROOT))) {
+ newBackend = DirectoryServer.getConfigHandler();
+ }
+ } catch (Exception ex) {
+ // Unable to find the backend
+ newBackend = null;
+ }
+ }
+
+ // Get the new configuration
if (applyChanges)
{
- super.initialize(configuration.getWorkflowElementId());
+ super.initialize(
+ configuration.getWorkflowElementId(), BACKEND_WORKFLOW_ELEMENT);
backend = newBackend;
}
}
--
Gitblit v1.10.0