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/core/WorkflowImpl.java |   39 +++++++++++++++++++++++++++------------
 1 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/WorkflowImpl.java b/opends/src/server/org/opends/server/core/WorkflowImpl.java
index f0a729e..10208e0 100644
--- a/opends/src/server/org/opends/server/core/WorkflowImpl.java
+++ b/opends/src/server/org/opends/server/core/WorkflowImpl.java
@@ -28,6 +28,8 @@
 
 import static org.opends.messages.CoreMessages.*;
 import org.opends.messages.Message;
+import org.opends.messages.MessageBuilder;
+
 import static org.opends.server.util.Validator.ensureNotNull;
 
 import java.util.Collection;
@@ -52,7 +54,7 @@
   private String workflowID = null;
 
   // The root of the workflow task tree.
-  private WorkflowElement rootWorkflowElement = null;
+  private WorkflowElement<?> rootWorkflowElement = null;
 
   // The base DN of the data handled by the workflow.
   private DN baseDN = null;
@@ -90,9 +92,9 @@
    * @param rootWorkflowElement the root node of the workflow task tree
    */
   public WorkflowImpl(
-      String          workflowId,
-      DN              baseDN,
-      WorkflowElement rootWorkflowElement
+      String             workflowId,
+      DN                 baseDN,
+      WorkflowElement<?> rootWorkflowElement
       )
   {
     this.workflowID = workflowId;
@@ -130,7 +132,7 @@
   /**
    * Gets the workflow internal identifier.
    *
-   * @return the workflow internal indentifier
+   * @return the workflow internal identifier
    */
   public String getWorkflowId()
   {
@@ -158,15 +160,28 @@
    * @param operation  the operation to execute
    *
    * @throws CanceledOperationException if this operation should
-   * be cancelled.
+   * be canceled.
    */
-  public void execute(Operation operation) throws CanceledOperationException {
-    rootWorkflowElement.execute(operation);
+  public void execute(Operation operation)
+    throws CanceledOperationException
+  {
+    if (rootWorkflowElement != null)
+    {
+      rootWorkflowElement.execute(operation);
+    }
+    else
+    {
+      // No root workflow element? It's a configuration error.
+      operation.setResultCode(ResultCode.OPERATIONS_ERROR);
+      MessageBuilder message = new MessageBuilder(
+        ERR_ROOT_WORKFLOW_ELEMENT_NOT_DEFINED.get(workflowID));
+      operation.setErrorMessage(message);
+    }
   }
 
 
   /**
-   * Registers the current worklow (this) with the server.
+   * Registers the current workflow (this) with the server.
    *
    * @throws  DirectoryException  If the workflow ID for the provided workflow
    *                              conflicts with the workflow ID of an existing
@@ -197,7 +212,7 @@
 
 
   /**
-   * Deregisters the current worklow (this) with the server.
+   * Deregisters the current workflow (this) with the server.
    */
   public void deregister()
   {
@@ -214,7 +229,7 @@
 
 
   /**
-   * Deregisters a worklow with the server. The workflow to deregister
+   * Deregisters a workflow with the server. The workflow to deregister
    * is identified with its identifier.
    *
    * @param workflowID  the identifier of the workflow to deregister
@@ -283,7 +298,7 @@
    *
    * @return the root workflow element.
    */
-  WorkflowElement getRootWorkflowElement()
+  WorkflowElement<?> getRootWorkflowElement()
   {
     return rootWorkflowElement;
   }

--
Gitblit v1.10.0